Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Report problems with the new support for on-device builds #4157
I've been trying it out in a fresh Termux, so I'll start. I'll note that there's at least three tiers of dependencies, with the bottom tier made up of some of the packages that are installed in the new setup script for Termux, which I purposely didn't run, let's call it Tier 1. Tier 1 is required to even run scripts/build/ from this repo. Tier 2 would be common build packages that are needed by many packages, but not by scripts/build/. Tier 3 would be the rest.
Here's my experience starting from scratch, my attempt to map part of the dependency tree by starting from the bottom:
I first tried to build ninja, but python was needed for buildorder.py in this repo and then clang to compile termux-elf-cleaner. After those two Tier 1 pre-built packages were installed, ninja wouldn't build, as its build script currently requires a pre-built ninja to build it. I'll patch that and submit a pull.
Next, I tried building kakoune, my editor of choice. That package provides a Makefile, so I had to build make, but these scripts require a pre-built make to build it, so I installed it. Kakoune would then build but fail when linking, missing several symbols from ncurses. So I tried building those ncurses packages, even though a couple are installed by default, by forcing a build.
ncurses requires the file package to build, but the file source wouldn't download, so I installed the package. Once the ncurses packages were all built, kakoune still wouldn't link, then I noticed a call to pkg-config in the build output that was failing, so I tried to build pkg-config.
pkg-config needs glib, which requires perl and meson to build. There's no package yet for meson though, and I figured perl would be too much work, so I installed those two packages. Finally, pkg-config requires itself to build, so I just ended up installing it.
At last, I got kakoune to build!
I tried git next, which appears to build but then failed when installing the docs, as it requires asciidoc, for which I see no Termux package.
Finally, I tried to build the CMake package. It requires jsoncpp, which is built by CMake, and libarchive, which won't build because it expects posix_spawn. So I installed those two packages, and then the libuv dependency wouldn't build, because it requires automake.
Automake wouldn't build initially because it requires m4, which wouldn't build because it also wanted posix_spawn, so I installed the m4 pre-built package and Automake built. libuv then also needed libtoolize from the libtool package, so I built that one and finally got to CMake itself.
CMake depends on itself, but I saw a configure script in its source, so I turned off the TERMUX_PKG_FORCE_CMAKE flag for it and tried to build it that way. At first it seemed to build if I removed the --disable-dependency-tracking flag for the autotools script, but finally failed with another flag there. After that, it always gave strange errors in that final autotools invocation about flags missing, so I gave up and just installed the pre-built package for CMake.
I'll add some of these notes to the setup script for Termux, so people can see where the dependencies come from and work to remove them if they want.
Try out the new on-device build support for yourself and report similar dependencies like this here, so we can get more packages built on-device. I've tried out mostly Tier 1 and 2 packages, but build info for all packages is welcome.
You can't build make without
Probably because just
As I wrote in #1756, environments & compiler aren't same.
Comparison of on-device config.h and cross-compiled: https://gist.github.com/xeffyr/e752f3ef4a040ea4c68279e47e2973ec
Coreutils - breaks environment (ln utility disappears):
On-device builds are now disabled for this package.
Continuing my attempt of building on device as much as possible.
Looking into having CMake set CMAKE_SYSTEM_NAME and CMAKE_HOST_SYSTEM_NAME to Android by default on device and avoid the NDK support, got it to work with a small CMake project, cmark, but I think I'll need to look into the Android/Linux platform Modules more for a more robust patch. I should have a CMake pull later this week.
Serf (require scons build tool):
Valgrind (requires static libc):
Finished my on-device "build session". Stats:
Packages that are disabled for building on device are omitted. The same goes to packages which take long time to compile and few golang-based packages.
Because I will run out of space. Their build directories expand too much at the build time process and after building other packages I had only 2.6 GB on internal storage left after building non-go packages.
I just built most of them. Golang & fzf are disabled for on-device builds. Gitea fails at:
I was hoping that using
I suppose that creating a script
Is there a regression with CMake where it no longer detects CMAKE_HOST_SYSTEM_PROCESSOR and CMAKE_SYSTEM_PROCESSOR, returning "Process failed because: No such file or directory" instead? I've been making the aforementioned modifications to set CMAKE_SYSTEM_NAME to Android in Termux, then I started hitting strange errors for CMake projects that check the host processor, which I hadn't seen before. I checked with stock CMake 3.15.2 on another device using the Android-5 package repo and I see the problem there too, which makes me think this might be tied to all the recent busybox/coreutils changes, not CMake?
To be precise, this is the invocation of uname -m that breaks now. Just check that variable in a CMake project by adding this line,
Update: found the bug and fixed it in #4212.