Skip to content

Cargo should support configuration in non-hidden files. #8244

Closed as not planned
@jrvanwhy

Description

@jrvanwhy

Describe the problem you are trying to solve

Currently, cargo searches for configuration files by looking for a directory named .cargo, which is a hidden directory. This means that a typical ls invocation does not reveal the existence of a config file. This makes it difficult to debug problems caused by cargo config files, particularly for contributors who are new to a project.

Describe the solution you'd like

I would like Cargo to search for a config file in a non-hidden location, such as cargo/config. This way projects that want to use Cargo configs and make that config visible can do so.

Alternative idea in case searching in a new location is considered a breaking change: We could add a field to Cargo.toml pointing to the Cargo config to use when invoked from within a particular crate or workspace.

Notes

The Tock project uses Makefiles to pass flags to rustc and the linker rather than using a cargo config because they do not want to have any configs in hidden files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-configurationArea: cargo config files and env varsC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-needs-team-inputStatus: Needs input from team on whether/how to proceed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions