Skip to content

Commit

Permalink
Skip prerelease check for vnext
Browse files Browse the repository at this point in the history
  • Loading branch information
sisuresh committed Dec 4, 2023
1 parent 05361c4 commit 80e57ec
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions src/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,6 @@ fn check_lockfile_has_expected_dep_tree(
get_ledger_protocol_version, get_pre_release_version,
};
let soroban_host_proto_version = get_ledger_protocol_version(soroban_host_interface_version);
let soroban_host_pre_release_version = get_pre_release_version(soroban_host_interface_version);

if cfg!(feature = "core-vnext") {
// In a stellar-core "vnext" build, core's protocol is set to 1 more
Expand Down Expand Up @@ -506,21 +505,25 @@ fn check_lockfile_has_expected_dep_tree(
.find(|p| p.name.as_str() == "soroban-env-host" && package_matches_hash(p, package_hash))
.expect("locating host package in Cargo.lock");

if soroban_host_pre_release_version != 0 && pkg.version.pre.is_empty() {
panic!("soroban interface version indicates pre-release {} but package version is {}, with empty prerelease component",
soroban_host_pre_release_version, pkg.version)
}
if !cfg!(feature = "core-vnext") {
let soroban_host_pre_release_version =
get_pre_release_version(soroban_host_interface_version);
if soroban_host_pre_release_version != 0 && pkg.version.pre.is_empty() {
panic!("soroban interface version indicates pre-release {} but package version is {}, with empty prerelease component",
soroban_host_pre_release_version, pkg.version)
}

if pkg.version.major == 0 || !pkg.version.pre.is_empty() {
eprintln!(
"Warning: soroban-env-host-{} is running a pre-release version {}",
curr_or_prev, pkg.version
);
} else if pkg.version.major != stellar_core_proto_version as u64 {
panic!(
"soroban-env-host-{} version {} major version {} does not match expected protocol version {}",
curr_or_prev, pkg.version, pkg.version.major, stellar_core_proto_version
)
if pkg.version.major == 0 || !pkg.version.pre.is_empty() {
eprintln!(
"Warning: soroban-env-host-{} is running a pre-release version {}",
curr_or_prev, pkg.version
);
} else if pkg.version.major != stellar_core_proto_version as u64 {
panic!(
"soroban-env-host-{} version {} major version {} does not match expected protocol version {}",
curr_or_prev, pkg.version, pkg.version.major, stellar_core_proto_version
)
}
}

let tree = lockfile
Expand Down

5 comments on commit 80e57ec

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from graydon
at sisuresh@80e57ec

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging sisuresh/stellar-core/env-20 = 80e57ec into auto

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sisuresh/stellar-core/env-20 = 80e57ec merged ok, testing candidate = 6177299

@latobarita
Copy link
Contributor

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 6177299

Please sign in to comment.