Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5c9a37f

Browse files
Rollup merge of #144164 - ognevny:opt-dist-stage0-root, r=Kobzol
opt-dist: add an option for setting path to stage0 root in MSYS2 we have problems with stage0 for *-gnullvm hosts because prebuilt dist tarballs will be available starting from 1.90.0-beta. also this change helps to match bootstrap.toml config r? Kobzol try-job: dist-x86_64-msvc try-job: dist-x86_64-linux
2 parents cb3395b + fa92464 commit 5c9a37f

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

‎src/tools/opt-dist/src/environment.rs‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ pub struct Environment {
2828
run_tests: bool,
2929
fast_try_build: bool,
3030
build_llvm: bool,
31+
#[builder(default)]
32+
stage0_root: Option<Utf8PathBuf>,
3133
}
3234

3335
impl Environment {
@@ -56,17 +58,11 @@ impl Environment {
5658
}
5759

5860
pub fn cargo_stage_0(&self) -> Utf8PathBuf {
59-
self.build_artifacts()
60-
.join("stage0")
61-
.join("bin")
62-
.join(format!("cargo{}", executable_extension()))
61+
self.stage0().join("bin").join(format!("cargo{}", executable_extension()))
6362
}
6463

6564
pub fn rustc_stage_0(&self) -> Utf8PathBuf {
66-
self.build_artifacts()
67-
.join("stage0")
68-
.join("bin")
69-
.join(format!("rustc{}", executable_extension()))
65+
self.stage0().join("bin").join(format!("rustc{}", executable_extension()))
7066
}
7167

7268
pub fn rustc_stage_2(&self) -> Utf8PathBuf {
@@ -116,6 +112,10 @@ impl Environment {
116112
pub fn build_llvm(&self) -> bool {
117113
self.build_llvm
118114
}
115+
116+
pub fn stage0(&self) -> Utf8PathBuf {
117+
self.stage0_root.clone().unwrap_or_else(|| self.build_artifacts().join("stage0"))
118+
}
119119
}
120120

121121
/// What is the extension of binary executables on this platform?

‎src/tools/opt-dist/src/main.rs‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ enum EnvironmentCmd {
107107
/// in bootstrap.toml via `build.build-dir` option
108108
#[arg(long, default_value = "build")]
109109
build_dir: Utf8PathBuf,
110+
111+
/// Path to custom stage0 root
112+
#[arg(long)]
113+
stage0_root: Option<Utf8PathBuf>,
110114
},
111115
/// Perform an optimized build on Linux CI, from inside Docker.
112116
LinuxCi {
@@ -144,6 +148,7 @@ fn create_environment(args: Args) -> anyhow::Result<(Environment, Vec<String>)>
144148
run_tests,
145149
build_llvm,
146150
build_dir,
151+
stage0_root,
147152
} => {
148153
let env = EnvironmentBuilder::default()
149154
.host_tuple(target_triple)
@@ -160,6 +165,7 @@ fn create_environment(args: Args) -> anyhow::Result<(Environment, Vec<String>)>
160165
.run_tests(run_tests)
161166
.fast_try_build(is_fast_try_build)
162167
.build_llvm(build_llvm)
168+
.stage0_root(stage0_root)
163169
.build()?;
164170

165171
(env, shared.build_args)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /