nix-community / nix-eval-jobs

Parallel nix evaluator with a streamable json output [maintainers @Mic92, @adisbladis]
GNU General Public License v3.0
157 stars 31 forks source link

NIX_PATH not honored #324

Open zhaofengli opened 2 months ago

zhaofengli commented 2 months ago

On 8802412b8747633e9d80639897e4d58fa6290909, NIX_PATH does not appear to have an effect:

$ NIX_PATH=meow=/dev/null ./build/src/nix-eval-jobs -E 'toString <meow>'
...
              error: file 'meow' was not found in the Nix search path (add it using $NIX_PATH or -I)
Mic92 commented 2 months ago

This is a "feature" that inherited from the original hydra-eval-jobs: https://github.com/nix-community/nix-eval-jobs/blob/8802412b8747633e9d80639897e4d58fa6290909/src/nix-eval-jobs.cc#L348

zhaofengli commented 2 months ago

Oh wow, my grep-foo failed and it worked before. CI relying on <nixpkgs> only started to fail in Colmena since the last bump.

I guess NIX_PATH previously working should be considered unintentional despite the error message?

Mic92 commented 2 months ago

Maybe NIX_PATH was interpreted before that line of code? What should still work is nix-eval-jobs -I nixpkgs= etc? Not sure what the best course of action here is. I would like to use nix-eval-jobs in hydra again at some point.

zhaofengli commented 2 months ago

Yeah, it was interpreted when constructing the global evalSettings. IMO nix-eval-jobs should act as "normal Nix" and accept the variable and let the user (e.g., Hydra) clear it as needed. The user can opt to use flakes/pure-eval/restrict-eval if they care about hermeticity.

Mic92 commented 2 months ago

Feel free to make a pull request removing unsetenv and updating a documentation on how to get hermetic evaluation.