Skip to content

Commit

Permalink
fix: make ci work (#308)
Browse files Browse the repository at this point in the history
  • Loading branch information
nbaztec authored Apr 5, 2024
1 parent 88e233b commit 33c8e6f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion crates/zksync/compiler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ ansi_term = "0.12.1"
globset = "0.4"
eyre = "0.6"
semver = "1"
futures = "0.3"
url = "2"
anyhow = { version = "1.0.70" }
dirs = { version = "5.0.0" }
Expand Down
19 changes: 17 additions & 2 deletions crates/zksync/compiler/src/zksolc/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,23 @@ impl ZkSolcConfigBuilder {
let compiler_path = if let Some(compiler_path) = self.compiler_path {
compiler_path
} else if let Some(compiler_version) = self.compiler_version {
futures::executor::block_on(setup_zksolc_manager(compiler_version))
.map_err(|err| format!("failed setting up zksolc: {err:?}"))?
// TODO: we are forcibly converting this method to sync since it can be called either
// within a sync (tests) or async (binary) context. We should fix that and stick to
// a single context
match tokio::runtime::Handle::try_current() {
Ok(handle) => std::thread::spawn(move || {
handle
.block_on(setup_zksolc_manager(compiler_version))
.map_err(|err| err.to_string())
})
.join()
.map_err(|err| format!("{err:?}"))?,
Err(_) => tokio::runtime::Runtime::new()
.expect("failed starting runtime")
.block_on(setup_zksolc_manager(compiler_version))
.map_err(|err| err.to_string()),
}
.map_err(|err| format!("failed setting up zksolc: {err:?}"))?
} else {
return Err("must specify either the compiler_version or compiler_path".to_string());
};
Expand Down

0 comments on commit 33c8e6f

Please sign in to comment.