Ludovic Courtès writes: > Hi! > > Christopher Baines skribis: > >> When running without datefudge, the tests work and the cd in gtests.sh >> seems to fail: >> >> Running tests for gtests >> TIMESTAMP gtests BEGIN: Mon Jul 22 10:09:27 UTC 2024 >> ./gtests.sh: line 25: cd: ./nss/tests: No such file or directory >> /tmp/guix-build-nss-3.99.drv-0/nss-3.99/nss/tests/gtests >> >> But when running with datefudge, the cd seems to work, but the tests >> fail: >> >> Running tests for gtests >> TIMESTAMP gtests BEGIN: Tue Jan 23 00:00:01 UTC 2024 >> /tmp/guix-build-nss-3.99.drv-0/nss-3.99/nss/tests > > I added ‘set -x’ in ‘gtests.sh’. With ‘datefudge’, it goes like this: > > --8<---------------cut here---------------start------------->8--- > log-Running tests for gtests > log-TIMESTAMP gtests BEGIN: Tue Jan 23 00:00:00 CET 2024 > log-++ echo FOOOOO > log-FOOOOO > log-+++ dirname /tmp/guix-build-nss-3.99.drv-0/nss-3.99/nss/tests/all.sh > log-++ cd /tmp/guix-build-nss-3.99.drv-0/nss-3.99/nss/tests > log-++ pwd > log-/tmp/guix-build-nss-3.99.drv-0/nss-3.99/nss/tests > log:++ SOURCE_DIR=/tmp/guix-build-nss-3.99.drv-0/nss-3.99/nss/tests/../.. > log-++ set +x > log-gtests: base_gtest certhigh_gtest certdb_gtest der_gtest pk11_gtest util_gtest freebl_gtest softoken_gtest sysinit_gtest smime_gtest mozpkix_gtest > log-gtests.sh: base_gtest =============================== > log-/tmp/guix-build-nss-3.99.drv-0/nss-3.99/dist/Linux6.9_x86_gcc_glibc_PTH_DBG.OBJ/bin/certutil -N -d /tmp/guix-build-nss-3.99.drv-0/nss-3.99/tests_results/security/guix-hpc5.7/gtests/base_gtest --empty-password > log-/tmp/guix-build-nss-3.99.drv-0/nss-3.99/dist/Linux6.9_x86_gcc_glibc_PTH_DBG.OBJ/bin/certutil -S -z ../tests_noise -d /tmp/guix-build-nss-3.99.drv-0/nss-3.99/tests_results/security/guix-hpc5.7/gtests/base_gtest -n dummy -s CN=dummy -t ,, -x -m 1 -w -2 -v 120 -k ec -q nistp256 -Z SHA256 -1 -2 > log- > log- > log-Generating key. This may take a few moments... > --8<---------------cut here---------------end--------------->8--- > > *Without* ‘datefudge’: > > --8<---------------cut here---------------start------------->8--- > log.good-TIMESTAMP gtests BEGIN: Tue Jul 23 12:37:50 CEST 2024 > log.good-++ echo FOOOOO > log.good-FOOOOO > log.good-+++ dirname ./nss/tests/all.sh > log.good-++ cd ./nss/tests > log.good-./gtests.sh: line 27: cd: ./nss/tests: No such file or directory > log.good-++ pwd > log.good-/tmp/guix-build-nss-3.99.drv-0/nss-3.99/nss/tests/gtests > log.good:++ SOURCE_DIR=/tmp/guix-build-nss-3.99.drv-0/nss-3.99/nss/tests/gtests/../.. > log.good-++ set +x > log.good-gtests: base_gtest certhigh_gtest certdb_gtest der_gtest pk11_gtest util_gtest freebl_gtest softoken_gtest sysinit_gtest smime_gtest mozpkix_gtest > log.good-gtests.sh: base_gtest =============================== > log.good-/tmp/guix-build-nss-3.99.drv-0/nss-3.99/dist/Linux6.9_x86_gcc_glibc_PTH_DBG.OBJ/bin/certutil -N -d /tmp/guix-build-nss-3.99.drv-0/nss-3.99/tests_results/security/guix-hpc5.6/gtests/base_gtest --empty-password > log.good-/tmp/guix-build-nss-3.99.drv-0/nss-3.99/dist/Linux6.9_x86_gcc_glibc_PTH_DBG.OBJ/bin/certutil -S -z ../tests_noise -d /tmp/guix-build-nss-3.99.drv-0/nss-3.99/tests_results/security/guix-hpc5.6/gtests/base_gtest -n dummy -s CN=dummy -t ,, -x -m 1 -w -2 -v 120 -k ec -q nistp256 -Z SHA256 -1 -2 > log.good- > log.good- > log.good-Generating key. This may take a few moments... > --8<---------------cut here---------------end--------------->8--- > > In the latter case, the scripts gets a relative file name, which makes > it fail to cd, which then makes it succeed by chance. > > This script looks extremely fragile. > > My suggestion would be to: > > (substitute* "nss/tests/gtests/gtests.sh" > (("SOURCE_DIR=.*") > (string-append "SOURCE_DIR=" (getcwd) "/nss\n"))) > > WDYT? That looks good to me. In a related note, I was going to push the original patch yesterday, but I got stuck rebasing core-updates. There's some substantial rust changes on the branch which clash with master.