Skip to content

Support multiple cargo configuration files in .cargo #9306

@jonhoo

Description

@jonhoo

Describe the problem you are trying to solve
I want to check in some subset of my cargo configuration into version control (e.g., aliases useful to all devs), but not others (e.g., parts that hold custom patches, rustflags, or other local build options).

Describe the solution you'd like
I would like to be able to split my configuration file into multiple files, and then only check in some of them.

Notes
Currently, my options are:

  • Check in the entire cargo configuration into version control, and thus impose my local build configuration on other devs.
  • Don't check in the cargo configuration and find an out-of-band mechanism for distributing common project configuration.
  • Nest my project in an extra subdirectory and place the local configuration in a parent directory and the shared configuration in the project directory itself.

None of these are ideal. It'd be nice if cargo supported something like a .cargo/config.toml.d/ directory that could then contain any number of configuration files that are merged.

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-triageStatus: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions