Rollup merge of #108866 - Kohei316:master, r=ozkanonur
Force to use the stage 2 compiler when config.download_rustc is set Fixes #108768
This commit is contained in:
commit
b0ec35362f
@ -910,14 +910,16 @@ impl<'a> Builder<'a> {
|
|||||||
/// new artifacts, it can't be used to rely on the presence of a particular
|
/// new artifacts, it can't be used to rely on the presence of a particular
|
||||||
/// sysroot.
|
/// sysroot.
|
||||||
///
|
///
|
||||||
/// See `force_use_stage1` for documentation on what each argument is.
|
/// See `force_use_stage1` and `force_use_stage2` for documentation on what each argument is.
|
||||||
pub fn compiler_for(
|
pub fn compiler_for(
|
||||||
&self,
|
&self,
|
||||||
stage: u32,
|
stage: u32,
|
||||||
host: TargetSelection,
|
host: TargetSelection,
|
||||||
target: TargetSelection,
|
target: TargetSelection,
|
||||||
) -> Compiler {
|
) -> Compiler {
|
||||||
if self.build.force_use_stage1(Compiler { stage, host }, target) {
|
if self.build.force_use_stage2() {
|
||||||
|
self.compiler(2, self.config.build)
|
||||||
|
} else if self.build.force_use_stage1(Compiler { stage, host }, target) {
|
||||||
self.compiler(1, self.config.build)
|
self.compiler(1, self.config.build)
|
||||||
} else {
|
} else {
|
||||||
self.compiler(stage, host)
|
self.compiler(stage, host)
|
||||||
|
@ -1209,6 +1209,15 @@ impl Build {
|
|||||||
&& (self.hosts.iter().any(|h| *h == target) || target == self.build)
|
&& (self.hosts.iter().any(|h| *h == target) || target == self.build)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Checks whether the `compiler` compiling for `target` should be forced to
|
||||||
|
/// use a stage2 compiler instead.
|
||||||
|
///
|
||||||
|
/// When we download the pre-compiled version of rustc it should be forced to
|
||||||
|
/// use a stage2 compiler.
|
||||||
|
fn force_use_stage2(&self) -> bool {
|
||||||
|
self.config.download_rustc()
|
||||||
|
}
|
||||||
|
|
||||||
/// Given `num` in the form "a.b.c" return a "release string" which
|
/// Given `num` in the form "a.b.c" return a "release string" which
|
||||||
/// describes the release version number.
|
/// describes the release version number.
|
||||||
///
|
///
|
||||||
|
Loading…
x
Reference in New Issue
Block a user