You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To share my attempt I created a draft PR - not with the purpose of merging, but describing the steps I took: #874
The issue (at least from the point of my incomplete understanding), is that the problem that the Reproducible source paths best practice example advertises, doesn't occur.
Please see the file snippets here below and below the built derivation path which doesn't contain myproject.
On the other hand, as the example points out, myproject gets included in the store path.
Can you please shed light on why this makes the example non-reproducible, as the built derivation path doesn't contain the myscript path, and nothing else of the derivation output seems to have a link to the store path either?
Below please find some details on what I did - but on reflection, they might not be necessary, as this perhaps is more of a principles question?
myscript
echo "Hello World"
spaths.nix
let pkgs = import <nixpkgs> {}; in
pkgs.stdenv.mkDerivation {
name = "foo";
src = ./.;
installPhase = ''
mkdir -p $out/bin
cp myscript $out/bin/
'';
and the nix-build spaths.nix execution result:
github/slask/myproject took 6s
❯ nix-build spaths.nix
this derivation will be built:
/nix/store/71jb2qyr017y8ai0yci2rlhky2xzrc3m-foo.drv
building '/nix/store/71jb2qyr017y8ai0yci2rlhky2xzrc3m-foo.drv'...
unpacking sources
unpacking source archive /nix/store/fd6bw7bm2jjvdwnjg0kdy3aqk7f8828d-myproject
source root is myproject
patching sources
configuring
no configure script, doing nothing
building
no Makefile or custom buildPhase, doing nothing
installing
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/36ldrk4hlgyddmi6ksy5rv8lxn0b3bfz-foo
checking for references to /build/ in /nix/store/36ldrk4hlgyddmi6ksy5rv8lxn0b3bfz-foo...
patching script interpreter paths in /nix/store/36ldrk4hlgyddmi6ksy5rv8lxn0b3bfz-foo
stripping (with command strip and flags -S -p) in /nix/store/36ldrk4hlgyddmi6ksy5rv8lxn0b3bfz-foo/bin
/nix/store/36ldrk4hlgyddmi6ksy5rv8lxn0b3bfz-foo
Important Line:/nix/store/36ldrk4hlgyddmi6ksy5rv8lxn0b3bfz-foo
As I am thinking this through, I see myproject in the source archive path, but that doesn't matter, as long as it's not part of the produced derivation?
Thank you to anyone who has time to clarify and for shedding any light on this.
The text was updated successfully, but these errors were encountered:
Run nix show-derivation /nix/store/71jb2qyr017y8ai0yci2rlhky2xzrc3m-foo.drv and check inputSrcs - it will contain your myproject. Renaming your directory will force a rebuild and produce a different store path in inputSrcs. The reason is that ./. eventually ends up being string-coerced and therefore copied to the store.
Inspired by @fricklerhandwerk 's comment on #845 I went after:
builtins.derivation
To share my attempt I created a draft PR - not with the purpose of merging, but describing the steps I took:
#874
The issue (at least from the point of my incomplete understanding), is that the problem that the Reproducible source paths best practice example advertises, doesn't occur.
Please see the file snippets here below and below the built derivation path which doesn't contain
myproject
.On the other hand, as the example points out,
myproject
gets included in the store path.Can you please shed light on why this makes the example non-reproducible, as the built derivation path doesn't contain the
myscript
path, and nothing else of the derivation output seems to have a link to the store path either?Below please find some details on what I did - but on reflection, they might not be necessary, as this perhaps is more of a principles question?
myscript
spaths.nix
and the
nix-build spaths.nix
execution result:Important Line:
/nix/store/36ldrk4hlgyddmi6ksy5rv8lxn0b3bfz-foo
As I am thinking this through, I seemyproject
in thesource archive
path, but that doesn't matter, as long as it's not part of the produced derivation?Thank you to anyone who has time to clarify and for shedding any light on this.
The text was updated successfully, but these errors were encountered: