Skip to content

Commit b0df57b

Browse files
authored
fix: correctly handle b as pre-release in Vyper version (#213)
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.
1 parent 5ee13df commit b0df57b

File tree

1 file changed

+3
-1
lines changed
  • crates/compilers/src/compilers/vyper

1 file changed

+3
-1
lines changed

crates/compilers/src/compilers/vyper/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,9 @@ impl Vyper {
177177
trace!(?output);
178178
if output.status.success() {
179179
let stdout = String::from_utf8_lossy(&output.stdout);
180-
Ok(Version::from_str(&stdout.trim().replace("rc", "-rc"))?)
180+
Ok(Version::from_str(
181+
&stdout.trim().replace("rc", "-rc").replace("b", "-b").replace("a", "-a"),
182+
)?)
181183
} else {
182184
Err(SolcError::solc_output(&output))
183185
}

0 commit comments

Comments
 (0)