foundry-rs / foundry

Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.
https://getfoundry.sh
Apache License 2.0
7.89k stars 1.59k forks source link

remappings.txt inheritance problems #4659

Closed zaqk closed 1 week ago

zaqk commented 1 year ago

Component

Forge

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

What version of Foundry are you on?

forge 0.2.0 (1d9a34e 2023-03-07T00:07:40.652148Z)

What command(s) is the bug in?

forge build

Operating System

macOS (Apple Silicon)

Describe the bug

It seems that foundry dependency remappings will affect the parent project that is using the dependencies.

While using prb-proxy which has "src/=src/" in remappings.txt: https://github.com/PaulRBerg/prb-proxy/blob/198fca1b8799f67457abce2bdb82361525af5912/remappings.txt#L5

I am forced to override this remapping in my own remappings.txt otherwise all imports even relative imports that touch the src folder will point to prb-proxy/src.

For example, if i have a file my-project/src/interfaces/X.sol which is inherited via relative import it will point to my-project/lib/prb-proxy/src/interfaces/X.sol instead.

mattsse commented 1 year ago

ref #1855

PaulRBerg commented 1 year ago

While using prb-proxy which has "src/=src/" in remappings.txt:

PRBProxy no longer has that remapping on the main branch, see https://github.com/PaulRBerg/prb-proxy/commit/8a8f86e46a97d7cd1e7a8f93fc68468748bad1ff.

zaqk commented 1 year ago

Thanks @PaulRBerg

zerosnacks commented 1 week ago

Resolved by https://github.com/foundry-rs/foundry/issues/1855 + https://github.com/sablier-labs/v2-core/issues/406