Skip to content

Commit

Permalink
fix: normalize windows path to handle solc >=0.8.8 filename lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
0xalpharush committed Mar 22, 2024
1 parent de160c4 commit 8682260
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ jobs:
pip install solc-select
- name: Run Tests
run: |
pytest tests/test_metadata.py
pytest tests
7 changes: 4 additions & 3 deletions crytic_compile/utils/naming.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,11 @@ def convert_filename(
short = relative

short = relative_to_short(short)

# Starting with v0.8.8 (https://github.com/ethereum/solidity/pull/11545), solc normalizes the paths to not include the drive on Windows,
# so it's important we use posix path here to avoid issues with the path comparison.
return Filename(
absolute=str(absolute),
absolute=absolute.as_posix(),
relative=relative.as_posix(),
short=short.as_posix(),
used=str(used_filename),
used=Path(used_filename).as_posix(),
)
Binary file added tests/call_to_variable-all.sol-0.5.8-legacy.zip
Binary file not shown.

0 comments on commit 8682260

Please sign in to comment.