-
-
Notifications
You must be signed in to change notification settings - Fork 17.4k
rustPlatform.{fetchCargoVendor,importCargoLock}: support lockfile v4 escaping #371795
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rustPlatform.{fetchCargoVendor,importCargoLock}: support lockfile v4 escaping #371795
Conversation
|
I wonder which package causes this many rebuilds.... |
|
Here's a minimal reproducer: reprowith (import (builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/0402340d487eef0ac6e2e3989d8a9ec962c380ba.tar.gz";
sha256 = "sha256:0h42w0gq4zl4195rvsa67c1zsfky4crhp2n24108cxqw79bg73if";
}) { });
let
src = fetchFromGitHub {
owner = "jsoo1";
repo = "cargo-vendor-reproducer";
rev = "main";
hash = "sha256-7ubp31NkdfUgOv613ZCq+JzwixtoCPXw5oh7w2evxMo=";
};
in
rustPlatform.buildRustPackage {
name = "cargo-vendor-reproducer";
version = "0.1.0";
inherit src;
cargoLock = {
lockFile = "${src}/Cargo.lock";
outputHashes."tap-1.0.1" = "sha256-n+jLAQKNTi1S1kJMjTjyvnrPpC378Ohh+R6UyvxUluU=";
};
}$ nix build -L -f repro.nix
cargo-vendor-reproducer> Running phase: unpackPhase
cargo-vendor-reproducer> unpacking source archive /nix/store/n90z34sxshlifsxr6yi79p7lz9ikkffa-source
cargo-vendor-reproducer> source root is source
cargo-vendor-reproducer> Executing cargoSetupPostUnpackHook
cargo-vendor-reproducer> Finished cargoSetupPostUnpackHook
cargo-vendor-reproducer> Running phase: patchPhase
cargo-vendor-reproducer> Executing cargoSetupPostPatchHook
cargo-vendor-reproducer> Validating consistency between /private/tmp/nix-build-cargo-vendor-reproducer.drv-0/source/Cargo.lock and /private/tmp/nix-build-cargo-vendor-reproducer.drv-0/cargo-vendor-dir/Cargo.lock
cargo-vendor-reproducer> Finished cargoSetupPostPatchHook
cargo-vendor-reproducer> Running phase: updateAutotoolsGnuConfigScriptsPhase
cargo-vendor-reproducer> Running phase: configurePhase
cargo-vendor-reproducer> Running phase: buildPhase
cargo-vendor-reproducer> Executing cargoBuildHook
cargo-vendor-reproducer> cargoBuildHook flags: -j 12 --target aarch64-apple-darwin --offline --profile release
cargo-vendor-reproducer> error: failed to load source for dependency `tap`
cargo-vendor-reproducer> Caused by:
cargo-vendor-reproducer> Unable to update https://github.com/jsoo1/tap.git?branch=jsoo1%2Ftap%2Freproducer%2Fnixpkgs%2Fbug#f5315f0f
cargo-vendor-reproducer> Caused by:
cargo-vendor-reproducer> can't checkout from 'https://github.com/jsoo1/tap.git': you are in the offline mode (--offline)
error: builder for '/nix/store/fw81s68jb82vaa5pfck9vkpdfd6msw21-cargo-vendor-reproducer.drv' failed with exit code 101;
last 10 log lines:
> Running phase: buildPhase
> Executing cargoBuildHook
> cargoBuildHook flags: -j 12 --target aarch64-apple-darwin --offline --profile release
> error: failed to load source for dependency `tap`
>
> Caused by:
> Unable to update https://github.com/jsoo1/tap.git?branch=jsoo1%2Ftap%2Freproducer%2Fnixpkgs%2Fbug#f5315f0f
>
> Caused by:
> can't checkout from 'https://github.com/jsoo1/tap.git': you are in the offline mode (--offline)
For full logs, run 'nix log /nix/store/fw81s68jb82vaa5pfck9vkpdfd6msw21-cargo-vendor-reproducer.drv'.
$ cat $(nix build --print-out-paths --no-link -L -f repro.nix cargoDeps)/tap-1.0.1/.cargo-config
[source."https://github.com/jsoo1/tap.git?branch=jsoo1%2Ftap%2Freproducer%2Fnixpkgs%2Fbug"]
git = "https://github.com/jsoo1/tap.git"
branch = "jsoo1%2Ftap%2Freproducer%2Fnixpkgs%2Fbug"
replace-with = "vendored-sources"And with this PR: with (import (builtins.fetchTarball {
url = "https://github.com/TomaSajt/nixpkgs/archive/50c11e3b2e96c487c2c43f127b9e1b05b6f7c9c3.tar.gz";
sha256 = "sha256:0s1d3p7981iwr5lv7hj4mxma2gh0jakqiinzm74m48ddv816svsf";
}) { });
let
src = fetchFromGitHub {
owner = "jsoo1";
repo = "cargo-vendor-reproducer";
rev = "main";
hash = "sha256-7ubp31NkdfUgOv613ZCq+JzwixtoCPXw5oh7w2evxMo=";
};
in
rustPlatform.buildRustPackage {
name = "cargo-vendor-reproducer";
version = "0.1.0";
inherit src;
cargoLock = {
lockFile = "${src}/Cargo.lock";
outputHashes."tap-1.0.1" = "sha256-n+jLAQKNTi1S1kJMjTjyvnrPpC378Ohh+R6UyvxUluU=";
};
}Building this PR does not fix the bug: $ nix build -L -f repro.nix
cargo-vendor-reproducer> Running phase: unpackPhase
cargo-vendor-reproducer> unpacking source archive /nix/store/n90z34sxshlifsxr6yi79p7lz9ikkffa-source
cargo-vendor-reproducer> source root is source
cargo-vendor-reproducer> Executing cargoSetupPostUnpackHook
cargo-vendor-reproducer> Finished cargoSetupPostUnpackHook
cargo-vendor-reproducer> Running phase: patchPhase
cargo-vendor-reproducer> Executing cargoSetupPostPatchHook
cargo-vendor-reproducer> Validating consistency between /private/tmp/nix-build-cargo-vendor-reproducer.drv-0/source/Cargo.lock and /private/tmp/nix-build-cargo-vendor-reproducer.drv-0/cargo-vendor-dir/Cargo.lock
cargo-vendor-reproducer> Finished cargoSetupPostPatchHook
cargo-vendor-reproducer> Running phase: updateAutotoolsGnuConfigScriptsPhase
cargo-vendor-reproducer> Running phase: configurePhase
cargo-vendor-reproducer> Running phase: buildPhase
cargo-vendor-reproducer> Executing cargoBuildHook
cargo-vendor-reproducer> cargoBuildHook flags: -j 12 --target aarch64-apple-darwin --offline --profile release
cargo-vendor-reproducer> error: failed to load source for dependency `tap`
cargo-vendor-reproducer> Caused by:
cargo-vendor-reproducer> Unable to update https://github.com/jsoo1/tap.git?branch=jsoo1%2Ftap%2Freproducer%2Fnixpkgs%2Fbug#f5315f0f
cargo-vendor-reproducer> Caused by:
cargo-vendor-reproducer> can't checkout from 'https://github.com/jsoo1/tap.git': you are in the offline mode (--offline)
error: builder for '/nix/store/fw81s68jb82vaa5pfck9vkpdfd6msw21-cargo-vendor-reproducer.drv' failed with exit code 101;
last 10 log lines:
> Running phase: buildPhase
> Executing cargoBuildHook
> cargoBuildHook flags: -j 12 --target aarch64-apple-darwin --offline --profile release
> error: failed to load source for dependency `tap`
>
> Caused by:
> Unable to update https://github.com/jsoo1/tap.git?branch=jsoo1%2Ftap%2Freproducer%2Fnixpkgs%2Fbug#f5315f0f
>
> Caused by:
> can't checkout from 'https://github.com/jsoo1/tap.git': you are in the offline mode (--offline)
For full logs, run 'nix log /nix/store/fw81s68jb82vaa5pfck9vkpdfd6msw21-cargo-vendor-reproducer.drv'.
$ cat $(nix build --no-link --print-out-paths -L -f repro.nix cargoDeps)/tap-1.0.1/.cargo-config
[source."https://github.com/jsoo1/tap.git?branch=jsoo1%2Ftap%2Freproducer%2Fnixpkgs%2Fbug"]
git = "https://github.com/jsoo1/tap.git"
branch = "jsoo1%2Ftap%2Freproducer%2Fnixpkgs%2Fbug"
replace-with = "vendored-sources"
|
jsoo1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this might be helping something but is not a fix for the original bug (yet).
|
@jsoo1 |
eee5432 to
9bc5a80
Compare
9bc5a80 to
cd18394
Compare
baloo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested last commit to fix #371692.
Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also verified with the reproducer from above. The following builds:
with (import (builtins.fetchTarball {
url = "https://github.com/TomaSajt/nixpkgs/archive/cd183949171cd4eaed4cd19e38bd52b74c36ecbd.tar.gz";
sha256 = "sha256:0a5csv2ln3bcd84x9afml2hihwa86cs5qfrmimfbcz02wqxlin35";
}) { });
let
src = fetchFromGitHub {
owner = "jsoo1";
repo = "cargo-vendor-reproducer";
rev = "main";
hash = "sha256-7ubp31NkdfUgOv613ZCq+JzwixtoCPXw5oh7w2evxMo=";
};
in
rustPlatform.buildRustPackage {
name = "cargo-vendor-reproducer";
version = "0.1.0";
inherit src;
cargoLock = {
lockFile = "${src}/Cargo.lock";
outputHashes."tap-1.0.1" = "sha256-n+jLAQKNTi1S1kJMjTjyvnrPpC378Ohh+R6UyvxUluU=";
};
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6119 rebuild now, welp need staging/staging-next.
cd18394 to
67a8220
Compare
67a8220 to
0bfdb03
Compare
|
Built a few packages, looks good to me so let's merge. |
|
Successfully created backport PR for |
|
Did this fix anything urgent or unbreak failing builds on (~6k rebuilds at this stage in the cycle is probably small enough that this isn’t a big problem, to be clear; I just want to check you’re aware of the general procedures here to ward off any future mass‐rebuild problems.) |
|
I know staging-next branch is used for fixing Hydra builds. While this fix isn't "so urgent" persay, as more and more packages adopt lockFile version 4, this could have become an issue when updating packages. So I wanted to get this within current staging-next cycle. Checked the diff, most Rust packages are here just leafs, so I thought we shouldn't worry so much. |
|
We’ve had a lot of occurrences in the past where a problematic number of rebuilds was merged into I think no harm done in this case but I’m letting you know so that you can coordinate on Matrix for next time. Evaluations of |
|
Will keep that in mind, thanks. |
Closes #371692
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.