]> git.lizzy.rs Git - rust.git/commitdiff
remove the need to update bump-stage0 with new stage0 config fields
authorPietro Albini <pietro.albini@ferrous-systems.com>
Thu, 30 Jun 2022 07:54:51 +0000 (09:54 +0200)
committerPietro Albini <pietro.albini@ferrous-systems.com>
Mon, 11 Jul 2022 08:13:35 +0000 (10:13 +0200)
src/tools/bump-stage0/Cargo.toml
src/tools/bump-stage0/src/main.rs

index cf8840ff6ee8918c2f05094be17ac6ea9433dfb9..352a855561417c9981f2a5722d55be70a53e3faf 100644 (file)
@@ -10,5 +10,5 @@ anyhow = "1.0.34"
 curl = "0.4.38"
 indexmap = { version = "1.7.0", features = ["serde"] }
 serde = { version = "1.0.125", features = ["derive"] }
-serde_json = "1.0.59"
+serde_json = { version = "1.0.59", features = ["preserve_order"] }
 toml = "0.5.7"
index 1c839fdc00a08c79dde63cc086747214b068632e..aa346daf7e5f3a4b99d45b8440aab47507b095e4 100644 (file)
@@ -198,9 +198,12 @@ struct Stage0 {
 #[derive(Debug, serde::Serialize, serde::Deserialize)]
 struct Config {
     dist_server: String,
-    artifacts_server: String,
-    artifacts_with_llvm_assertions_server: String,
-    git_merge_commit_email: String,
+    // There are other fields in the configuration, which will be read by src/bootstrap or other
+    // tools consuming stage0.json. To avoid the need to update bump-stage0 every time a new field
+    // is added, we collect all the fields in an untyped Value and serialize them back with the
+    // same order and structure they were deserialized in.
+    #[serde(flatten)]
+    other: serde_json::Value,
 }
 
 #[derive(Debug, serde::Serialize, serde::Deserialize)]