Skip to content

run-make: extract bootstrap cargo invocations to a proper Command #128734

@jieyouxu

Description

@jieyouxu
Member

Current bootstrap cargo incantations are nothing short of magic and are indecipherable. We should try to refactor them to proper Command wrappers.

let bootstrap_cargo = env_var("BOOTSTRAP_CARGO");
let mut cmd = cmd(bootstrap_cargo);
cmd.args(&[
    "build",
    "--manifest-path",
    manifest_path.to_str().unwrap(),
    "-Zbuild-std=core",
    "--target",
    &target,
])
.env("PATH", path)
.env("RUSTC", rustc)
...

Activity

added
C-cleanupCategory: PRs that clean code up or issues documenting cleanup.
A-testsuiteArea: The testsuite used to check the correctness of rustc
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
A-run-makeArea: port run-make Makefiles to rmake.rs
on Aug 6, 2024
added
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on Aug 6, 2024
removed
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on Aug 6, 2024
lolbinarycat

lolbinarycat commented on Aug 22, 2024

@lolbinarycat
Contributor

@rustbot claim

lolbinarycat

lolbinarycat commented on Aug 22, 2024

@lolbinarycat
Contributor

any idea why these are explicitly inheriting environment variables? it's not like they call env_clear or anything...

jieyouxu

jieyouxu commented on Sep 29, 2024

@jieyouxu
MemberAuthor

Sorry I didn't notice this issue, it's because at the time when I wrote run-make infra I just copied whatever the previous Makefile implementation did: it simply passed the already-available bootstrap cargo to run-make tests.

As discovered during a beta backport we found out that run-make -Z build-std tests fail on compiler_builtins on older branches #130634 because we added some new Cargo.lock setup that the bootstrap cargo did not know how to handle, but which is present in a cargo that is built from sources by a stage1 rustc.

This particular issue is fixed by a combination of #130642 and #130739 where we properly ensuring a suitably-staged cargo in bootstrap is available, and passing a path to that cargo in compiletest (see #130739 for details). We removed any BOOTSTRAP_CARGO in the test suite, run-make-support and compiletest.

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

Metadata

Metadata

Assignees

Labels

A-run-makeArea: port run-make Makefiles to rmake.rsA-testsuiteArea: The testsuite used to check the correctness of rustcC-cleanupCategory: PRs that clean code up or issues documenting cleanup.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @lolbinarycat@jieyouxu@rustbot

      Issue actions

        run-make: extract bootstrap cargo invocations to a proper `Command` · Issue #128734 · rust-lang/rust