Skip to content

System-wide read-only cargo config #11267

Open
@figsoda

Description

Problem

It would be nice to have the ability to have system-wide read-only config.toml, perhaps with a dedicated environment variable like CARGO_CONFIG. If I set CARGO_HOME to a read-only directory, cargo operations that try to write to the cache would fail and I also don't want to have my cargo cache read-only. It is possible by symlinking everything else in a read-only CARGO_HOME to something not read-only, but the directory is not stable yet, and it could break my config and would be a maintenance burden on my end.

Proposed Solution

Having an environment variable like CARGO_CONFIG or accepting system-wide defaults from e.g. $XDG_CONFIG_DIRS or /etc

Notes

No response

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