Termux #1278
robertkirkman
started this conversation in
Ideas
Termux
#1278
Replies: 1 comment 1 reply
-
Interesting! May I ask what is the motivation for wanting to run VSCode directly on the Android device?
One of my goals is to make CodeLLDB as portable as practically possible across various Linux distros and their versions. So I'm linking everything statically, except for the required and very common shared libraries. To ensure that nothing else creeps in, the test suite validates that CodeLLDB has only whitelisted runtime dependencies. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Termux is a complete Terminal Emulator Application and distribution of
bash
,apt
,nodejs
,cargo
,rustc
,clang
,lldb
,make
,cmake
, X11 Server andcode-oss
for Android.With Termux, cross-compilation becomes optional, instead of required, for writing, building, and debugging C, C++, and Rust on Android.
Unlike the situation near the beginning of Android's lifecycle (2010-2015), a second device other than Android is no longer necessarily required.
I am going to write the full steps that I used to successfully compile, install and use codelldb entirely inside of Termux, which is to say, to use codelldb on Android with cross-compilation entirely disabled, as opposed to the standard Android development workflow which normally requires the use of cross-compilation at some point.
Unfortunately, the steps are a little bit messy, and I am not completely sure yet if all of these steps and patches are absolutely required or if some of them can be removed or refactored to streamline the installation process in a better way, but this is what is initially working for me so I wanted to share this.
Install Dependencies
Note
pkg install tur-repo
to getcode-oss
might not be required in the future eventually after this series of events has concluded:Retrieve Code
Note
Last designed and tested for codelldb commit 8aa3be2
Apply Patch
Note
I created this patch onto codelldb to implement Android support.
I am not sure about this part:
AllowedDependencies
. I do not understand what that is for, so the list of things I typed there is just guessing.Fetch Cargo Crates and
sed
-patchweaklink
Note
This Cargo Crate, https://github.com/vadimcn/weaklink, was designed only for GNU/Linux, and must be patched in the "treat Android as Linux" style in order to avoid build errors.
Set Environment Variables
Note
These environment variables helped me bypass errors during the build process
Configure and Build
Note
The codelldb documentation states "You will get linker errors if you don't use the toolchain file", but for some reason, it seems to still work for me even though I didn't technically use
-DCMAKE_TOOLCHAIN_FILE
. I am not sure exactly why.Install
.vsix
Note
For some reason, the
lldb
binary does not get placed in the necessary location automatically after--install-extension
, so I use another command to create a symbolic link to the original location, which appears to work.Done
Note
After the above steps,
code-oss
shows that codelldb is installed for me, and it begins working in the "run and debug" menu exactly the same as it works on VSCodium on GNU/Linux! Here is an example of how to launchcode-oss
in the Termux:X11 app, but I suspect that other editors that do not necessarily require X11, likecode-server
frompkg install code-server
, might also work with it!Beta Was this translation helpful? Give feedback.
All reactions