mario-eth / soldeer

Solidity Package Manager written in rust
MIT License
133 stars 13 forks source link

`forge-std` imports are broken #83

Closed ZeroEkkusu closed 4 days ago

ZeroEkkusu commented 4 days ago

It seems that Soldeer 'unpacks' src/contracts directories of installed dependencies.

$ ls dependencies/@openzeppelin-contracts-4.9.2 
README.md       crosschain      interfaces      proxy           utils
access          finance         metatx          security        vendor
build           governance      package.json    token

But, Forge Std also loses its directory structure:

$ ls dependencies/forge-std-1.9.1 
Base.sol                        Script.sol                      StdToml.sol
CompilationScript.sol           StdAssertions.sol               StdToml.t.sol
CompilationScriptBase.sol       StdAssertions.t.sol             StdUtils.sol
CompilationTest.sol             StdChains.sol                   StdUtils.t.sol
CompilationTestBase.sol         StdChains.t.sol                 Test.sol
IERC1155.sol                    StdCheats.sol                   Vm.sol
IERC165.sol                     StdCheats.t.sol                 Vm.t.sol
IERC20.sol                      StdError.sol                    broadcast.log.json
IERC4626.sol                    StdError.t.sol                  ci.yml
IERC721.sol                     StdInvariant.sol                console.sol
IMulticall3.sol                 StdJson.sol                     console2.sol
LICENSE-APACHE                  StdJson.t.sol                   foundry.toml
LICENSE-MIT                     StdMath.sol                     package.json
MockERC20.sol                   StdMath.t.sol                   safeconsole.sol
MockERC20.t.sol                 StdStorage.sol                  sync.yml
MockERC721.sol                  StdStorage.t.sol                test.json
MockERC721.t.sol                StdStyle.sol                    test.toml
README.md                       StdStyle.t.sol                  vm.py

This results in broken imports in Forge Std files:

Error (6275): Source "dependencies/forge-std-1.9.1/mocks/MockERC721.sol" not found: File not found. Searched the following locations: "/path/to/codebase".
ParserError: Source "dependencies/forge-std-1.9.1/mocks/MockERC721.sol" not found: File not found. Searched the following locations: "/path/to/codebase".
 --> dependencies/forge-std-1.9.1/StdUtils.sol:8:1:
  |
8 | import {MockERC721} from "./mocks/MockERC721.sol";
  |

Am I doing something wrong, perhaps?

mario-eth commented 4 days ago

this was an issue with pushing dependencies with custom paths by the crawler. Should be solved already, you need to reinstall the dependency, a fix for this to not happen will be in the next release