From 76c9fb3cea537bd14a426464c3090e9c0cffbe40 Mon Sep 17 00:00:00 2001 From: Jer Miller Date: Sat, 1 Aug 2026 14:03:57 -0600 Subject: [PATCH] fix the 1.0.1 transport retry rail --- Cargo.lock | 4 +- Cargo.toml | 4 +- .../src/candidate_tests.rs | 91 +++++++++++++++++++ crates/rust-release-manifest/src/tests.rs | 9 +- 4 files changed, 98 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e8c4516..fa978c7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2721,7 +2721,7 @@ dependencies = [ [[package]] name = "spl-core" version = "0.1.0" -source = "git+https://github.com/solpbc/spl-rust?rev=e86c6d0fa0518fcde1fdc1d0e6b9c1ba090a9dbe#e86c6d0fa0518fcde1fdc1d0e6b9c1ba090a9dbe" +source = "git+https://github.com/solpbc/spl-rust?rev=755876568fb3bdd165abdee37c45c22f905247cc#755876568fb3bdd165abdee37c45c22f905247cc" dependencies = [ "base64", "hkdf", @@ -2734,7 +2734,7 @@ dependencies = [ [[package]] name = "spl-transport" version = "0.1.0" -source = "git+https://github.com/solpbc/spl-rust?rev=e86c6d0fa0518fcde1fdc1d0e6b9c1ba090a9dbe#e86c6d0fa0518fcde1fdc1d0e6b9c1ba090a9dbe" +source = "git+https://github.com/solpbc/spl-rust?rev=755876568fb3bdd165abdee37c45c22f905247cc#755876568fb3bdd165abdee37c45c22f905247cc" dependencies = [ "base64", "futures-util", diff --git a/Cargo.toml b/Cargo.toml index e8d2a0e..de0166a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,8 +23,8 @@ unimplemented = "deny" [workspace.dependencies] clap = { version = "4.5", features = ["derive"] } -spl-core = { version = "0.1.0", git = "https://github.com/solpbc/spl-rust", rev = "e86c6d0fa0518fcde1fdc1d0e6b9c1ba090a9dbe" } -spl-transport = { version = "0.1.0", git = "https://github.com/solpbc/spl-rust", rev = "e86c6d0fa0518fcde1fdc1d0e6b9c1ba090a9dbe" } +spl-core = { version = "0.1.0", git = "https://github.com/solpbc/spl-rust", rev = "755876568fb3bdd165abdee37c45c22f905247cc" } +spl-transport = { version = "0.1.0", git = "https://github.com/solpbc/spl-rust", rev = "755876568fb3bdd165abdee37c45c22f905247cc" } tokio = { version = "1", features = ["macros", "rt-multi-thread", "signal", "time"] } tracing = "0.1" tracing-subscriber = "0.3" diff --git a/crates/rust-release-manifest/src/candidate_tests.rs b/crates/rust-release-manifest/src/candidate_tests.rs index bd034a3..6aceb2d 100644 --- a/crates/rust-release-manifest/src/candidate_tests.rs +++ b/crates/rust-release-manifest/src/candidate_tests.rs @@ -10,6 +10,91 @@ use std::sync::OnceLock; static ARCHIVE: OnceLock> = OnceLock::new(); +fn normalize_fixture_workspace_version(path: &Path) { + let manifest = fs::read_to_string(path).unwrap(); + let mut section = ""; + let mut replaced = false; + let mut normalized = String::new(); + for line in manifest.lines() { + if line.starts_with('[') { + section = line; + } + let line = if section == "[workspace.package]" && line.starts_with("version = ") { + replaced = true; + "version = \"1.0.0\"" + } else { + line + }; + normalized.push_str(line); + normalized.push('\n'); + } + assert!(replaced, "fixture workspace version authority"); + fs::write(path, normalized).unwrap(); +} + +fn normalize_fixture_lock_versions(path: &Path) { + let lock = fs::read_to_string(path).unwrap(); + let mut package = ""; + let mut replaced = 0; + let mut normalized = String::new(); + for line in lock.lines() { + if let Some(name) = line + .strip_prefix("name = \"") + .and_then(|value| value.strip_suffix('"')) + { + package = name; + } + let line = if line.starts_with("version = ") + && matches!(package, "rust-release-manifest" | "solstone-linux") + { + replaced += 1; + "version = \"1.0.0\"" + } else { + line + }; + normalized.push_str(line); + normalized.push('\n'); + } + assert_eq!(replaced, 2, "fixture workspace lock authorities"); + fs::write(path, normalized).unwrap(); +} + +fn normalize_fixture_release_policy(path: &Path) { + let policy = fs::read_to_string(path).unwrap(); + let mut section = ""; + let mut replaced = 0; + let mut normalized = String::new(); + for line in policy.lines() { + if line.starts_with('[') { + section = line; + } + let line = if line.starts_with("install_command = ") { + let normalized = match section { + "[debian-amd64]" => { + "install_command = [\"dpkg\", \"--install\", \"/input/solstone-linux_1.0.0-1_amd64.deb\"]" + } + "[rpm-x86_64]" => { + "install_command = [\"rpm\", \"--install\", \"/input/solstone-linux-1.0.0-1.x86_64.rpm\"]" + } + "[tar-x86_64]" => { + "install_command = [\"/input/install.sh\", \"--prefix\", \"/proof-root\", \"/input/solstone-linux-1.0.0-linux-x86_64.tar.gz\"]" + } + _ => line, + }; + if normalized != line { + replaced += 1; + } + normalized + } else { + line + }; + normalized.push_str(line); + normalized.push('\n'); + } + assert_eq!(replaced, 3, "fixture release proof path authorities"); + fs::write(path, normalized).unwrap(); +} + fn staged_baseline(staging: &StagingLayout) -> ExecutableIdentity { let member = package_member_evidence( &staging @@ -60,10 +145,13 @@ pub(super) fn fixture() -> TestRepo { Archive::new(Cursor::new(archive)) .unpack(temp.path()) .unwrap(); + normalize_fixture_workspace_version(&temp.path().join("Cargo.toml")); + normalize_fixture_lock_versions(&temp.path().join("Cargo.lock")); let image_policy = Path::new("packaging/release-policy.toml"); if !temp.path().join(image_policy).exists() { fs::copy(source.join(image_policy), temp.path().join(image_policy)).unwrap(); } + normalize_fixture_release_policy(&temp.path().join(image_policy)); for args in [ &["init", "-q"][..], &["config", "user.email", "release-fixture@invalid.example"][..], @@ -115,10 +203,13 @@ pub(super) fn sha256_fixture() -> TestRepo { Archive::new(Cursor::new(archive)) .unpack(temp.path()) .unwrap(); + normalize_fixture_workspace_version(&temp.path().join("Cargo.toml")); + normalize_fixture_lock_versions(&temp.path().join("Cargo.lock")); let image_policy = Path::new("packaging/release-policy.toml"); if !temp.path().join(image_policy).exists() { fs::copy(source.join(image_policy), temp.path().join(image_policy)).unwrap(); } + normalize_fixture_release_policy(&temp.path().join(image_policy)); assert!( Command::new("git") .args(["init", "-q", "--object-format=sha256"]) diff --git a/crates/rust-release-manifest/src/tests.rs b/crates/rust-release-manifest/src/tests.rs index 0193640..72d3b5a 100644 --- a/crates/rust-release-manifest/src/tests.rs +++ b/crates/rust-release-manifest/src/tests.rs @@ -72,15 +72,12 @@ pub(super) fn tools() -> BTreeMap { pub(super) fn evidence() -> Evidence { let repo = crate::candidate_tests::fixture(); let root = repo.root.path(); - let version: toml::Value = - toml::from_str(&fs::read_to_string(root.join("Cargo.toml")).unwrap()).unwrap(); Evidence { schema_version: 1, product: PRODUCT.into(), - version: version["workspace"]["package"]["version"] - .as_str() - .unwrap() - .into(), + // Release-tool fixtures deliberately stay on one synthetic version so + // a product version bump cannot rewrite hundreds of unrelated cases. + version: "1.0.0".into(), source_commit: command(root, &["git", "rev-parse", "HEAD"]).unwrap(), source_dirty: false, cargo_lock_sha256: digest(&fs::read(root.join("Cargo.lock")).unwrap()), -- 2.51.2