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
I have two directories with a contract with the same name
src/A/C.sol
src/B/C.sol
Example scenario: developing a /v2/ rewrite of a /v1/ solution.
forge build --force
out/A/C.sol/C.json
out/B/C.sol/C.json
modify A/C.sol → forge build
out/C.sol/C.json ← corresponds to A
modify B/C.sol → forge build
out/C.sol/C.json ← now corresponds to B
Incremental builds should either rely on the cached artifact layout, or the artifacts should all be nested inside some fully-expanded hashed layout, like out/${hash(absolute path)}/{file}.sol/{name}.json.
solidity-files-cache.json reflects change (2) but becomes bugged after (3) as there are now 2 cached artifacts with the same path but different sources.
IMO, these file locations should be somewhat predictable. The current solution of creating minimal directories when duplicates exist is weird.
The text was updated successfully, but these errors were encountered:
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (d431f74 2024-04-27T00:17:17.280985407Z)
What command(s) is the bug in?
forge build
Operating System
Linux
Describe the bug
I have two directories with a contract with the same name
src/A/C.sol
src/B/C.sol
Example scenario: developing a
/v2/
rewrite of a/v1/
solution.forge build --force
out/A/C.sol/C.json
out/B/C.sol/C.json
A/C.sol
→forge build
out/C.sol/C.json
← corresponds to AB/C.sol
→forge build
out/C.sol/C.json
← now corresponds to BIncremental builds should either rely on the cached artifact layout, or the artifacts should all be nested inside some fully-expanded hashed layout, like
out/${hash(absolute path)}/{file}.sol/{name}.json
.solidity-files-cache.json
reflects change (2) but becomes bugged after (3) as there are now 2 cached artifacts with the same path but different sources.IMO, these file locations should be somewhat predictable. The current solution of creating minimal directories when duplicates exist is weird.
The text was updated successfully, but these errors were encountered: