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

also show if a store path is local or if it needs to be substituted #304

Closed Mic92 closed 6 months ago

Mic92 commented 6 months ago

We deprecate isCached in favor of cacheStatus.

Mic92 commented 6 months ago

@mergify queue

mergify[bot] commented 6 months ago

queue

✅ The pull request has been merged automatically

The pull request has been merged automatically at *8a3c5d2d15e6934437ae1a3d58ba0e80e451bc8e*
anmonteiro commented 5 months ago

@Mic92 is it possible something's wrong with this new implementation? I'm getting cacheStatus: "local" for every package (example CI run) and I'm pretty sure those packages are not cached at all.

Mic92 commented 5 months ago

Can you reproduce this behavior locally? It works for my uses of nix-eval-jobs i.e. in buildbot-nix and this is more or less just what nix-build --dry-build returns. Something that I used also in other tools like: https://github.com/Mic92/nix-build-uncached

anmonteiro commented 5 months ago

will try soon -- I tried on aarch64-darwin and got bit by https://github.com/nix-community/nix-eval-jobs/issues/301

Mic92 commented 5 months ago

Yeah, hopefully I can fix this soon. I got a macbook for testing now and one person that fixed this in Lix was offering me help.

anmonteiro commented 5 months ago

Maybe you can help me out, this is the line that seems to cause it:

https://github.com/nix-ocaml/nix-ci-build/blob/9a9478893762b2c3a859a3facad43ea52953f750/flake.nix#L31-L34

If I use system nix, I get isCached: false. if I use this $PATH prefix, I get isCached: true for things that are definitely not cached.

I reproduced it that project's shell by adding/removing this:

shellHook = ''
  export PATH=${path}:$PATH
'';
Mic92 commented 5 months ago

Odd that nix-eval-jobs links against nix libraries directly and doesn't use any nix from it's PATH.

anmonteiro commented 5 months ago

I just realized that, too. I'm not sure why I added that $PATH to postInstall since it's assumed nix will be in the system. I'll try removing it.

anmonteiro commented 5 months ago

I guess this is where I got it from: https://github.com/Mic92/nix-fast-build/blob/cfff239d93716e92f6467f8953d8f8c12da1892a/default.nix#L3

but that doesn't seem to be available anymore

anmonteiro commented 5 months ago

honestly this is reproducible for me with:

$ nix run -L github:nix-community/nix-eval-jobs#nix-eval-jobs --  \
    --gc-roots-dir /tmp/tmppixgt7wv --force-recurse --workers 2 \
    --flake /path/to/my#derivation --check-cache-status

if I use the rev before this PR, no longer reproducible:

$ nix run -L github:nix-community/nix-eval-jobs?rev=63154bdfb22091041b307d17863bdc0e01a32a00#nix-eval-jobs --  \
    --gc-roots-dir /tmp/tmppixgt7wv --force-recurse --workers 2 \
    --flake /path/to/my#derivation --check-cache-status