-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
pkgs/build-support/rust: fix warning "build/.cargo/config
is deprecated"
#339281
Conversation
370f917
to
f633cc4
Compare
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.
Thanks; this has been bugging me. I’m not sure if we care about supporting Rust versions prior to 1.38, but I guess people could be using them through the various overlays.
for registry in ${toString (builtins.attrNames extraRegistries)}; do | ||
cat >> $out/.cargo/config <<EOF | ||
cat >> $out/.cargo/config.toml <<EOF | ||
ln -s .cargo/config.toml .cargo/config |
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 may fail if it is run multiple times. Can we do the ln
in only one place instead?
@@ -96,7 +96,8 @@ in stdenv.mkDerivation ({ | |||
|
|||
# Packages with git dependencies generate non-default cargo configs, so | |||
# always install it rather than trying to write a standard default template. | |||
install -D $CARGO_CONFIG $name/.cargo/config; | |||
install -D $CARGO_CONFIG $name/.cargo/config.toml; |
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 ;
is redundant.
@@ -22,19 +22,20 @@ cargoSetupPostUnpackHook() { | |||
mkdir .cargo | |||
fi | |||
|
|||
config="$cargoDepsCopy/.cargo/config"; | |||
config="$cargoDepsCopy/.cargo/config.toml"; |
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 ;
is redundant too.
build/.cargo/confgi
is deprecated"build/.cargo/config
is deprecated"
We need to make sure that this doesn’t invalidate the existing Cargo hashes in‐tree (i.e., that blanking out a hash still produces the same hash after this PR is applied). See #321095. |
This one would break the Cargo hashes, so I think we should close in favour of the earlier one. Thanks for taking a crack at this annoying problem anyway! |
Description of changes
With a recent
cargo
version update the deprecation warning (see below) became more vocal.To verify this works I built the
bk
package, as it is very small and has very little deps.Edit: it creates the symlink to the old
/build/.cargo/confgi
in case some packge enforces an oldcargo
version of1.38
or oldercloses #334857
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-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.