Skip to content

Consider the interaction of the [env] table with Cargo's own environment #11589

@ehuss

Description

@ehuss

Currently Cargo does not inspect the [env] config table for its own environment variables. This may have been an oversight and it is not clear exactly how to proceed from here. A few options:

  • Merge the [env] table into Cargo's environment snapshot, and make cargo honor most of the environment variables.
    • There are some environment variables with subtle complexities like CARGO_HOME and PATH.
  • Deny (or issue a warning) if you attempt to set one of Cargo's environment variables in the [env] table.
    • Unfortunately this will be challenging, and a breaking change. There are some users already setting environment variables that start with CARGO_ for their own purpose. Also, those environment variables will apply to recursive cargo invocations.

Related issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-configurationArea: cargo config files and env varsA-environment-variablesArea: environment variablesS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions