Describe the buglorri fails in some cases if the shell derivation uses disallowedReferences or disallowedRequisites. This can be useful as a safety guard to avoid e.g. situations where your shell depends on building too much stuff (happened to me at work!).
To Reproduce
Steps to reproduce the behavior:
{ pkgs ? (import <nixpkgs> {}) }:
pkgs.mkShell {
buildInputs = [ pkgs.hello ];
disallowedReferences = [ pkgs.hello ];
# so you can nix-build this file and check that it's okay
nobuildPhase = ''touch $out'';
}
Observe:
nix-build shell.nix is fine
lorri will fail with logs: [LogLine("these derivations will be built:"), LogLine(" /nix/store/w23dsh466vh9clalnd0mc8hsgxli5gj8-lorri-keep-env-hack-nix-shell.drv"), LogLine("building \'/nix/store/w23dsh466vh9clalnd0mc8hsgxli5gj8-lorri-keep-env-hack-nix-shell.drv\'..."), LogLine("output \'/nix/store/mggmmwyrpkywaavix36l0il7mcfcvsxg-lorri-keep-env-hack-nix-shell\' is not allowed to refer to the following paths:"), LogLine(" /nix/store/8a6lbpbxbc5lc60ljwhw69sszr25ys5f-hello-2.10"), LogLine("error: build of \'/nix/store/w23dsh466vh9clalnd0mc8hsgxli5gj8-lorri-keep-env-hack-nix-shell.drv\' failed")]
Expected behaviorlorri does not fail if the normal use of the shell.nix does not fail.
This keeps all the drv attributes but messes with the inputs, thus making disallowedReferences and disallowedRequisites do the wrong thing. A simple fix would probably be to just strip those attributes.
Describe the bug
lorri
fails in some cases if the shell derivation usesdisallowedReferences
ordisallowedRequisites
. This can be useful as a safety guard to avoid e.g. situations where your shell depends on building too much stuff (happened to me at work!).To Reproduce Steps to reproduce the behavior:
Observe:
nix-build shell.nix
is finelogs: [LogLine("these derivations will be built:"), LogLine(" /nix/store/w23dsh466vh9clalnd0mc8hsgxli5gj8-lorri-keep-env-hack-nix-shell.drv"), LogLine("building \'/nix/store/w23dsh466vh9clalnd0mc8hsgxli5gj8-lorri-keep-env-hack-nix-shell.drv\'..."), LogLine("output \'/nix/store/mggmmwyrpkywaavix36l0il7mcfcvsxg-lorri-keep-env-hack-nix-shell\' is not allowed to refer to the following paths:"), LogLine(" /nix/store/8a6lbpbxbc5lc60ljwhw69sszr25ys5f-hello-2.10"), LogLine("error: build of \'/nix/store/w23dsh466vh9clalnd0mc8hsgxli5gj8-lorri-keep-env-hack-nix-shell.drv\' failed")]
Expected behavior
lorri
does not fail if the normal use of theshell.nix
does not fail.Additional context I'm pretty sure the problem is here: https://github.com/target/lorri/blob/008646abcbae05b1e7d6577857555c596b426769/src/logged-evaluation.nix#L39
This keeps all the drv attributes but messes with the inputs, thus making
disallowedReferences
anddisallowedRequisites
do the wrong thing. A simple fix would probably be to just strip those attributes.