这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@robertkirkman
Copy link
Member

Previous attempts and progress:

This PR mainly implements the package in a termux-packages downstream-oriented way (heavy use of internal termux-packages repository code shared with other termux-packages).

There is discussion regarding the upstream-oriented way of implementation from the SBCL side (trying to non-cross-compile while avoiding use of any internal termux-packages repository code) here:
https://bugs.launchpad.net/sbcl/+bug/1956852

Preexisting packages that share similar special build dependencies internal to the termux-packages toolchain:

TERMUX_PKG_BUILD_DEPENDS="aosp-libs, tk, xorgproto"

TERMUX_PKG_BUILD_DEPENDS="aosp-libs, coreutils, clang, make, pkg-config, python2, tk, xorgproto"

TERMUX_PKG_BUILD_DEPENDS="aosp-libs"

TERMUX_PKG_BUILD_DEPENDS="aosp-libs"

This is passing 100% of the testsuite on 64-bit ARM Android devices without disabling any tests, and is also passing all of the tests during CI immediately after cross-compilation, except for two tests that only fail in the termux-proot-run environment, and two tests that intermittently fail rarely, read-line of tests/arena.impure.lisp, and overeager-character-buffering of stream.impure.lisp. I do not know why they intermittently fail, but in order to avoid a possible CI failure or inconvenience for future builds, I have disabled them here.

However, it is currently failing one test consistently, elfcore.test.sh/elf-sans-immobile.test.sh on Android-x86, that would also fail on ARM Android if it were enabled there, but that test is only enabled by upstream for x86 targets, not ARM targets (testsuite toggles between those two variants of the test depending on what featureset the x86 build of SBCL was built with). That is the only failing test I do not yet understand how to fix, so I am disabling it here. Upstream also sometimes disables this test even on x86, depending on a complicated set of factors, as seen in a recent development commit: sbcl/sbcl@b219fb3

Upstream does not support 32-bit Android, and when I tried to force-enable the 32-bit Android targets, I could not successfully do it because of the extreme difficulty.

I also have not been able to figure out how to get the docs to successfully build, but the man sbcl command does work anyway because the sbcl.1 manpage is included in the source archive.

@roboticarm2000 @metayan @aadcg @francogrex @SAVITAR-tech-collab If you are still interested in SBCL, I would be interested to know your opinions about this build and whether you have any ideas for additional tests I could check whether it passes beyond the official testsuite.

+FILE *termux_tmpfile(void)
+{
+ return tmpfile();
+}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand the amount of surrounding code is large, making this not immediately obvious, so I will point it out with this comment.

This specific part here, termux_tmpfile() implementation and its call replacement in src/code/fd-stream.lisp, is what partially fixes this issue (meaning, fixes in the manifestation present in SBCL, but does not fix globally for the MRE given in the issue, which in my opinion is probably not possible to fix globally without breaking another software in some way)

@robertkirkman robertkirkman marked this pull request as draft April 18, 2025 13:16
- Fixes termux#948
- Partially fixes termux#24176
- Partially fixes termux#183

Previous attempts and progress:

- termux@880983e (2016)
- termux#7625 (2021)
- termux#14435 (2023)

This PR mainly implements the package in a termux-packages downstream-oriented way (heavy use of internal termux-packages repository code shared with other termux-packages).

There is discussion regarding the upstream-oriented way of implementation from the SBCL side (trying to non-cross-compile while avoiding use of any internal termux-packages repository code) here:
https://bugs.launchpad.net/sbcl/+bug/1956852
@robertkirkman robertkirkman marked this pull request as ready for review April 18, 2025 17:39
@robertkirkman
Copy link
Member Author

I will merge this in 24 hours if no other problems are found with it.

@metayan
Copy link

metayan commented Apr 25, 2025

Thank you for doing this.
At a quick glance it seems a bit complicated, though.

I had a solution a couple of years ago that I haven't kept up-to-date:
master...metayan:termux-packages:sbcl2
At some point it started failing because of changes in SBCL if I recall correctly.

It built SBCL with ECL the first time and then with SBCL if SBCL was already installed.

The first tries are here:
master...metayan:termux-packages:sbcl

Sorry that I don't have the possibility to look into this in detail right now, but I noticed proot and lots of changes in your solution that I didn't need to do. Maybe those changes are needed to solve the changes in SBCL that caused my solution to fail.

Please only see this as a possible source for ideas - your effort is greatly appreciated.

@robertkirkman
Copy link
Member Author

Thank you for the comments metayan!

I did consider your version, and it was helpful as a comparison reference to get started, along with others' versions.

At a quick glance it seems a bit complicated, though. I noticed proot and lots of changes in your solution that I didn't need to do.

Yes, I noticed while reading the PR for your version that the last comment in it by finagolfin before it was closed was:

This won't actually be used by almost anyone unless it's cross-compiled. You don't need Docker, any linux x86_64 distro will do to try building it with our packaging scripts.

The proot dependency, and a large number of the other changes that are unique to my version, do that, the implementation of cross-compilability, which is what causes my version to pass the CI workflows in the termux-packages repository without having the same failures here that others' versions had.

It's true that this adds a lot of code to the package that is somewhat convoluted, and adds a significant amount of overhead to the build time of the ARM target because of the internal use of qemu-user for some (but not all) binaries by the termux-proot-run command when ARM is targeted, but this avoids the package having to be confined to the tur-on-device folder of the TUR repo, which would have required all potential users to run pkg install tur-repo before they could get pkg install sbcl. Since this way is technically a true cross-compilation, as far as things currently stand, that allows it to avoid TUR and be as accessible as possible.

@robertkirkman robertkirkman merged commit c6aaca0 into termux:master Apr 26, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants