mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-12 23:21:01 +00:00
solidity: various small resolc fixes (#189)
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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}")
|
||||
|
||||
Reference in New Issue
Block a user