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

feat: Add CARGO_RUSTC_CURRENT_DIR (unstable) #12996

Merged
merged 3 commits into from
Nov 24, 2023
Merged

Commits on Nov 17, 2023

  1. refactor(compile): Always add base args first

    This will make it less likely that anything that depends on them will
    get moved before them and makes it easier to consistently add logic that
    depends on them.
    epage committed Nov 17, 2023
    Configuration menu
    Copy the full SHA
    b3d0eeb View commit details
    Browse the repository at this point in the history
  2. test(compiler): Make inner test names more specific

    This will make it easier to verify other env variables later
    epage committed Nov 17, 2023
    Configuration menu
    Copy the full SHA
    c75c456 View commit details
    Browse the repository at this point in the history
  3. feat: Add CARGO_RUSTC_CURRENT_DIR

    This is an alternative to rust-lang#12158's `CARGO_WORKSPACE_DIR` that was
    implementing the solution to rust-lang#3946 that previously discussed in the
    cargo team meeting.
    
    `CARGO_WORKSPACE_DIR` is a bit awkward to document / describe because
    its the effective workspace directory of the thing being built.
    If the thing being built doesn't have a workspace, it falls back to
    `CARGO_MANIFEST_DIR`.
    
    It would also be hard to take into account what the
    `CARGO_WORKSPACE_DIR` would be for path dependencies into foreign
    workspaces *and* it wouldn't solve the problem the user is having.
    
    What the user really wants is the CWD of rustc when it is invoked.
    This is much simpler to describe and is accurate when using a path
    dependency to a foreign package.
    
    Because the CWD is a much simpler mechanism to talk about, I figured we
    could diverge from our prior consensus and make it always present,
    rather than limiting it to tests.
    
    Remaining work for rust-lang#3946: get this stabilized
    yerke authored and epage committed Nov 17, 2023
    Configuration menu
    Copy the full SHA
    e81d84c View commit details
    Browse the repository at this point in the history