Skip to content

Commit b6df2a7

Browse files
committed
remove the need to update bump-stage0 with new stage0 config fields
1 parent a51fb2b commit b6df2a7

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/tools/bump-stage0/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ anyhow = "1.0.34"
1010
curl = "0.4.38"
1111
indexmap = { version = "1.7.0", features = ["serde"] }
1212
serde = { version = "1.0.125", features = ["derive"] }
13-
serde_json = "1.0.59"
13+
serde_json = { version = "1.0.59", features = ["preserve_order"] }
1414
toml = "0.5.7"

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

+6-3
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,12 @@ struct Stage0 {
198198
#[derive(Debug, serde::Serialize, serde::Deserialize)]
199199
struct Config {
200200
dist_server: String,
201-
artifacts_server: String,
202-
artifacts_with_llvm_assertions_server: String,
203-
git_merge_commit_email: String,
201+
// There are other fields in the configuration, which will be read by src/bootstrap or other
202+
// tools consuming stage0.json. To avoid the need to update bump-stage0 every time a new field
203+
// is added, we collect all the fields in an untyped Value and serialize them back with the
204+
// same order and structure they were deserialized in.
205+
#[serde(flatten)]
206+
other: serde_json::Value,
204207
}
205208

206209
#[derive(Debug, serde::Serialize, serde::Deserialize)]

0 commit comments

Comments
 (0)