diff --git a/Cargo.lock b/Cargo.lock index 422ebd05ae4f..3d431ea31f80 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3092,9 +3092,9 @@ dependencies = [ [[package]] name = "foundry-compilers" -version = "0.3.6" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba64504d49ebda9141869b2ba23db2d685ae4cf17bcddf5e61f0e4bc515ebb25" +checksum = "d1b77c95e79bff02ddaa38426fc6809a3a438dce0e6a2eb212dac97da7c157b4" dependencies = [ "alloy-json-abi", "alloy-primitives", diff --git a/Cargo.toml b/Cargo.toml index 2c650152f186..cddf4bae26a7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -135,7 +135,7 @@ foundry-wallets = { path = "crates/wallets" } # solc & compilation utilities foundry-block-explorers = { version = "0.2.3", default-features = false } -foundry-compilers = { version = "0.3.6", default-features = false } +foundry-compilers = { version = "0.3.9", default-features = false } ## revm # no default features to avoid c-kzg @@ -181,10 +181,7 @@ alloy-rlp = "0.3.3" solang-parser = "=0.3.3" ## misc -chrono = { version = "0.4", default-features = false, features = [ - "clock", - "std", -] } +chrono = { version = "0.4", default-features = false, features = ["clock", "std"] } color-eyre = "0.6" derive_more = "0.99" eyre = "0.6" diff --git a/crates/forge/tests/cli/cmd.rs b/crates/forge/tests/cli/cmd.rs index a187169fae98..e5d7f712d364 100644 --- a/crates/forge/tests/cli/cmd.rs +++ b/crates/forge/tests/cli/cmd.rs @@ -536,31 +536,10 @@ contract Greeter { cmd.arg("build"); let output = cmd.stdout_lossy(); - assert!(output.contains( - " -Compiler run successful with warnings: -Warning (5667): Warning: Unused function parameter. Remove or comment out the variable name to silence this warning. -", - )); + assert!(output.contains("Warning"), "{output}"); }); // Tests that direct import paths are handled correctly -// -// NOTE(onbjerg): Disabled for Windows -- for some reason solc fails with a bogus error message -// here: error[9553]: TypeError: Invalid type for argument in function call. Invalid implicit -// conversion from struct Bar memory to struct Bar memory requested. --> src\Foo.sol:12:22: -// | -// 12 | FooLib.check(b); -// | ^ -// -// -// -// error[9553]: TypeError: Invalid type for argument in function call. Invalid implicit conversion -// from contract Foo to contract Foo requested. --> src\Foo.sol:15:23: -// | -// 15 | FooLib.check2(this); -// | ^^^^ -#[cfg(not(target_os = "windows"))] forgetest!(can_handle_direct_imports_into_src, |prj, cmd| { prj.add_source( "Foo", @@ -1572,8 +1551,12 @@ forgetest_init!(can_install_missing_deps_build, |prj, cmd| { cmd.arg("build"); let output = cmd.stdout_lossy(); - assert!(output.contains("Missing dependencies found. Installing now"), "{}", output); - assert!(output.contains("No files changed, compilation skipped"), "{}", output); + assert!(output.contains("Missing dependencies found. Installing now"), "{output}"); + + // re-run + let output = cmd.stdout_lossy(); + assert!(!output.contains("Missing dependencies found. Installing now"), "{output}"); + assert!(output.contains("No files changed, compilation skipped"), "{output}"); }); // checks that extra output works diff --git a/crates/forge/tests/cli/config.rs b/crates/forge/tests/cli/config.rs index 0c540d65a4fc..0848b8446eee 100644 --- a/crates/forge/tests/cli/config.rs +++ b/crates/forge/tests/cli/config.rs @@ -380,7 +380,7 @@ contract Foo {} // test to ensure yul optimizer can be set as intended forgetest!(can_set_yul_optimizer, |prj, cmd| { prj.add_source( - "Foo", + "foo.sol", r" contract Foo { function bar() public pure { @@ -405,12 +405,7 @@ contract Foo { ..Default::default() }; prj.write_config(config); - - assert!(cmd.stdout_lossy().ends_with( - " -Compiler run successful! -", - )); + cmd.assert_success(); }); // tests that the lib triple can be parsed diff --git a/crates/forge/tests/fixtures/can_set_yul_optimizer.stderr b/crates/forge/tests/fixtures/can_set_yul_optimizer.stderr index c7c847bf96e1..0dd4db95b6eb 100644 --- a/crates/forge/tests/fixtures/can_set_yul_optimizer.stderr +++ b/crates/forge/tests/fixtures/can_set_yul_optimizer.stderr @@ -1,9 +1,8 @@ Error: Compiler run failed: -Error (6553): SyntaxError: The msize instruction cannot be used when the Yul optimizer is activated because it can change its semantics. Either disable the Yul optimizer or do not use the instruction. +Error (6553): The msize instruction cannot be used when the Yul optimizer is activated because it can change its semantics. Either disable the Yul optimizer or do not use the instruction. --> src/Foo.sol:6:8: | 6 | assembly { | ^ (Relevant source part starts here and spans across multiple lines). -