Skip to content

Commit 8a0e5cb

Browse files
committed
Auto merge of #54638 - christianpoveda:master, r=kennytm
Add checking for tool distribution in Tier 1 This fixes #54483 r? @kennytm
2 parents 088fc73 + 2765575 commit 8a0e5cb

File tree

9 files changed

+36
-5
lines changed

9 files changed

+36
-5
lines changed

.travis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ matrix:
9494
MACOSX_DEPLOYMENT_TARGET=10.7
9595
NO_LLVM_ASSERTIONS=1
9696
NO_DEBUG_ASSERTIONS=1
97+
DIST_REQUIRE_ALL_TOOLS=1
9798
CI_JOB_NAME=dist-i686-apple
9899
os: osx
99100
osx_image: xcode9.3-moar
@@ -108,6 +109,7 @@ matrix:
108109
MACOSX_DEPLOYMENT_TARGET=10.7
109110
NO_LLVM_ASSERTIONS=1
110111
NO_DEBUG_ASSERTIONS=1
112+
DIST_REQUIRE_ALL_TOOLS=1
111113
CI_JOB_NAME=dist-x86_64-apple
112114
os: osx
113115
osx_image: xcode9.3-moar

appveyor.yml

+4
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ environment:
8585
--enable-full-tools
8686
--enable-profiler
8787
SCRIPT: python x.py dist
88+
DIST_REQUIRE_ALL_TOOLS: 1
8889
DEPLOY: 1
8990
CI_JOB_NAME: dist-x86_64-msvc
9091
- RUST_CONFIGURE_ARGS: >
@@ -93,6 +94,7 @@ environment:
9394
--enable-full-tools
9495
--enable-profiler
9596
SCRIPT: python x.py dist
97+
DIST_REQUIRE_ALL_TOOLS: 1
9698
DEPLOY: 1
9799
CI_JOB_NAME: dist-i686-msvc
98100
- MSYS_BITS: 32
@@ -101,6 +103,7 @@ environment:
101103
MINGW_URL: https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror
102104
MINGW_ARCHIVE: i686-6.3.0-release-posix-dwarf-rt_v5-rev2.7z
103105
MINGW_DIR: mingw32
106+
DIST_REQUIRE_ALL_TOOLS: 1
104107
DEPLOY: 1
105108
CI_JOB_NAME: dist-i686-mingw
106109
- MSYS_BITS: 64
@@ -109,6 +112,7 @@ environment:
109112
MINGW_URL: https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror
110113
MINGW_ARCHIVE: x86_64-6.3.0-release-posix-seh-rt_v5-rev2.7z
111114
MINGW_DIR: mingw64
115+
DIST_REQUIRE_ALL_TOOLS: 1
112116
DEPLOY: 1
113117
CI_JOB_NAME: dist-x86_64-mingw
114118

config.toml.example

+4
Original file line numberDiff line numberDiff line change
@@ -481,3 +481,7 @@
481481
# as the one built on Windows will contain backslashes in paths causing problems
482482
# on linux
483483
#src-tarball = true
484+
#
485+
486+
# Whether to allow failures when building tools
487+
#missing-tools = false

src/bootstrap/config.rs

+4
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ pub struct Config {
134134
pub test_miri: bool,
135135
pub save_toolstates: Option<PathBuf>,
136136
pub print_step_timings: bool,
137+
pub missing_tools: bool,
137138

138139
// Fallback musl-root for all targets
139140
pub musl_root: Option<PathBuf>,
@@ -271,6 +272,7 @@ struct Dist {
271272
gpg_password_file: Option<String>,
272273
upload_addr: Option<String>,
273274
src_tarball: Option<bool>,
275+
missing_tools: Option<bool>,
274276
}
275277

276278
#[derive(Deserialize)]
@@ -375,6 +377,7 @@ impl Config {
375377
config.rust_codegen_backends = vec![INTERNER.intern_str("llvm")];
376378
config.rust_codegen_backends_dir = "codegen-backends".to_owned();
377379
config.deny_warnings = true;
380+
config.missing_tools = false;
378381

379382
// set by bootstrap.py
380383
config.build = INTERNER.intern_str(&env::var("BUILD").expect("'BUILD' to be set"));
@@ -613,6 +616,7 @@ impl Config {
613616
config.dist_gpg_password_file = t.gpg_password_file.clone().map(PathBuf::from);
614617
config.dist_upload_addr = t.upload_addr.clone();
615618
set(&mut config.rust_dist_src, t.src_tarball);
619+
set(&mut config.missing_tools, t.missing_tools);
616620
}
617621

618622
// Now that we've reached the end of our configuration, infer the

src/bootstrap/configure.py

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ def v(*args):
6969
o("emscripten", None, "compile the emscripten backend as well as LLVM")
7070
o("full-tools", None, "enable all tools")
7171
o("lldb", "rust.lldb", "build lldb")
72+
o("missing-tools", "dist.missing-tools", "allow failures when building tools")
7273

7374
# Optimization and debugging options. These may be overridden by the release
7475
# channel, etc.

src/bootstrap/dist.rs

+13-5
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ fn rust_installer(builder: &Builder) -> Command {
6767
builder.tool_cmd(Tool::RustInstaller)
6868
}
6969

70+
fn missing_tool(tool_name: &str, skip: bool) {
71+
if skip {
72+
println!("Unable to build {}, skipping dist", tool_name)
73+
} else {
74+
panic!("Unable to build {}", tool_name)
75+
}
76+
}
77+
7078
#[derive(Debug, PartialOrd, Ord, Copy, Clone, Hash, PartialEq, Eq)]
7179
pub struct Docs {
7280
pub stage: u32,
@@ -1166,7 +1174,7 @@ impl Step for Rls {
11661174
let rls = builder.ensure(tool::Rls {
11671175
compiler: builder.compiler(stage, builder.config.build),
11681176
target, extra_features: Vec::new()
1169-
}).or_else(|| { println!("Unable to build RLS, skipping dist"); None })?;
1177+
}).or_else(|| { missing_tool("RLS", builder.build.config.missing_tools); None })?;
11701178

11711179
builder.install(&rls, &image.join("bin"), 0o755);
11721180
let doc = image.join("share/doc/rls");
@@ -1245,11 +1253,11 @@ impl Step for Clippy {
12451253
let clippy = builder.ensure(tool::Clippy {
12461254
compiler: builder.compiler(stage, builder.config.build),
12471255
target, extra_features: Vec::new()
1248-
}).or_else(|| { println!("Unable to build clippy, skipping dist"); None })?;
1256+
}).or_else(|| { missing_tool("clippy", builder.build.config.missing_tools); None })?;
12491257
let cargoclippy = builder.ensure(tool::CargoClippy {
12501258
compiler: builder.compiler(stage, builder.config.build),
12511259
target, extra_features: Vec::new()
1252-
}).or_else(|| { println!("Unable to build cargo clippy, skipping dist"); None })?;
1260+
}).or_else(|| { missing_tool("cargo clippy", builder.build.config.missing_tools); None })?;
12531261

12541262
builder.install(&clippy, &image.join("bin"), 0o755);
12551263
builder.install(&cargoclippy, &image.join("bin"), 0o755);
@@ -1324,11 +1332,11 @@ impl Step for Rustfmt {
13241332
let rustfmt = builder.ensure(tool::Rustfmt {
13251333
compiler: builder.compiler(stage, builder.config.build),
13261334
target, extra_features: Vec::new()
1327-
}).or_else(|| { println!("Unable to build Rustfmt, skipping dist"); None })?;
1335+
}).or_else(|| { missing_tool("Rustfmt", builder.build.config.missing_tools); None })?;
13281336
let cargofmt = builder.ensure(tool::Cargofmt {
13291337
compiler: builder.compiler(stage, builder.config.build),
13301338
target, extra_features: Vec::new()
1331-
}).or_else(|| { println!("Unable to build Cargofmt, skipping dist"); None })?;
1339+
}).or_else(|| { missing_tool("Cargofmt", builder.build.config.missing_tools); None })?;
13321340

13331341
builder.install(&rustfmt, &image.join("bin"), 0o755);
13341342
builder.install(&cargofmt, &image.join("bin"), 0o755);

src/ci/docker/dist-i686-linux/Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,5 @@ ENV CFLAGS -mstackrealign
110110
# When we build cargo in this container, we don't want it to use the system
111111
# libcurl, instead it should compile its own.
112112
ENV LIBCURL_NO_PKG_CONFIG 1
113+
114+
ENV DIST_REQUIRE_ALL_TOOLS 1

src/ci/docker/dist-x86_64-linux/Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,5 @@ ENV DIST_SRC 1
106106
# When we build cargo in this container, we don't want it to use the system
107107
# libcurl, instead it should compile its own.
108108
ENV LIBCURL_NO_PKG_CONFIG 1
109+
110+
ENV DIST_REQUIRE_ALL_TOOLS 1

src/ci/run.sh

+4
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ else
7676
fi
7777
fi
7878

79+
if [ "$RUST_RELEASE_CHANNEL" = "nightly" ] || [ "$DIST_REQUIRE_ALL_TOOLS" = "" ]; then
80+
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-missing-tools"
81+
fi
82+
7983
# We've had problems in the past of shell scripts leaking fds into the sccache
8084
# server (#48192) which causes Cargo to erroneously think that a build script
8185
# hasn't finished yet. Try to solve that problem by starting a very long-lived

0 commit comments

Comments
 (0)