sbcl: fix patching of test files & timestamps

It’s unclear what problem the test patching was trying to solve, but on current
SBCL builds this does more harm than good. Removing those patches leaves the
test in its original state, which builds and passes.

As for the timestamps: also unclear, removing it doesn’t seem to affect anything
either way and this feels very much like a fix for /nix/store read-only
access. I’ve test SBCL without these and it works fine, so I don’t think this is
relevant anymore? Unfortunately there are no comments so it’s hard to know why
these existed.
This commit is contained in:
Hraban Luyat 2023-10-23 12:30:27 -04:00
parent 094f6b98c7
commit d09db9c096

View File

@ -85,27 +85,13 @@ stdenv.mkDerivation rec {
./fix-2.4.0-aarch64-darwin.patch
];
postPatch = ''
echo '"${version}.nixos"' > version.lisp-expr
# SBCL checks whether files are up-to-date in many places..
# Unfortunately, same timestamp is not good enough
sed -e 's@> x y@>= x y@' -i contrib/sb-aclrepl/repl.lisp
#sed -e '/(date)/i((= date 2208988801) 2208988800)' -i contrib/asdf/asdf.lisp
sed -i src/cold/slam.lisp -e \
'/file-write-date input/a)'
sed -i src/cold/slam.lisp -e \
'/file-write-date output/i(or (and (= 2208988801 (file-write-date output)) (= 2208988801 (file-write-date input)))'
sed -i src/code/target-load.lisp -e \
'/date defaulted-fasl/a)'
sed -i src/code/target-load.lisp -e \
'/date defaulted-source/i(or (and (= 2208988801 (file-write-date defaulted-source-truename)) (= 2208988801 (file-write-date defaulted-fasl-truename)))'
# Fix the tests
sed -e '5,$d' -i contrib/sb-bsd-sockets/tests.lisp
sed -e '5,$d' -i contrib/sb-simple-streams/*test*.lisp
''
+ (if purgeNixReferences
postPatch = (lib.optionalString (builtins.elem stdenv.hostPlatform.system [
"x86_64-linux"
"x86_64-darwin"
"aarch64-linux"
]) ''
rm -f tests/foreign-stack-alignment.impure.lisp
'') + (if purgeNixReferences
then
# This is the default location to look for the core; by default in $out/lib/sbcl
''
@ -117,9 +103,7 @@ stdenv.mkDerivation rec {
''
sed -e "s@/bin/uname@$(command -v uname)@g" -i src/code/*-os.lisp \
src/code/run-program.lisp
''
);
'');
preBuild = ''
export INSTALL_ROOT=$out