Skip to content

Commit 5f372fe

Browse files
committed
bump-stage0: pick highest common toml version, add a workaround
- We pick the higest common `toml` version used in the r-l/r workspace to avoid introducing Yet Another `toml` `0.x` version, which happens to be `0.8.23` as of the time of writing. - We introduce a byte-buffer-to-string workaround for the `toml 0.8.*` series that do not have the `toml 0.9.*` series's `toml::from_slice` API yet. Not efficient, but this is not perf-critical so it's fine.
1 parent 397f933 commit 5f372fe

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-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/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)