-
Notifications
You must be signed in to change notification settings - Fork 36
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
Fix inconsistent trailing slash in remappings #49
Conversation
gm @Troublor are you still working on this? |
@BlazeWasHere Yeah you remind me. I will finish it this weekend. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry forgot about this,
could you please open a foundry pr that patches the foundry-compilers crate to this branch to check if this causes any issues
ah im not approved for github workflow actions, but locally it doesnt seem to build not sure its because of my system (new pc -- have never used rust on this before) or rust crate incompatibility edit: it seems like this branch is just missing latest commits from main |
The test cases of foundry-rs/compilers (in the CI) seem to indicate there are some problems with Windows. I don't have a Windows machine. Could someone offer some help to look into the issues? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, pending @mattsse
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm,
really sorry about the delay
hmm this results in a bunch of failing tests can't proceed with this until sorted out |
i havent updated my fork yet, can you retrigger ci again now edit: https://github.com/foundry-rs/foundry/actions/runs/8672405018/job/23783250651?pr=7623#step:12:316 gnu/linux ditto. 😢 https://github.com/foundry-rs/foundry/blob/89f0fb923773cf0f8f966290e579bae92f505077/crates/forge/tests/cli/config.rs#L233 Lines 364 to 376 in 66d2677
|
hey @Troublor do you have plans for finishing this? considering that CI fails I am thinking that perhaps we should take a different approach? currently in remappings.txt of a foundry project you can specify remappings in any format: any of compilers/crates/artifacts/solc/src/remappings.rs Lines 360 to 365 in a21275d
however, when working with i.e. etherscan projects or any sources of remappings requiring deserialization directly into Thus, I think we can either just update compilers/crates/artifacts/solc/src/remappings.rs Lines 159 to 161 in a21275d
Also, we can consider adding this additional logic to |
@klkvr Thanks. I restructured the patch. Please approve the CI tests. |
@klkvr I fixed some regression test oracles. Please trigger CI again. Thx. |
@klkvr There seems to be some race: the last commit (just some refactoring) is not included in the CI. But the previous CI passes, so everything should look good now. Thanks for your efforts. |
@Troublor mind updating patch in foundry-rs/foundry#7623? (or creating a new PR if you don't have access to that branch) |
@klkvr It seems @BlazeWasHere has already updated that PR. |
@klkvr I created another PR to test on foundry: foundry-rs/foundry#8377 Foundry would need a little patch as well for one integration test: Other than this, all tests pass and everything looks good. |
@klkvr Yes, problem solved. Thx. |
Fix #47. One corresponding test is added.
Fix strategy
/
when serializingRemapping
andRelativeRemapping
./
in thestrip_prefix
method ofRemapping
.Rationale
There are roughly two sources where
Remapping
comes from:find_many
function.foundry.toml
.When generating
Remapping
infind_many
function, the algorithm makes sure that thename
andpath
of every remapping are valid folders in the file system. Then, trailing/
s are added to bothname
andpath
in theimpl From<RelativeRemapping> for Remapping
implementation.https://github.com/Troublor/compilers/blob/93c5f46a7dd0c0d387dd94c8ea756812e2907d92/src/remappings.rs#L360-L365
When loading
Remapping
from user-provided configurations, thename
andpath
of remappings should be set as it is, and do not add any trailing/
s.Either way, the field
name
andpath
ofRemapping
contains intended values and should not be changed in the serialization (the implementation forDisplay
trait).PS: About coding style, I tried to use
TempProject
to write the test case but it seems theproject.compile()
method does not respect theremapping
I give it viaproject.with_settings(settings_with_remapping)
. The remapping just does not take effect in the compilation. Not sure whether it's I don't know how to use it orTempProject
has some bugs.