Skip to content
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

Cargo build/.cargo/config deprecation note #334857

Open
VuiMuich opened this issue Aug 15, 2024 · 0 comments
Open

Cargo build/.cargo/config deprecation note #334857

VuiMuich opened this issue Aug 15, 2024 · 0 comments
Labels
0.kind: bug Something is broken 6.topic: rust

Comments

@VuiMuich
Copy link
Contributor

Describe the bug

Since a recent update of cargo (I suspect it was with 1.80.0 but I didn't research it yet, as I suppose at this point it isn't really relevant) cargo prints a warning when cargoBuildHook is executed.
Here is an example from building the termusic package:

termusic> warning: `/build/.cargo/config` is deprecated in favor of `config.toml`
termusic> note: if you need to support cargo 1.38 or earlier, you can symlink `config` to `config.toml`
termusic> warning: `/build/.cargo/config` is deprecated in favor of `config.toml`
termusic> note: if you need to support cargo 1.38 or earlier, you can symlink `config` to `config.toml`

Steps To Reproduce

Steps to reproduce the behavior:
Build any Rust package based on nixpkgs-unstable (or nixpkgs/master).

Expected behavior

The relevant build support scripts of nixpkgs should be updated to store the cargo config as suggested by the deprecation note.
If necessary, the script should check if an older cargo version then 1.38 is used and in case symlink like suggested as well.

Additional context

Here are the uses of .cargo/config I could find with rg in pkgs/build-support/rust/, but I am not sure if that is sufficient or if there are some hidden place I might have missed with this cursory search:

>>> rg ".cargo/config" ./pkgs/build-support/rust/
./pkgs/build-support/rust/test/import-cargo-lock/basic-sparse/default.nix
12:      ./.cargo/config.toml

./pkgs/build-support/rust/hooks/cargo-setup-hook.sh
25:    config="$cargoDepsCopy/.cargo/config";
33:    cat ${tmp_config} >> .cargo/config
35:    cat >> .cargo/config <<'EOF'

./pkgs/build-support/rust/import-cargo-lock.nix
232:    cat > $out/.cargo/config <<EOF
243:      cat >> $out/.cargo/config <<EOF
259:          cat "$crate/.cargo-config" >> $out/.cargo/config

./pkgs/build-support/rust/fetch-cargo-tarball/default.nix
76:    # Override the `http.cainfo` option usually specified in `.cargo/config`.
99:    install -D $CARGO_CONFIG $name/.cargo/config;

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.10.3, NixOS, 24.11 (Vicuna), 24.11.20240814.c3aa7b8`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.5`
 - channels(root): `"home-manager-23.05.tar.gz, nixos-23.05"`
 - channels(vuimuich): `""`
 - nixpkgs: `/nix/store/4cpakzyvfw1rmm9v5i3387x6jd2h1v86-source`

Generally I would be interested in attempting a fix myself, but I am sure I cannot pick it up before the next four weeks, so if in the meantime someone else wants to fix this, please go ahead.

Add a 👍 reaction to issues you find important.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken 6.topic: rust
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants