-
Notifications
You must be signed in to change notification settings - Fork 14k
Implement ToolTarget and port RemoteTestServer and WasmComponentLd to it
#143581
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
Changes from 1 commit
e8be2d8
63f7241
1239b99
46851d3
759366b
51d48f0
4fddfd1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -133,7 +133,7 @@ impl Step for ToolBuild { | |
| builder.std(self.build_compiler, target); | ||
| } | ||
| } | ||
| Mode::ToolBootstrap => {} // uses downloaded stage0 compiler libs | ||
| Mode::ToolBootstrap | Mode::ToolTarget => {} // uses downloaded stage0 compiler libs | ||
| _ => panic!("unexpected Mode for tool build"), | ||
| } | ||
|
|
||
|
|
@@ -196,7 +196,7 @@ impl Step for ToolBuild { | |
| Kind::Build, | ||
| self.mode, | ||
| self.tool, | ||
| self.build_compiler.stage, | ||
| self.build_compiler.stage + 1, | ||
| &self.build_compiler.host, | ||
| &self.target, | ||
| ); | ||
|
|
@@ -367,12 +367,14 @@ pub(crate) fn get_tool_rustc_compiler( | |
|
|
||
| /// Returns a compiler that is able to compile a `ToolTarget` tool for the given `target`. | ||
| pub(crate) fn get_tool_target_compiler(builder: &Builder<'_>, target: TargetSelection) -> Compiler { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Question: this isn't quite obvious, because in the cross-compile case, we'll also have to ensure target std as a side-effect, right? I don't have a better name for this just yet, so not a blocker. I can see why we might want to have some kind of "proof of std artifacts getting built". There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, that would indeed be nice, but that's a massive refactoring. I'm continuously thinking about how to approach it. The attachment of a std to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, this was more of a question, and not a blocking change request. |
||
| if builder.host_target == target { | ||
| let compiler = if builder.host_target == target { | ||
| builder.compiler(0, builder.host_target) | ||
| } else { | ||
| // FIXME: should this be builder.top_stage to avoid rebuilds? | ||
| builder.compiler(1, target) | ||
| } | ||
| builder.compiler(1, builder.host_target) | ||
| }; | ||
| builder.std(compiler, target); | ||
| compiler | ||
| } | ||
|
|
||
| /// Links a built tool binary with the given `name` from the build directory to the | ||
|
|
@@ -647,7 +649,7 @@ impl Step for ErrorIndex { | |
|
|
||
| #[derive(Debug, Clone, Hash, PartialEq, Eq)] | ||
| pub struct RemoteTestServer { | ||
| pub compiler: Compiler, | ||
| pub build_compiler: Compiler, | ||
| pub target: TargetSelection, | ||
| } | ||
|
|
||
|
|
@@ -660,17 +662,17 @@ impl Step for RemoteTestServer { | |
|
|
||
| fn make_run(run: RunConfig<'_>) { | ||
| run.builder.ensure(RemoteTestServer { | ||
| compiler: run.builder.compiler(run.builder.top_stage, run.builder.config.host_target), | ||
| build_compiler: get_tool_target_compiler(run.builder, run.target), | ||
| target: run.target, | ||
| }); | ||
| } | ||
|
|
||
| fn run(self, builder: &Builder<'_>) -> ToolBuildResult { | ||
| builder.ensure(ToolBuild { | ||
| build_compiler: self.compiler, | ||
| build_compiler: self.build_compiler, | ||
| target: self.target, | ||
| tool: "remote-test-server", | ||
| mode: Mode::ToolStd, | ||
| mode: Mode::ToolTarget, | ||
| path: "src/tools/remote-test-server", | ||
| source_type: SourceType::InTree, | ||
| extra_features: Vec::new(), | ||
|
|
@@ -679,6 +681,10 @@ impl Step for RemoteTestServer { | |
| artifact_kind: ToolArtifactKind::Binary, | ||
| }) | ||
| } | ||
|
|
||
| fn metadata(&self) -> Option<StepMetadata> { | ||
| Some(StepMetadata::build("remote-test-server", self.target).built_by(self.build_compiler)) | ||
| } | ||
| } | ||
|
|
||
| #[derive(Debug, Clone, Hash, PartialEq, Eq, Ord, PartialOrd)] | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remark: this is because it's a product of the stage 0 rustc that is not the stage 0 library