Skip to content

Make CARGO_BIN_EXE_ available with underscores substituted for hyphens #16438

@sunshowers

Description

@sunshowers

Problem

(Cross-posting from #16421 (comment))

Many environments such as shells and debuggers silently drop environment variable keys which have hyphens in them, or otherwise do not work with these kinds of environment variables. So CARGO_BIN_EXE_foo is okay, but CARGO_BIN_EXE_my-program is silently dropped.

(Values are free to have hyphens in them -- it's just keys that are affected.)

These environments include:

Proposed Solution

Make a version of these variables available that replaces hyphens with underscores, e.g. CARGO_BIN_EXE_my_program. (I'm not sure if Cargo only allows one of my_program and my-program to exist.)

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-testS-triageStatus: This issue is waiting on initial triage.

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions