fix(solc): respect offline mode (#1002)

This commit is contained in:
Matthias Seitz 2022-03-10 15:40:35 +01:00 committed by GitHub
parent 1446f410ab
commit f55f02476c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 5 deletions

View File

@ -641,11 +641,18 @@ impl VersionedSources {
SolcError::msg(format!("solc \"{}\" should have been installed", version)) SolcError::msg(format!("solc \"{}\" should have been installed", version))
})?; })?;
tracing::trace!("verifying solc checksum for {}", solc.solc.display()); if self.offline {
if solc.verify_checksum().is_err() { tracing::trace!(
tracing::trace!("corrupted solc version, redownloading \"{}\"", version); "skip verifying solc checksum for {} in offline mode",
Solc::blocking_install(version.as_ref())?; solc.solc.display()
tracing::trace!("reinstalled solc: \"{}\"", version); );
} else {
tracing::trace!("verifying solc checksum for {}", solc.solc.display());
if solc.verify_checksum().is_err() {
tracing::trace!("corrupted solc version, redownloading \"{}\"", version);
Solc::blocking_install(version.as_ref())?;
tracing::trace!("reinstalled solc: \"{}\"", version);
}
} }
let solc = solc.arg("--allow-paths").arg(allowed_lib_paths.to_string()); let solc = solc.arg("--allow-paths").arg(allowed_lib_paths.to_string());
let version = solc.version()?; let version = solc.version()?;