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

remappings.txt src/ entry causes problems #40

Closed
aathan opened this issue Mar 20, 2023 · 2 comments · Fixed by #41
Closed

remappings.txt src/ entry causes problems #40

aathan opened this issue Mar 20, 2023 · 2 comments · Fixed by #41
Assignees

Comments

@aathan
Copy link

aathan commented Mar 20, 2023

I'm not sure why the src/=src/ entry in remappings.txt is necessary. However, it currently causes problems when prb-contracts is used a lib/ component in a foundry project, because any imports in the main project tend to resolve to relative-from-base-of-project paths that start with src/ and for whatever reason, foundry's invocation of solc must incorporate the remappings.txt of prb-contracts in such a way that this ends up now attempting to import from prb-contracts. I've reported this to the foundry project, and the "right" solution may end up being that they need to translate the remappings.txt of dependencies before using those to build the solc remappings; or, perhaps this problematic entry can be removed from your project? Removing it manually after the git submodule fetch seems to work ok FYI.

@PaulRBerg
Copy link
Owner

PaulRBerg commented Mar 21, 2023

This is a known bug in Foundry: foundry-rs/foundry#3440

It's not that it's necessary (forge build and forge test work without it), but that adding it makes VSCode's Go to Definition work. So it's unfortunate that projects like PRBContracts cannot use the src/=src/ remapping because of this bug.

Anyway, I agree that it makes sense to remove src/=src/ from this repo's remappings for now.

@PaulRBerg
Copy link
Owner

PaulRBerg commented Mar 21, 2023

Fixed via #41, and v5.0.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants