Skip to content

Add option to pass environment variables #653

@GuillaumeGomez

Description

@GuillaumeGomez
Member

Proposal

Add a new --env VAR=VALUE option which injects environment variables into the program, allowing them to be read by the env! and option_env! macros and from proc_macro_tracked_env.

An initial implementation (not merged) was done in rust-lang/rust#94387.

Mentors or Reviewers

@bjorn3 and @jyn514 were the ones who reviewed the original PR so at least tagging them here as potential mentors/reviewers.

Process

The main points of the Major Change Process are as follows:

  • File an issue describing the proposal.
  • A compiler team member or contributor who is knowledgeable in the area can second by writing @rustbot second.
    • Finding a "second" suffices for internal changes. If however, you are proposing a new public-facing feature, such as a -C flag, then full team check-off is required.
    • Compiler team members can initiate a check-off via @rfcbot fcp merge on either the MCP or the PR.
  • Once an MCP is seconded, the Final Comment Period begins. If no objections are raised after 10 days, the MCP is considered approved.

You can read more about Major Change Proposals on forge.

Comments

This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.

Activity

added
major-changeA proposal to make a major change to rustc
T-compilerAdd this label so rfcbot knows to poll the compiler team
on Jul 13, 2023
rustbot

rustbot commented on Jul 13, 2023

@rustbot
Collaborator

This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.

cc @rust-lang/compiler @rust-lang/compiler-contributors

oli-obk

oli-obk commented on Jul 13, 2023

@oli-obk
Contributor

@rustbot second

added
final-comment-periodThe FCP has started, most (if not all) team members are in agreement
on Jul 13, 2023
jyn514

jyn514 commented on Jul 13, 2023

@jyn514
Member

I want to raise a concern that this doesn't support proc-macros in practice.

dtolnay

dtolnay commented on Jul 21, 2023

@dtolnay
Member
jsgf

jsgf commented on Jul 23, 2023

@jsgf

Yeah very in favour of this, but it needs to have a way to also remove all process-environment variables, so that you can entirely specify the logical environment on the command line.

GuillaumeGomez

GuillaumeGomez commented on Jul 24, 2023

@GuillaumeGomez
MemberAuthor

Your RFC seems more complete. Any idea why it was not approved yet?

jsgf

jsgf commented on Jul 26, 2023

@jsgf

Any idea why it was [not?] approved yet?

It just needs to be driven. There are no objections, but I don't think it's got much attention. I'm happy to take it up again, esp if we have multiple independent use-cases for the functionality.

jsgf

jsgf commented on Jul 28, 2023

@jsgf
apiraino

apiraino commented on Oct 2, 2023

@apiraino
Contributor

@rustbot label -final-comment-period +major-change-accepted

19 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-compilerAdd this label so rfcbot knows to poll the compiler teammajor-changeA proposal to make a major change to rustcmajor-change-acceptedA major change proposal that was accepted

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @jsgf@oli-obk@the8472@xclaesse@dtolnay

        Issue actions

          Add option to pass environment variables · Issue #653 · rust-lang/compiler-team