Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

fix(solc): prefere dapptools style remappings #713

Merged
merged 1 commit into from
Dec 19, 2021

Conversation

mattsse
Copy link
Collaborator

@mattsse mattsse commented Dec 19, 2021

Motivation

Fix an edge in remapping resolution that made it nondeterministic for layouts like:

ds-test
├── demo
│   └── demo.sol
└── src
    └── test.sol

Solution

favor dapptools style lib paths ("lib"/"src") over others ("demo") with additional check

[ethers-solc/src/remappings.rs:463] Remapping::find_many("git/rust/foundry/integration-tests/testdata/guni-lev/lib") = [
    Remapping {
        name: "ds-test/",
        path: "git/rust/foundry/integration-tests/testdata/guni-lev/lib/ds-test/src/",
    },
]

PR Checklist

  • Added Tests
  • Added Documentation
  • Updated the changelog

@mattsse mattsse force-pushed the matt/remapping-edge-case branch from f535fd4 to 48526a4 Compare December 19, 2021 20:31
@gakonst gakonst merged commit 0d2fc53 into gakonst:master Dec 19, 2021
gakonst added a commit to foundry-rs/foundry that referenced this pull request Dec 19, 2021
gakonst added a commit to foundry-rs/foundry that referenced this pull request Dec 19, 2021
* fix(cli): default to rustls for ssl

* ci: add more workflows

* windows builds w/o default features

* fix: ensure build works w/o default features

* chore: fmt

* fix: try using platform dependent sha2/asm activation

* Revert "fix: try using platform dependent sha2/asm activation"

This reverts commit f589c08.

The target architecture configs seem to not be respected by Cargo.

* chore: default to not using sha2-asm

* fix: skip FFI Test on non-Unix systems

* ci: add caching

* ci: remove ssl installation

* chore: bump ethers to fix paths bug

gakonst/ethers-rs#712

* chore: bump ethers to fix remappings non-determinism bug

gakonst/ethers-rs#713
@gakonst
Copy link
Owner

gakonst commented Dec 19, 2021

This PR broke remappings, resulting in the internal libs to be unbundled in their packages. Example from Vaults using Solmate

➜  vaults git:(main) ../foundry/target/debug/forge  remappings
tokens/=/Users/gakonst/oss/vaults/lib/solmate/src/tokens/
auth/=/Users/gakonst/oss/vaults/lib/solmate/src/auth/
weird-erc20/=/Users/gakonst/oss/vaults/lib/solmate/lib/weird-erc20/src/
users/=/Users/gakonst/oss/vaults/lib/solmate/src/test/utils/users/
authorities/=/Users/gakonst/oss/vaults/lib/solmate/src/auth/authorities/
utils/=/Users/gakonst/oss/vaults/lib/solmate/src/test/utils/
ds-test/=/Users/gakonst/oss/vaults/lib/solmate/lib/ds-test/src/
demo/=/Users/gakonst/oss/vaults/lib/solmate/lib/ds-test/demo/
test/=/Users/gakonst/oss/vaults/lib/solmate/src/test/
mocks/=/Users/gakonst/oss/vaults/lib/solmate/src/test/utils/mocks/

it unbundled the solmate dep into all its sub-parts

charisma98 added a commit to charisma98/foundry that referenced this pull request Mar 4, 2023
* fix(cli): default to rustls for ssl

* ci: add more workflows

* windows builds w/o default features

* fix: ensure build works w/o default features

* chore: fmt

* fix: try using platform dependent sha2/asm activation

* Revert "fix: try using platform dependent sha2/asm activation"

This reverts commit f589c082c019ccc7ec4feee041da9ba15694cd89.

The target architecture configs seem to not be respected by Cargo.

* chore: default to not using sha2-asm

* fix: skip FFI Test on non-Unix systems

* ci: add caching

* ci: remove ssl installation

* chore: bump ethers to fix paths bug

gakonst/ethers-rs#712

* chore: bump ethers to fix remappings non-determinism bug

gakonst/ethers-rs#713
0129general added a commit to 0129general/FoundryProject that referenced this pull request May 8, 2024
* fix(cli): default to rustls for ssl

* ci: add more workflows

* windows builds w/o default features

* fix: ensure build works w/o default features

* chore: fmt

* fix: try using platform dependent sha2/asm activation

* Revert "fix: try using platform dependent sha2/asm activation"

This reverts commit f589c082c019ccc7ec4feee041da9ba15694cd89.

The target architecture configs seem to not be respected by Cargo.

* chore: default to not using sha2-asm

* fix: skip FFI Test on non-Unix systems

* ci: add caching

* ci: remove ssl installation

* chore: bump ethers to fix paths bug

gakonst/ethers-rs#712

* chore: bump ethers to fix remappings non-determinism bug

gakonst/ethers-rs#713
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants