Skip to content

Commit

Permalink
fix: correctly handle b as pre-release in Vyper version (#213)
Browse files Browse the repository at this point in the history
Closes foundry-rs/foundry#9123

I've done similar workaround for rc before. For semver we need those to
be prepended by a dash.

PEP440 pragmas are still might not be parsed correctly but this is not a
showstopper as we're just ignoring them right now, and user would see a
vyper error in case of mismatch.
  • Loading branch information
klkvr authored Oct 16, 2024
1 parent 5ee13df commit b0df57b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/compilers/src/compilers/vyper/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ impl Vyper {
trace!(?output);
if output.status.success() {
let stdout = String::from_utf8_lossy(&output.stdout);
Ok(Version::from_str(&stdout.trim().replace("rc", "-rc"))?)
Ok(Version::from_str(
&stdout.trim().replace("rc", "-rc").replace("b", "-b").replace("a", "-a"),
)?)
} else {
Err(SolcError::solc_output(&output))
}
Expand Down

0 comments on commit b0df57b

Please sign in to comment.