You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.
The last() call evaluates to an empty string causing the version parsing to fail.
I fixed locally by stripping newlines as follows:
fn version_from_output(output: Output) -> Result<Version> {
if output.status.success() {
let version =
output.
stdout.
lines().
**filter(|l| !l.as_ref().unwrap().is_empty()).**
last()
.ok_or_else(|| SolcError::solc("version not found in solc output"))?
.map_err(|err| SolcError::msg(format!("Failed to read output: {err}")))?;
// NOTE: semver doesn't like `+` in g++ in build metadata which is invalid semver
//dbg!(&version);
Ok(Version::from_str(&version.trim_start_matches("Version: ").replace(".g++", ".gcc"))?)
} else {
Err(SolcError::solc(String::from_utf8_lossy(&output.stderr).to_string()))
}
}
The text was updated successfully, but these errors were encountered:
Version
ethers-solc v1.0.2
Platform
Linux ash11 4.15.0-143-generic #147-Ubuntu SMP Wed Apr 14 16:10:11 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Description
Using
solc
installed fromsolc-select
the version cannot be parsed.When parsing the solc version I get the error:
SemverError(Error("unexpected end of input while parsing major version number"))
Running
solc --version
I get:After some debugging of this code:
https://github.com/gakonst/ethers-rs/blob/master/ethers-solc/src/compile/mod.rs#L684-L697
I found that
solc --version
output includes two trailing newlines:The
last()
call evaluates to an empty string causing the version parsing to fail.I fixed locally by stripping newlines as follows:
The text was updated successfully, but these errors were encountered: