-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Labels
A-environment-variablesArea: environment variablesArea: environment variablesC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or reviewStatus: Issue or feature is accepted, and has a team member available to help mentor or reviewT-cargoTeam: CargoTeam: Cargo
Description
Problem
The CARGO_BIN_NAME environment variable is useful when building command-line programs (see #8251). It lets the command know its binary name for printing out simple usage instructions.
Currently CARGO_BIN_NAME is only set when building a [[bin]]
target, though. In my projects a lot of the examples are wrappers around functions of a library crate to allow testing with custom data, similar to small command-line programs. In those example binaries CARGO_BIN_NAME is not available during compilation.
Proposed Solution
It would be useful to also set the CARGO_BIN_NAME environment variable for (binary) examples.
Notes
No response
schneiderfelipe and alshdavid
Metadata
Metadata
Assignees
Labels
A-environment-variablesArea: environment variablesArea: environment variablesC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or reviewStatus: Issue or feature is accepted, and has a team member available to help mentor or reviewT-cargoTeam: CargoTeam: Cargo