From d09db9c0967989234a07a4188f43392271b5ed7e Mon Sep 17 00:00:00 2001 From: Hraban Luyat Date: Mon, 23 Oct 2023 12:30:27 -0400 Subject: [PATCH] sbcl: fix patching of test files & timestamps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- pkgs/development/compilers/sbcl/default.nix | 32 ++++++--------------- 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/pkgs/development/compilers/sbcl/default.nix b/pkgs/development/compilers/sbcl/default.nix index c74f213943ba..3a1533ddf607 100644 --- a/pkgs/development/compilers/sbcl/default.nix +++ b/pkgs/development/compilers/sbcl/default.nix @@ -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