Solidity: add --libraries to sources (#187)

* bugfix: add libraries to sources

Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
xermicus
2025-01-31 18:08:11 +01:00
committed by GitHub
parent 8201401fef
commit ab90af49df
2 changed files with 8 additions and 3 deletions
+1
View File
@@ -10,6 +10,7 @@ This is a development pre-release.
### Changed
### Fixed
- Solidity: Add the solc `--libraries` files to sources.
## v0.1.0-dev.9
@@ -64,11 +64,17 @@ impl Input {
via_ir: bool,
suppressed_warnings: Option<Vec<Warning>>,
) -> anyhow::Result<Self> {
let mut paths: BTreeSet<PathBuf> = paths.iter().cloned().collect();
let libraries = Settings::parse_libraries(library_map)?;
for library_file in libraries.keys() {
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
.map(|path| {
let source = Source::try_from(path.as_path()).unwrap_or_else(|error| {
@@ -78,8 +84,6 @@ impl Input {
})
.collect();
let libraries = Settings::parse_libraries(library_map)?;
Ok(Self {
language,
sources,