solidity: various small resolc fixes (#189)

This commit is contained in:
xermicus
2025-02-03 16:16:54 +01:00
committed by GitHub
parent bfda465c32
commit 8ed689e7ec
9 changed files with 84 additions and 76 deletions
@@ -80,10 +80,9 @@ impl CombinedJson {
file_path.push(format!("combined.{}", revive_common::EXTENSION_JSON));
if file_path.exists() && !overwrite {
eprintln!(
anyhow::bail!(
"Refusing to overwrite an existing file {file_path:?} (use --overwrite to force)."
);
return Ok(());
}
File::create(&file_path)
+10 -2
View File
@@ -152,8 +152,16 @@ impl Compiler for SolcCompiler {
anyhow::anyhow!("{} subprocess error: {:?}", self.executable, error)
})?;
if !output.status.success() {
println!("{}", String::from_utf8_lossy(output.stdout.as_slice()));
println!("{}", String::from_utf8_lossy(output.stderr.as_slice()));
writeln!(
std::io::stdout(),
"{}",
String::from_utf8_lossy(output.stdout.as_slice())
)?;
writeln!(
std::io::stdout(),
"{}",
String::from_utf8_lossy(output.stderr.as_slice())
)?;
anyhow::bail!(
"{} error: {}",
self.executable,
@@ -68,12 +68,8 @@ impl Input {
paths.insert(PathBuf::from(library_file));
}
#[cfg(feature = "parallel")]
let iter = paths.into_par_iter(); // Parallel iterator
#[cfg(not(feature = "parallel"))]
let iter = paths.iter(); // Sequential iterator
let sources = iter
let sources = paths
.iter()
.map(|path| {
let source = Source::try_from(path.as_path()).unwrap_or_else(|error| {
panic!("Source code file {path:?} reading error: {error}")