Hi, On Wed, 01 Nov 2023 at 17:52, Suhail <suh...@bayesians.ca> wrote:
> If not, why should skipping the tests result in a different derivation > tree? The store path is different because it hashes all the inputs, included the builder script; from my understanding. For instance, consider the package ’hello’. The derivation with and without tests are: --8<---------------cut here---------------start------------->8--- $ guix build hello -d --no-grafts /gnu/store/cvdzgd9glngrb98jqfa6bpm6nj6j3q55-hello-2.12.1.drv $ guix build hello -d --without-tests=hello --no-grafts /gnu/store/my14b3qwzqjawzadvcc30p2z5iv53amx-hello-2.12.1.drv --8<---------------cut here---------------end--------------->8--- Now, let compare them, --8<---------------cut here---------------start------------->8--- $ cat $(guix build hello -d --no-grafts) \ | sed 's/,/\n/g' | grep '/gnu/'| sort > /tmp/with $ cat $(guix build hello -d --no-grafts --without-tests=hello) \ | sed 's/,/\n/g' | grep '/gnu/' | sort > /tmp/without $ diff /tmp/with /tmp/without 4a5,6 > "/gnu/store/3hsisq3553z3gcy0yf270qy7ds9rzmis-hello-2.12.1" > "/gnu/store/3hsisq3553z3gcy0yf270qy7ds9rzmis-hello-2.12.1")]) 6,7d7 < "/gnu/store/5mqwac3zshjjn1ig82s12rbi7whqm4n8-hello-2.12.1" < "/gnu/store/5mqwac3zshjjn1ig82s12rbi7whqm4n8-hello-2.12.1")]) 21a22,23 > "/gnu/store/jd6566z3xyyzfnyvsyi95ybk39xhbybr-hello-2.12.1-builder"] > "/gnu/store/jd6566z3xyyzfnyvsyi95ybk39xhbybr-hello-2.12.1-builder"] 25,26d26 < "/gnu/store/pspxyd64587jq55jhbz3z92j4lnqm857-hello-2.12.1-builder"] < "/gnu/store/pspxyd64587jq55jhbz3z92j4lnqm857-hello-2.12.1-builder"] --8<---------------cut here---------------end--------------->8--- Well, basically the difference is from the builder: it is the Guile script that builds. One contains ’#:tests? #t’ and the other contains ’#:tests? #f’. --8<---------------cut here---------------start------------->8--- $ cat /gnu/store/jd6566z3xyyzfnyvsyi95ybk39xhbybr-hello-2.12.1-builder \ | sed 's/ /\n/g' > /tmp/without-builder $ cat /gnu/store/pspxyd64587jq55jhbz3z92j4lnqm857-hello-2.12.1-builder | sed 's/ /\n/g' > /tmp/with-builder $ diff /tmp/with-builder /tmp/without-builder 148c148 < #t --- > #f --8<---------------cut here---------------end--------------->8--- Well, from my understanding, get the same the store path for the same package built with or without its tests would mean a deep change of the build systems. Somehow, it would mean to have a derivation for building and another derivation – referring to the former – for testing. Well, taking this direction, one could imagine a derivation for each phases; somehow extend to all phases what it is already done for fetching source, build and grafts (guix build --source && guix build --no-grafts && guix build). That would be a piece of work. :-) Cheers, simon