multiple resolc fixes and improvements (#151)

- Error out early on compiler invocations with invalid base path or include path flags.
- Do not error out if no files and no errors were produced. This aligns resolc closer to sloc.
- Add a CLI test with an involved fixture containing multiple contract remappings to properly testing the standard JSON path.
- Fixes input normalization in the Wasm version.



Co-authored-by: Cyrill Leutwiler <cyrill@parity.io>
This commit is contained in:
Siphamandla Mjoli
2025-01-17 11:10:47 +02:00
committed by GitHub
parent b78b2b2af9
commit 06f43083c3
7 changed files with 207 additions and 23 deletions
+9
View File
@@ -9,6 +9,8 @@ pub mod soljson_compiler;
pub mod standard_json;
pub mod version;
use once_cell::sync::Lazy;
use semver::VersionReq;
use std::path::Path;
use std::path::PathBuf;
@@ -29,6 +31,13 @@ pub const FIRST_VIA_IR_VERSION: semver::Version = semver::Version::new(0, 8, 13)
/// The last supported version of `solc`.
pub const LAST_SUPPORTED_VERSION: semver::Version = semver::Version::new(0, 8, 28);
/// `--base-path` was introduced in 0.6.9 <https://github.com/ethereum/solidity/releases/tag/v0.6.9>
pub static FIRST_SUPPORTS_BASE_PATH: Lazy<VersionReq> =
Lazy::new(|| VersionReq::parse(">=0.6.9").unwrap());
/// `--include-path` was introduced in 0.8.8 <https://github.com/ethereum/solidity/releases/tag/v0.8.8>
pub static FIRST_SUPPORTS_INCLUDE_PATH: Lazy<VersionReq> =
Lazy::new(|| VersionReq::parse(">=0.8.8").unwrap());
/// The Solidity compiler.
pub trait Compiler {