Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let aliases in .cargo/config.toml specify environment variables #12477

Open
not-my-profile opened this issue Aug 11, 2023 · 2 comments
Open

Let aliases in .cargo/config.toml specify environment variables #12477

not-my-profile opened this issue Aug 11, 2023 · 2 comments
Labels
A-aliases Area: command aliases C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

Comments

@not-my-profile
Copy link

Problem

The [alias] table in .cargo/config.toml lets you define command aliases but it doesn't let you specify environment variables for these commands.

Proposed Solution

Support environment variables to be specified as follows:

[alias]
docsrs = {command="doc", env={RUSTDOCFLAGS="--cfg docsrs"}}

Notes

No response

@not-my-profile not-my-profile added C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-triage Status: This issue is waiting on initial triage. labels Aug 11, 2023
@epage
Copy link
Contributor

epage commented Aug 11, 2023

While this solution is much lighter weight, if we went the deno route of a cross-platform shell-like language, like duckscript, this could be specified in the command itself.

@epage epage added the A-aliases Area: command aliases label Aug 11, 2023
@weihanglo weihanglo added S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted. and removed S-triage Status: This issue is waiting on initial triage. labels Aug 11, 2023
@weihanglo
Copy link
Member

The proposed solution might not be easy to set via CARGO_ALIAS_* environment variable, though with -Zadvanced-env (#7406) it should become trivial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-aliases Area: command aliases C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
Projects
None yet
Development

No branches or pull requests

3 participants