Skip to content

cargo install does not ignore unstable table in .cargo/config.toml file #8512

Closed
@phil-opp

Description

@phil-opp

Problem

In #6026, the behavior of cargo install was changed to ignore any.cargo/config.toml configuration in the current working directory. It seems like this behavior does not apply to the new unstable table in that config file.

Steps

  1. Create a .cargo/config.toml file with the following content:
[unstable]
build-std = ["core"]
  1. Try to install a crate from crates.io, e.g. cargo install bootimage.
  2. This results in a -Zbuild-std requires --target error.
  3. Switching to the parent directory fixes the problem because then the .cargo/config file no longer applies.

Possible Solution(s)

The unstable table should behave the same as the other .cargo/config.toml configuration keys and be ignored for cargo install. Only configuration files in the home directory and the --path directory should be considered.

Notes

Output of cargo version:

cargo 1.46.0-nightly (43cf773 2020-07-13)
release: 1.46.0
commit-hash: 43cf773
commit-date: 2020-07-13

Originally reported by @Asoftyn in rust-osdev/bootimage#64.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions