You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have you ensured that all of these are up to date?
Foundry
Foundryup
What version of Foundry are you on?
No response
What command(s) is the bug in?
forge build
Operating System
macOS (Apple Silicon)
Describe the bug
I use src/contracts to store all my smart contracts, this means my foundry.toml contains the line src = "src/contracts"
I like to use contracts/ as an import alias, such that I don't need to use relative imports everywhere, this means I have a remapping.txt with the line: contracts/=src/contracts/
This causes foundry build to crash. When I switch the line: src = "src/contracts" => src = "src" in foundry.toml the compilation works
hey @DrakeEvans thanks for your report! Indeed, this was changed in PR #9258 in order to solve #3440 (that is to avoid any src remapping in deps to be applied for the root project). As you mentioned, changing src = "src/contracts" to src = "src" would be the proper fix (as contracts/=src/contracts/ remapping will be properly resolved), lmk if this doesn't make sense.
The issue with that fix is that it is now compiling a bunch of extra contracts potentially. I want to limit compiling to just whats in src/contracts. Im not clear on the value of what you are describing
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
No response
What command(s) is the bug in?
forge build
Operating System
macOS (Apple Silicon)
Describe the bug
I use
src/contracts
to store all my smart contracts, this means myfoundry.toml
contains the linesrc = "src/contracts"
I like to use
contracts/
as an import alias, such that I don't need to use relative imports everywhere, this means I have aremapping.txt
with the line:contracts/=src/contracts/
This causes foundry build to crash. When I switch the line:
src = "src/contracts"
=>src = "src"
infoundry.toml
the compilation worksreproduction repo: https://github.com/DrakeEvans/foundry-remapping-bug
Recreate: run
forge build -w
Fix: comment out line 3 and uncomment line 2
Fwiw, this is definitely a regression as I have been using this configuration 6 months ago fine
The text was updated successfully, but these errors were encountered: