dream2nix
dream2nix copied to clipboard
Evaluation always downloads unit test sources
Bisect says this occurs since 7d824c1da743160fb30f5cde198990901959475b
Whenever a package is evaluated using a pure translator (yarn-lock in my case), unit test sources (prettier, cardano-js-sdk, the Composer test, ...) are unnecessarily downloaded with it, but seemingly nothing is done with them. This probably shouldn't happen.
Does the branch fix/dont-eval-unit-tests fix this for you?
Nope, still happens. In case you want to test it yourself instead of waiting for my reply each time, here's the quick and dirty bisect script I made.
#!/usr/bin/env -S nix shell --inputs-from . nixpkgs#bash nixpkgs#findutils nixpkgs#gnused nixpkgs#ripgrep -c bash
# bogus hashes
rg -l 1j154slk8f29y4b85bbvxs05nacxcy04702ygag1hpvw1wccjq0y | xargs sed -i 's/1j154slk8f29y4b85bbvxs05nacxcy04702ygag1hpvw1wccjq0y/1j154slk8f29y4b85bbvxs05asdxcy04702ygag1hpvw1wccjq0y/g'
rg -l 1xa5paafhwv4bcn2jsmbp1v2afh729r2h153g871zxdmsxsgwrn1 | xargs sed -i 's/1xa5paafhwv4bcn2jsmbp1v2afh729r2h153g871zxdmsxsgwrn1/1xa5paafhwv4bcn2jjmbp1v2afh729r2h153g871zxdmsxsgwrn1/g'
# bogus urls
rg -l https://github.com/input-output-hk/cardano-js-sdk | xargs sed -i 's,https://github.com/input-output-hk/cardano-js-sdk,https://github.com/input-output-hk/cardano-thisshouldnoteval-sdk,g'
rg -l https://github.com/tinybeachthor/dream2nix-php-composer-lock/archive/refs/tags/complex.tar.gz | xargs sed -i 's,https://github.com/tinybeachthor/dream2nix-php-composer-lock/archive/refs/tags/complex.tar.gz,https://github.com/tinybeachthor/dream2nix-php-composer-lock/archive/refs/tags/noeval.tar.gz,g'
git add .
if nix eval github:privatevoid-net/privatevoid-infrastructure#excalidraw.drvPath --override-input dream2nix . --refresh; then
#git reset --hard
exit 0
else
#git reset --hard
exit 1
fi
--override-input dream2nix . --refresh
nix --help
...
· --refresh
Consider all previously downloaded files out-of-date.
...
This is still a problem. I don't think the OP is specifically confused by why they're getting re-downloaded on every single evaluation since that is what --refresh does. I think they're saying that they shouldn't need to be downloaded at all. I frequently have to wait for 45MB of cardano-js-sdk to download while building my system configuration since it depends on this project transitively via: helix -> nix-cargo-integration -> this. There must be some way to avoid users of this flake having to download stuff for its tests, right?
A normal build should not evaluate any unit testing code whatsoever. There's something wrong with the way the module system is being used.
I can't reproduce this issue on latest main. @mtoohey31 for helix, can you try https://github.com/helix-editor/helix/pull/4537 this PR and see if it has the issue or not?
Sorry about the delayed response. I think that fixed things? At Helix commit e5319ea8c52d6c97ce901426c2714a26f535be0b, cardano-js-sdk gets downloaded, but now that the PR has been merged, when I build from commit 3881fef39d01c94a09b8f5da67decc2c3ccb3660, it doesn't get downloaded. Thank you!