From 9160d40f804f642fb36e29f718b8a05cf515a67d Mon Sep 17 00:00:00 2001 From: Jade Lovelace Date: Sat, 9 Nov 2024 12:46:21 -0800 Subject: [PATCH] Address feedback from alois31 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove restrict-eval stuff that did nothing - Remove builders stuff that appears unnecessary: /* FIXME: The build hook in conjunction with import-from-derivation is * causing "unexpected EOF" during eval */ settings.builders.setDefault(""); We removed that line and then observed that it works, so idk: ifdtest.nix: let ifd = builtins.derivation { name = "wat2"; builder = "/bin/sh"; args = [ "-c" "echo meow > $out" ]; system = "aarch64-linux"; }; in builtins.readFile ifd ยป NIX_CONFIG="builders = @/etc/nix/machines" build/src/nix-eval-jobs ifdtest.nix warning: unknown setting 'trusted-users' warning: `--gc-roots-dir' not specified building '/nix/store/xxnd5rb49n3anyla5v71lgdk0wmhmijp-wat2.drv' on 'ssh-ng://root@voracle.jade.fyi'... copying 0 paths... building '/nix/store/xxnd5rb49n3anyla5v71lgdk0wmhmijp-wat2.drv'... copying 1 paths... copying path '/nix/store/h2yxq9lb7l0nd9plgqrcgf7nvsg67gl7-wat2' from 'ssh-ng://root@voracle.jade.fyi'... - Changed the impure/flake code to override the pureEval setting, which it was definitely *supposed* to be doing in the first place. --- src/nix-eval-jobs.cc | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/nix-eval-jobs.cc b/src/nix-eval-jobs.cc index 1e58a44..bd7c207 100644 --- a/src/nix-eval-jobs.cc +++ b/src/nix-eval-jobs.cc @@ -348,20 +348,12 @@ int main(int argc, char **argv) { myArgs.parseArgs(argv, argc); - /* FIXME: The build hook in conjunction with import-from-derivation is - * causing "unexpected EOF" during eval */ - settings.builders.setDefault(""); - - /* Prevent access to paths outside of the Nix search path and - to the environment. */ - evalSettings.restrictEval.setDefault(false); - /* When building a flake, use pure evaluation (no access to 'getEnv', 'currentSystem' etc. */ if (myArgs.impure) { - evalSettings.pureEval.setDefault(false); + evalSettings.pureEval.override(false); } else if (myArgs.flake) { - evalSettings.pureEval.setDefault(true); + evalSettings.pureEval.override(true); } if (myArgs.releaseExpr == "")