- Notifications
You must be signed in to change notification settings - Fork 13.9k
Open
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFC
Description
Adds a new --env-set command line option on rustc. It allows to set environment variables value at compile-time to be used by env! and option_env! macros.
When retrieving and environment variable value, the one specified by --env-set will take precedence. For example if you want have PATH=a in your environment and pass --env-set PATH=env, then you will have:
assert_eq!(env!("PATH"), "env");Steps
- Implement the MCP -> Done in Implement
--envcompiler flag (withouttracked_envsupport) #118368, in Add support for--envontracked_env::var#118830 and in Rename--envoption flag to--env-set#119884 - Stabilization PR - Stabilize
--env-setoption #119926
Unresolved questions
- What is the desired behavior if the same
--envvariable is passed twice?
schneiderfelipe, tgross35 and applemayexist
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFC