Skip to content

Commit c4ae4bd

Browse files
authored
Unrolled build for #146263
Rollup merge of #146263 - jieyouxu:check-bump-stage0, r=Kobzol Fix `bump-stage0` build failure, and check-build `bump-stage0` in CI This PR bumps the `toml` dependency of the `bump-stage0` tool to `0.8.23`, which AFAICT is the highest `toml` version that's present in the r-l/r workspace's `Cargo.lock` already (so we don't introduce _another_ `toml 0.x.*` series). I added some byte-buffer-to-string intermediary to workaround `toml 0.8.*` not having the `toml 0.9.*` `toml::from_slice` API. To catch obvious build failures of the `src/tools/bump-stage0` tool early, before we find out it can't even build when we really need it to work. Contexts: - #146250 (comment) - [#t-release > Bump stage0 rustfmt separately ("one-off") @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/241545-t-release/topic/Bump.20stage0.20rustfmt.20separately.20.28.22one-off.22.29/near/537916615) Fixes #146252.
2 parents 0d0f4ea + 312a124 commit c4ae4bd

File tree

6 files changed

+15
-3
lines changed

6 files changed

+15
-3
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ dependencies = [
336336
"curl",
337337
"indexmap",
338338
"serde",
339-
"toml 0.7.8",
339+
"toml 0.8.23",
340340
]
341341

342342
[[package]]

src/bootstrap/src/core/build_steps/check.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,3 +839,9 @@ tool_check_step!(Linkchecker {
839839
mode: |_builder| Mode::ToolBootstrap,
840840
default: false
841841
});
842+
843+
tool_check_step!(BumpStage0 {
844+
path: "src/tools/bump-stage0",
845+
mode: |_builder| Mode::ToolBootstrap,
846+
default: false
847+
});

src/bootstrap/src/core/builder/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,6 +1061,7 @@ impl<'a> Builder<'a> {
10611061
check::FeaturesStatusDump,
10621062
check::CoverageDump,
10631063
check::Linkchecker,
1064+
check::BumpStage0,
10641065
// This has special staging logic, it may run on stage 1 while others run on stage 0.
10651066
// It takes quite some time to build stage 1, so put this at the end.
10661067
//

src/ci/docker/host-x86_64/pr-check-2/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ RUN sh /scripts/sccache.sh
2828

2929
ENV SCRIPT \
3030
python3 ../x.py check && \
31+
python3 ../x.py check src/tools/bump-stage0 && \
3132
python3 ../x.py clippy ci --stage 2 && \
3233
python3 ../x.py test --stage 1 core alloc std test proc_macro && \
3334
python3 ../x.py test --stage 1 src/tools/compiletest && \

src/tools/bump-stage0/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ build_helper = { path = "../../build_helper" }
1111
curl = "0.4.38"
1212
indexmap = { version = "2.0.0", features = ["serde"] }
1313
serde = { version = "1.0.125", features = ["derive"] }
14-
toml = "0.7"
14+
toml = "0.8.23"

src/tools/bump-stage0/src/main.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,11 @@ fn fetch_manifest(
185185
format!("{}/dist/channel-rust-{}.toml", config.dist_server, channel)
186186
};
187187

188-
Ok(toml::from_slice(&http_get(&url)?)?)
188+
// FIXME: on newer `toml` (>= `0.9.*`), use `toml::from_slice`. For now, we use the most recent
189+
// `toml` available in-tree which is `0.8.*`, so we have to do an additional dance here.
190+
let response = http_get(&url)?;
191+
let response = String::from_utf8(response)?;
192+
Ok(toml::from_str(&response)?)
189193
}
190194

191195
fn http_get(url: &str) -> Result<Vec<u8>, Error> {

0 commit comments

Comments
 (0)