diff options
| author | Jieyou Xu <jieyouxu@outlook.com> | 2025-09-06 16:29:26 +0800 |
|---|---|---|
| committer | Jieyou Xu <jieyouxu@outlook.com> | 2025-09-06 16:33:11 +0800 |
| commit | 5f372fe7d18efd9770d0f9b23895a049c28dcc41 (patch) | |
| tree | 863658afc47e2f5faf704bc8b042d85ad9f60159 /src | |
| parent | 397f93362974d298b79e0e0cd43677014aa7b722 (diff) | |
| download | rust-5f372fe7d18efd9770d0f9b23895a049c28dcc41.tar.gz rust-5f372fe7d18efd9770d0f9b23895a049c28dcc41.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/bump-stage0/Cargo.toml | 2 | ||||
| -rw-r--r-- | src/tools/bump-stage0/src/main.rs | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/tools/bump-stage0/Cargo.toml b/src/tools/bump-stage0/Cargo.toml index b7f3625da91..79097f2c189 100644 --- a/src/tools/bump-stage0/Cargo.toml +++ b/src/tools/bump-stage0/Cargo.toml @@ -11,4 +11,4 @@ build_helper = { path = "../../build_helper" } curl = "0.4.38" indexmap = { version = "2.0.0", features = ["serde"] } serde = { version = "1.0.125", features = ["derive"] } -toml = "0.7" +toml = "0.8.23" diff --git a/src/tools/bump-stage0/src/main.rs b/src/tools/bump-stage0/src/main.rs index 680437cce4f..faed748785f 100644 --- a/src/tools/bump-stage0/src/main.rs +++ b/src/tools/bump-stage0/src/main.rs @@ -185,7 +185,11 @@ fn fetch_manifest( format!("{}/dist/channel-rust-{}.toml", config.dist_server, channel) }; - Ok(toml::from_slice(&http_get(&url)?)?) + // FIXME: on newer `toml` (>= `0.9.*`), use `toml::from_slice`. For now, we use the most recent + // `toml` available in-tree which is `0.8.*`, so we have to do an additional dance here. + let response = http_get(&url)?; + let response = String::from_utf8(response)?; + Ok(toml::from_str(&response)?) } fn http_get(url: &str) -> Result<Vec<u8>, Error> { |
