Raise warning if path specified in forge build
does not match and fallback is triggered
#9304
Closed
2 tasks done
Labels
Cmd-forge-build
Command: forge build
first issue
A good way to start contributing
T-feature
Type: feature
Milestone
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (4817280 2024-11-12T00:20:42.760650000Z)
What command(s) is the bug in?
forge build
Operating System
macOS (Apple Silicon)
Describe the bug
forge build
with the./path/to/contract:contractName
syntax appears to behave identically tocontractName
syntax, compiling the entire project and searching the output for the desired contract name.e.g.:
forge build ./path/to/contract
compiles 15 filesforge build ./path/to/contract:contractName
compiles 132 filesforge build contractName
also compiles 132 filesPerhaps as a result of the behavior described in the first part of this issue, the
./path/to/contract
appears to be ignored entirely, with compilation succeeding even when./path/to/contract
does not containcontractName
.PoC:
A.sol
C.sol
Results
i.
forge build ./A.sol
compilesB
✅ii.
forge build ./A.sol:B
compiles bothB
andD
❌iii.
forge build B
compiles bothB
andD
✅iv.
forge build ./A.sol:D
succeeds and compiles bothB
andD
❌Expected behavior
ii.
should only compileD
if it is in the same file asA
or somewhere in the inheritance tree (in other words, the same contracts should be compiled as thei.
case)iv.
should fail? Ifii.
is implemented correctly, thenD
wouldn't be anywhere in the compiler outputThe text was updated successfully, but these errors were encountered: