0
0
mirror of https://github.com/termux/termux-packages.git synced 2025-10-01 10:31:11 +00:00
Files
termux-packages/packages/sbcl/disable-tests-that-only-fail-in-termux-proot.patch
Robert Kirkman c6aaca0a40 addpkg(main/sbcl): 2.5.3
- Fixes https://github.com/termux/termux-packages/issues/948
- Partially fixes https://github.com/termux/termux-packages/issues/24176
- Partially fixes https://github.com/termux/termux-packages/issues/183

Previous attempts and progress:

- 880983e754 (2016)
- https://github.com/termux/termux-packages/pull/7625 (2021)
- https://github.com/termux/termux-packages/pull/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
2025-04-25 21:28:07 -05:00

106 lines
5.2 KiB
Diff

These two tests only fail in termux-proot-run, not in an actual Termux App,
because of different behavior of the proot environment, and it doesn't
seem easy or straightforward to somehow fix them specifically for termux-proot-run.
Builds of SBCL produced by 'termux-proot-run sh make.sh' still pass these tests when
the build directory is copied to a real Termux App and the test suite is run there.
run-program-test.sh all envrionment variables comparison test:
termux-proot-run for TERMUX_ON_DEVICE_BUILD=false mode currently does something
that seems to make the environment variables scrambled into a different order
when this test tries to print and compare them as two large strings, and also makes the SBCL_PWD
environment variable not match between the two strings.
Example:
The assertion (STRING= STRING EXPECTED) failed with STRING = "LD_LIBRARY_PATH=
LD_PRELOAD=
SBCL_PWD=/home/builder/.termux-build/sbcl/src/tests
SBCL_RUNTIME=/home/builder/.termux-build/sbcl/src/tests/../src/runtime/sbcl
HOME=/data/data/com.termux/files/home
LINKFLAGS=-L/data/data/com.termux/files/usr/lib -Wl,-rpath=/data/data/com.termux/files/usr/lib -Wl,--enable-new-dtags -Wl,--as-needed -Wl,-z,relro,-z,now
EXIT_LISP_WIN=52
TERM=xterm
SOMETHING_IN_THE_ENVIRONMENT=yes there is
ANDROID_DATA=/data
TEST_FILESTEM=run-program-test
PATH=/some/path/that/does/not/exist:/data/data/com.termux/files/usr/bin:/home/builder/.termux-build/_cache/proot-bin-aarch64:/home/builder/.termux-build/_cache/android-r27c-api-24-v1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
EXIT_TEST_WIN=104
CFLAGS= -fstack-protector-strong -Oz
ANDROID_ROOT=/system
SBCL_HOME=/home/builder/.termux-build/sbcl/src/tests/../obj/sbcl-home
SBCL_CORE=/home/builder/.termux-build/sbcl/src/tests/../output/sbcl.core
LANG=C
CPPFLAGS= -isystem/data/data/com.termux/files/usr/include/c++/v1 -isystem/data/data/com.termux/files/usr/include
PREFIX=/data/data/com.termux/files/usr
EXIT_LOSE=1
SBCL_ARGS=--disable-ldb --noinform --no-sysinit --no-userinit --noprint --disable-debugger
script_basename=run-program.test.sh
PWD=/home/builder/.termux-build/sbcl/src/tests
LC_ALL=C
TEST_DIRECTORY=/home/builder/.termux-build/sbcl/src/tests/run-program-test-28269
TZ=UTC
",
EXPECTED = "LD_LIBRARY_PATH=
LD_PRELOAD=
TZ=UTC
TEST_DIRECTORY=/home/builder/.termux-build/sbcl/src/tests/run-program-test-28269
LC_ALL=C
PWD=/home/builder/.termux-build/sbcl/src/tests
script_basename=run-program.test.sh
SBCL_ARGS=--disable-ldb --noinform --no-sysinit --no-userinit --noprint --disable-debugger
EXIT_LOSE=1
PREFIX=/data/data/com.termux/files/usr
CPPFLAGS= -isystem/data/data/com.termux/files/usr/include/c++/v1 -isystem/data/data/com.termux/files/usr/include
LANG=C
SBCL_CORE=/home/builder/.termux-build/sbcl/src/tests/../output/sbcl.core
SBCL_HOME=/home/builder/.termux-build/sbcl/src/tests/../obj/sbcl-home
ANDROID_ROOT=/system
CFLAGS= -fstack-protector-strong -Oz
EXIT_TEST_WIN=104
PATH=/some/path/that/does/not/exist:/data/data/com.termux/files/usr/bin:/home/builder/.termux-build/_cache/proot-bin-aarch64:/home/builder/.termux-build/_cache/android-r27c-api-24-v1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
TEST_FILESTEM=run-program-test
ANDROID_DATA=/data
SOMETHING_IN_THE_ENVIRONMENT=yes there is
TERM=xterm
EXIT_LISP_WIN=52
LINKFLAGS=-L/data/data/com.termux/files/usr/lib -Wl,-rpath=/data/data/com.termux/files/usr/lib -Wl,--enable-new-dtags -Wl,--as-needed -Wl,-z,relro,-z,now
HOME=/data/data/com.termux/files/home
SBCL_RUNTIME=/home/builder/.termux-build/sbcl/src/tests/../src/runtime/sbcl
SBCL_PWD=/home/builder/.termux-build/sbcl/src/tests
".
malloc-failure:
This test essentially behaves similarly to a fork bomb or zip bomb
in some environments, like termux-proot-run.
It is an intentional, aggressive memory leak, sometimes.
It repeatedly calls malloc() in a loop until the system memory is
full, and it registers as a failure on systems that have an OOM killer daemon
running because the OOM killer will kill the lisp process before the test can
complete.
This is noted in the comment by upstream, and it is explained that this test
is expected to fail and have to be disabled in some situations.
https://github.com/sbcl/sbcl/blob/b46a61a4fd23f4e3954771eb9c9914dd26a21048/tests/alien.impure.lisp#L373-L381
--- a/tests/run-program.test.sh
+++ b/tests/run-program.test.sh
@@ -101,7 +101,7 @@ run_sbcl --eval "(defvar *exit-ok* $EXIT_LISP_WIN)" <<'EOF'
;; The default Unix environment for the subprocess is the same as
;; for the parent process. (I.e., we behave like perl and lots of
;; other programs, but not like CMU CL.)
- #+unix
+ #+(and unix (not android))
(let* ((sb-impl::*default-external-format* :latin-1)
(sb-alien::*default-c-string-external-format* :latin-1)
(string (with-output-to-string (stream)
--- a/tests/alien.impure.lisp
+++ b/tests/alien.impure.lisp
@@ -382,7 +382,7 @@
#+64-bit (unless (>= (integer-length array-total-size-limit) 45)
(push :skip-malloc-test *features*))
(with-test (:name :malloc-failure ; for lp#891268
- :skipped-on (or :ubsan :msan :skip-malloc-test))
+ :skipped-on (or :ubsan :msan :skip-malloc-test :android))
(assert (eq :enomem
(handler-case
(loop repeat 128