pkgs/build-support/rust: fix warning "build/.cargo/config is deprecated"#339281
pkgs/build-support/rust: fix warning "build/.cargo/config is deprecated"#339281VuiMuich wants to merge 1 commit into
build/.cargo/config is deprecated"#339281Conversation
370f917 to
f633cc4
Compare
emilazy
left a comment
There was a problem hiding this comment.
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.
I think this may fail if it is run multiple times. Can we do the ln in only one place instead?
| # 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; |
| fi | ||
|
|
||
| config="$cargoDepsCopy/.cargo/config"; | ||
| config="$cargoDepsCopy/.cargo/config.toml"; |
There was a problem hiding this comment.
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
cargoversion update the deprecation warning (see below) became more vocal.To verify this works I built the
bkpackage, as it is very small and has very little deps.Edit: it creates the symlink to the old
/build/.cargo/confgiin case some packge enforces an oldcargoversion of1.38or oldercloses #334857
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.