Skip to content
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

Revive's resolver not processing remappings properly when compiling using standard json #145

Open
Brianspha opened this issue Jan 6, 2025 · 0 comments
Assignees

Comments

@Brianspha
Copy link
Contributor

Brianspha commented Jan 6, 2025

While integrating Revive, discovered an issue with the import resolver where remappings are not being processed correctly. Looking at both solc and Revive's behavior with identical standard JSON input:

{
 "settings": {
   "remappings": ["forge-std/=lib/forge-std/src/"]
 }
}

Both compilers receive the same command line args:

--allow-paths /workspace/test_proj,/workspace/test_proj/lib --base-path /workspace/test_proj --standard-json

However, Revive only searches in the base path and fails with for example:
Source not found: Searched the following locations: "/workspace/test_proj" While solc successfully resolves imports by applying the remappings. I've verified this behavior in both Foundry and Remix integrations with Revive, confirming it's an issue with how Revive processes remappings rather than being integration-specific.

The command line args are being passed correctly as contracts with no remappings work fine, suggesting the issue is in how the resolver handles remappings during import resolution. With remix integration one would need to observe the network tab after compiling and notice that compilation results yield an error.

Testing & Reproduction

Remix: Observe the network tab after compiling to see compilation results yielding an error
Foundry:

  • Clone and build the foundry-revive fork
  • Run cargo build -p forge in the repository root
  • Create a new foundry project using ../target/debug/forge init this may require you to login to git if using a container/vm/docker
  • Then compile with forge build --resolc-compile so ../target/debug/forge --resolc-compile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant