nomoixyz / vulcan

Development framework for Foundry projects
https://nomoixyz.github.io/vulcan/
MIT License
286 stars 18 forks source link

Member "exitCode" not found or not visible after argument-dependent lookup in struct VmSafe.FfiResult memory. #224

Closed marchev closed 11 months ago

marchev commented 11 months ago

I get the following compile-time error when I try to run a very simply test with Vulcan's println:

❯ forge test
[⠆] Compiling...
[⠒] Compiling 35 files with 0.8.21
[⠑] Solc 0.8.21 finished in 195.43ms
Error:
Compiler run failed:
Error (9582): Member "exitCode" not found or not visible after argument-dependent lookup in struct VmSafe.FfiResult memory.
   --> lib/vulcan/src/_modules/Commands.sol:176:31:
    |
176 |             output.exitCode = ffiResult.exitCode;
    |                               ^^^^^^^^^^^^^^^^^^

This is the test I am trying to run:

// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.21;

import { Test, println } from "vulcan/test.sol";

contract VulcanTest is Test {

    function testFoo() public {
        println("Foo!");
    }
}

Forge version:

❯ forge --version
forge 0.2.0 (9fd44a7 2023-10-26T00:23:32.602895000Z)
gnkz commented 11 months ago

Het @marchev ! Thanks for opening an issue. I think the problem here is that you are using an older version of forge-std. There was a breaking change introduced with the release of forge-std@v1.7.0 where exit_code was renamed to exitCode.

More details: https://github.com/nomoixyz/vulcan/pull/214 https://github.com/foundry-rs/forge-std/pull/458

You can solve this by installing a newer version of forge-std, v1.7.1 is the latest at the moment

forge install foundry-rs/forge-std@v1.7.1 should do the trick

Let me know if that works 😄

gnkz commented 11 months ago

Seems like this was already solved. @marchev let me know if you keep having problems. Feel free to reopen this issue or create another one.

Thanks again!