Skip to content

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

Open
@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-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