-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make termux self-hosting #1756
Comments
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
I've got termux to install from within termux (i.e. without Gradle), but crashes with [abbv]:
BTW: it's a I've got my own (simple) apps to install and run, as proper android apps (on the homescreen etc). So I partly know what I'm doing. For building termux, everything compiles (including native), all junit tests successful, packaged (including annotation and core-ui support libraries), installed. I think packaging resources with Anyone know how to package termux's subprojects and support libraries with [ I might try modifying termux and app's PS: I'm on Android 5.1 Lollipop. |
I'm a little unclear, you want to build the Termux apk in Termux? I thought this issue was about building Termux deb packages in Termux. Take a look at the instructions I wrote up on building simple apks using |
Thanks for the quick reply! Should I start a new issue for this? Thanks for the link - the packaging there is similar to your Feb 15, 2016 comment, which was one of the references I used to get native code working. Unfortunately, it doesn't cover packaging resources from multiple sources, which I think is the problem here - termux has three subprojects and uses two support libraries. EDIT Apparently, Gradle will output the |
I haven't used a PC in three years either, only been using Android and Termux on a tablet and smartphone since my ultrabook died. You could submit a pull to dump the debug output to the termux-app github, then look at the debug log in the CI log. |
@joakim-noah Good solution. Though I saw on the logs it uses The same problem happens with the AccessibilityDelegate of PagerView, from the same core-ui support aar. The resources files don't seem relevant to these particular classes, so might be something else after all, a version problem maybe? I've got it running, and installing the bootstrap-arm.zip - but this is output on the terminal itself:
(copied by hand, but I think it's right). This string is assembled from within I comfirmed that all the executables Could it be a file-permission problem, because it's I'm also just using plain |
Never dug much deeper than the sample apks, so don't know about more complex resources, and never built Termux either. |
No worries, thanks for your responses. I got it working by using bash instead of login for the shell. It turns out the base directory
Fortunately, bash still runs. The busybox utilities also work (e.g. its basic Need to patch the sources and build, though I'm not sure how to make them truly directory independent (I don't want to make a hardcoded Anyway... building |
To clarify: I got it to start with
Some features of the terminal weren't working - backspace, arrows - and vim was printing out strings at the bottom instead of modifying text in-place. By using a new name of the same length,
I tried patching everything in I got vim working by copying Of course, it's very helpful to also copy across your Curiously, |
Any interest in adding this, maybe by installing a Termux environment in a VPS so that cloud builds of Termux packages can continue? I ask because I just got much of Swift built and working in Termux, swiftlang/swift@796d6ad, and to get a Termux package for Swift built next, I now have to figure out how to get it all cross-compiled too. It would be easiest if these Termux build scripts simply supported building in Termux instead. I can understand why this wasn't done from the beginning, but now that Termux is being used more and more for development, maybe it's time to add that option too. |
Cross-compiling now available for everyone. Just setup a CI for your repository, example configuration available in https://github.com/termux/termux-packages/blob/master/.cirrus.yml.
There several problems:
Above problems are derived from how build scripts are written. But there actually more which are package-specific (though maybe related to either case 1 or 2).
Can you tell for which purpose self-hosting is needed ? Previous versions of packages can be built on CI (no PC needed, only Termux) but will require some initial configuration (easy + config sample at https://github.com/termux/termux-packages/blob/master/.cirrus.yml). |
I got it build-package.sh partially working in Termux:
Later will post which issues are happens there. Actual issues are:
|
Thanks, but that's not really the problem, as I have a linux x86_64 VPS and can cross-compile other packages from this repo just fine. I'm simply saying that writing a Termux build.sh to cross-compile Swift will be more work than one that natively compiles it. I doubt I'm alone, as I see others who've built projects natively in Termux, Anyway, I can get it cross-compiled, it's not insurmountable, simply more work. I thought I'd try and spur a discussion about having a native build option in this repo, leaving aside the Swift package and speaking generally.
I doubt this is going to cause problems, as it's unlikely that they patched clang and other build tools much for the NDK. It is possible though.
Sure, native builds won't work for all packages: I figured there could be a variable set for those, so that they're only cross-compiled from Ubuntu.
I don't see why, I only see patches that add the Termux sysroot, not the Ubuntu layout. That makes sense, as the packages ultimately run in Termux. If you mean the main build scripts in scripts/build and not the individual package scripts in packages/, yes, the idea is to patch the former to work in Termux too, which provides an even more standard layout than linux distros. 😉
As I said above, many of the Swift repos have been cross-compiled by others before, swiftlang/swift#26298, so I should be able to get them cross-compiled from linux. But I doubt the Swift package manager has been, so I think that will take more work. And just generally, after getting a package like this built natively, packagers have to go figure out how to cross-compile it. While I can do it for Swift, it would be nice if Termux started supporting native package builds also.
Thanks, great to see you trying it out. I thought there was some repo that already ported the build scripts to Termux some time back, but I can't find it now.
Ah, yes, that is a problem, didn't think of that, was hoping cross-compiling from Termux would work too.
Yes, some subset of packages will still require cross-compiling from Ubuntu for reasons like this, so they can just have a variable like TERMUX_LINUX_BUILD=yes set so that they're never built on Termux. Thanks for trying it out, I think this repo should definitely have a native option. While I think that's doable over time, I figured the bigger issue is where those native packages would actually be built: how do you imagine that working, say if I submit a Termux package that only builds natively? Do you think it would be that hard to set up a Termux environment in Cirrus or whatever is currently used to build official packages? I think figuring out that part, how to continue cloud builds of native Termux packages, is what needs some thought. I've built code in an Android emulator or virtual environment like that before, but I don't know how hard it would be for you guys to set one up for this project, so that Termux-native packages could be automatically built in the cloud. |
As I remember, some packages are building fine with NDK but in Termux throw compiler errors. With same set of patches. Maybe something was changed with recent versions, but I need verify this.
I already started to fix the Termux build system for self-hosting and it now exports variable
I guess that will be rare case. Mostly happens when program's authors haven't implemented support for cross-compiling. Headers in ndk-sysroot are same as in build environment so they should not be a problem.
There no problem with launching Termux in Android virtual device inside Cirrus. But there are problems related to:
|
Closing since on-device build support was implemented. Not all packages can be built on device, but hope that will be changed in future. |
it would be awesome is termux could build its own apt.
similar: #63
If termux was self-hosting I would be able to do some packaging. But the current build system is too hacked up, I can't get it working.
The text was updated successfully, but these errors were encountered: