Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panics, crashes if using cached output when compiling with 0.8.17 & 0.8.18 #4320

Closed
2 tasks done
snreynolds opened this issue Feb 9, 2023 · 8 comments · Fixed by #4330
Closed
2 tasks done

Panics, crashes if using cached output when compiling with 0.8.17 & 0.8.18 #4320

snreynolds opened this issue Feb 9, 2023 · 8 comments · Fixed by #4330
Labels
Cmd-forge-test Command: forge test T-bug Type: bug

Comments

@snreynolds
Copy link

snreynolds commented Feb 9, 2023

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 (249538f 2023-02-09T00:13:54.988187Z)

What command(s) is the bug in?

forge test, forge build, forge snapshot

Operating System

macOS (Apple Silicon)

Describe the bug

Running forge build --force compiles contracts with 0.8.17 & 0.8.18 with no issues but running forge test or forge snapshot or forge build after that will panic/crash.

Also doing forge clean && forge snapshot gives same error.

The application panicked (crashed).
Message:  No target contract named AddressBuilder.json:AddressBuilder
Location: utils/src/lib.rs:152

This is a bug. Consider reporting it at https://github.com/foundry-rs/foundry

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

Also this is running with the backtrace

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1: __mh_execute_header
at :
2: __mh_execute_header
at :
3: __mh_execute_header
at :
4: __mh_execute_header
at :
5: __mh_execute_header
at :
6: __mh_execute_header
at :
7: __mh_execute_header
at :
8: __mh_execute_header
at :
9: __mh_execute_header
at :
10: __mh_execute_header
at :
11: __mh_execute_header
at :
12: __mh_execute_header
at :
13: __mh_execute_header
at :
14: __mh_execute_header
at :
15: __mh_execute_header
at :
16: __mh_execute_header
at :

@snreynolds snreynolds added the T-bug Type: bug label Feb 9, 2023
@mattsse mattsse added the Cmd-forge-test Command: forge test label Feb 9, 2023
@mattsse
Copy link
Member

mattsse commented Feb 9, 2023

Does this only happen when switching versions?

I see some leftover panics in that code section that should be removed.

Would you happen to have a repro for this?

does the AddressBuilder.json artifact exist?

could you please run with RUST_LOG=forge::link forge ... and share the logs?

@snreynolds
Copy link
Author

Yeah you can pull this branch Uniswap/permit2#183

@snreynolds
Copy link
Author

2023-02-10T15:54:44.218372Z TRACE forge::link: linking contract target="AllowanceTransferTest.json:AllowanceTransferTest"
2023-02-10T15:54:44.218774Z TRACE forge::link: get dependency dependency="AddressBuilder.json:AddressBuilder" file="test/utils/AddressBuilder.sol" key="AddressBuilder"
The application panicked (crashed).
Message:  No target contract named AddressBuilder.json:AddressBuilder
Location: utils/src/lib.rs:152

This is a bug. Consider reporting it at https://github.com/foundry-rs/foundry

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
[1]    52538 abort      RUST_LOG=forge::link forge test

@mattsse
Copy link
Member

mattsse commented Feb 10, 2023

thank you!

checking

@mattsse
Copy link
Member

mattsse commented Feb 10, 2023

this seems to be a multi version bug, need to debug this a bit more.

I was able to solve the problem by making these changes to your PR

mattsse/permit2@d5d18b8

this makes all used pragmas semver compatible with 0.8.18

@mattsse
Copy link
Member

mattsse commented Feb 10, 2023

okay I believe it's related to this

gakonst/ethers-rs#1995

will fix asap

@snreynolds
Copy link
Author

Ah ok and will that fix enable us to do versioning without carets? Purposefully have locked those contracts to the strict version without the caret.

@mattsse
Copy link
Member

mattsse commented Feb 10, 2023

found the bug,
gakonst/ethers-rs#2136 will fix most of it.

only need to apply some changes to the linking step, but will ship the fix once the PR is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cmd-forge-test Command: forge test T-bug Type: bug
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants