Skip to content

Add compiler-builtins to bootstrap #142106

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tgross35
Copy link
Contributor

@tgross35 tgross35 commented Jun 6, 2025

No description provided.

@rustbot
Copy link
Collaborator

rustbot commented Jun 6, 2025

r? @Kobzol

rustbot has assigned @Kobzol.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Jun 6, 2025
@tgross35 tgross35 marked this pull request as draft June 6, 2025 05:09
@tgross35 tgross35 marked this pull request as ready for review June 6, 2025 05:10
@tgross35
Copy link
Contributor Author

tgross35 commented Jun 6, 2025

Bootstrap people, I think I need some help here making this actually work :) ideally these tests should probably run via path (./x t compiler-builtins, ./x t library/compiler-builtins) as well as under ./x library, but I can't quite figure that out.

It would be good for this to run on CI, as well.

@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu-llvm-19-1 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

Copy link
Contributor

@Kobzol Kobzol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few comments. I noticed that compiler-builtins has its own workspace, but at the same time, it doesn't have a Cargo.lock file. I wonder how do we want to deal with that, the dependencies probably should be locked. Either we should add a lockfile to it, or we should somehow make it a part of the root workspace? 🤔

const DEFAULT: bool = true;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.paths(&["library/compiler-builtins", "library/compiler-builtins/compiler-builtins"])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
run.paths(&["library/compiler-builtins", "library/compiler-builtins/compiler-builtins"])
run.path("library/compiler-builtins")

Should be enough, I think.


impl Step for CompilerBuiltins {
type Output = ();
const DEFAULT: bool = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually makes it run on CI :)

pub struct CompilerBuiltins {
compiler: Compiler,
target: TargetSelection,
mode: Mode,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The builtins only make sense for Mode::Std, I think? So we don't need to parametrize this and the step can just hardcode it.

// Most tests are in the builtins-test crate.
let crates = ["compiler-builtins".to_string(), "builtins-test".to_string()];
let cargo = make_cargo(|c| c);
run_cargo_test(cargo, &[], &crates, "compiler-buitlins", target, builder);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
run_cargo_test(cargo, &[], &crates, "compiler-buitlins", target, builder);
run_cargo_test(cargo, &[], &crates, "compiler-builtins", target, builder);

:) Also below.

let crates = ["compiler-builtins".to_string(), "builtins-test".to_string()];
let cargo = make_cargo(|c| c);
run_cargo_test(cargo, &[], &crates, "compiler-buitlins", target, builder);
let cargo = make_cargo(|c| c.arg("--release"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need another variation for --release? Cargo automatically sets --release based on rust.optimize config value.

target,
Kind::Test,
);
f(&mut c);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
f(&mut c);
c.current_dir(&builder.src.join("library").join("compiler-builtins"));
f(&mut c);

};

// Most tests are in the builtins-test crate.
let crates = ["compiler-builtins".to_string(), "builtins-test".to_string()];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let crates = ["compiler-builtins".to_string(), "builtins-test".to_string()];
let crates = ["compiler_builtins".to_string(), "builtins-test".to_string()];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants