mario-eth / soldeer

Solidity Package Manager written in rust
MIT License
241 stars 26 forks source link

trailing slash '/' in remappings.txt #182

Closed macwis closed 1 month ago

macwis commented 2 months ago

that's a bit hard to reproduce, so sorry if the description is vague - happy to receive some thoughts on this, from someone knowing the soldeer internals.

observed on both linux & macos, ... sometimes.

remappings.txt contents e.g.:

@openzeppelin-contracts-4.9.6=dependencies/@openzeppelin-contracts-4.9.6

another time regenerated remappings.txt contents:

@openzeppelin-contracts-4.9.6/=dependencies/@openzeppelin-contracts-4.9.6/

both records are not treated equal by soldeer (despite they work the same), so when one record present when re-run getting a file with a duplicate, so the file quickly becomes as:

@openzeppelin-contracts-4.9.6=dependencies/@openzeppelin-contracts-4.9.6
@openzeppelin-contracts-4.9.6/=dependencies/@openzeppelin-contracts-4.9.6/

it's a really weird behavior and I have a problem determining what's causing it. I have no problem having the duplicates, but in combination with https://github.com/mario-eth/soldeer/issues/181 it quickly escalates to be a bit messy.

Actual

Duplicated remapping by the trailing slash, resulting in soldeer adding two records meaning the same.

Expected

No duplicated remapping, trailing slash trimmed.

beeb commented 2 months ago

Since the remappings logic has been rewritten in the upcoming version, I think this should not happen anymore. You can try to reproduce with the code of the release/v0.4.0 branch and see if it's fixed, or just wait for the next release!