foundry: Forge crashes with message `No target contract named :`.

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (6c0fce3 2023-07-14T02:45:24.569798838Z)

What command(s) is the bug in?

forge test

Operating System

Linux

Describe the bug

Hello, my name is Guilherme. I am one of the core contributors of cartesi/rollups. Our test workflow started failing since earlier today (10 a.m. BRT), because forge test is crashing. I managed to replicate the error locally, and this is the error message. The back trace is not very helpful, so I omitted it.

The application panicked (crashed).
Message:  No target contract named ../node_modules/@cartesi/util/contracts/CartesiMathV2.sol:CartesiMathV2
Location: utils/src/lib.rs:269

I easily managed to pinpoint the line that raised the error: here. Also, it seems that this section of code was last updated by this PR: here.

You can replicate the error yourself by following these steps:

  1. Start the latest Ubuntu machine
  2. Install jq, yarn and docker
  3. Clone https://github.com/cartesi/rollups.git
  4. Initialize the submodules (git submodule update --init --recursive)
  5. Go to onchain/rollups
  6. Run yarn (installs contract dependencies)
  7. Run ./test/foundry/dapp/helper/update-proofs.sh --setup
  8. Run forge test

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 16 (7 by maintainers)

Most upvoted comments

No worries @tommyrharper , we’ll take it from here πŸ™

@Evalir I found the responsible commit: 6fbf0177a06fd6b0a17e1aef91be5e86f6ecb511 It’s here: https://github.com/foundry-rs/foundry/commit/6fbf0177a06fd6b0a17e1aef91be5e86f6ecb511

This is exactly the commit which causes it to break.

Let me know if there is anything else I can do to help debug this, and thanks for responding so quickly πŸ™

@Evalir I get the error with the latest version of foundry - I was just trying to narrow down between which commits the issue appeared.

Thanks for the speedy effort, everyone! πŸ‘

@guidanoli

I’m unable to install via yarn, tried several node versions but:

> error hardhat@2.14.0: The engine β€œnode” is incompatible with this module. Expected version β€œ>=14.0.0”. Got β€œ8.16.2”

nvm user error