Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

forge build is generating multiple keys under build-info.output.source #8797

Closed
2 tasks done
Uhan19 opened this issue Sep 3, 2024 · 2 comments
Closed
2 tasks done
Labels
A-compiler Area: compiler T-bug Type: bug T-needs-triage Type: this issue needs to be labelled

Comments

@Uhan19
Copy link

Uhan19 commented Sep 3, 2024

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (d75318c 2024-09-02T00:24:18.763851000Z)

What command(s) is the bug in?

forge build

Operating System

macOS (Apple Silicon)

Describe the bug

running forge build --build-info --skip test/** script/** --force generates multiple keys for the same file:

❯ cat $(find out/build-info/*.json) | jq '.output.sources | keys' | grep 'ITransferValidator.sol' "contracts/interfaces/callbacks/ITransferValidator.sol", "lib/core-v1/contracts/interfaces/callbacks/ITransferValidator.sol",

ITransferValidator.sol is a file in the submodule of the repo, and the correct path is lib/core-v1/contracts/interfaces/callbacks/ITransferValidator.sol. However, there is an additional key in the sources with this path: contracts/interfaces/callbacks/ITransferValidator.sol, which is the path in the repo that it belongs to.

This is causing issues for when I run slither . --ignore-compile --config-file=slither.config.json --fail-low, which is yielding this error: crytic_compile.platform.exceptions.InvalidCompilation: Unknown file: contracts/interfaces/callbacks/ITransferValidator.sol.

I would expect forge build to only generate one key in the output.sources, could use some insight to pinpoint the issue and what is causing the key generate with the incorrect path. Thank you!

Ref ticket in crytic-compile: crytic/crytic-compile#572

@Uhan19 Uhan19 added T-bug Type: bug T-needs-triage Type: this issue needs to be labelled labels Sep 3, 2024
@grandizzy
Copy link
Collaborator

looks like a dupe of foundry-rs/compilers#246

@zerosnacks
Copy link
Member

Marking as duplicate, closing in favor of foundry-rs/compilers#246

Added your bug description in the comments

@zerosnacks zerosnacks closed this as not planned Won't fix, can't repro, duplicate, stale Sep 5, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-compiler Area: compiler T-bug Type: bug T-needs-triage Type: this issue needs to be labelled
Projects
None yet
Development

No branches or pull requests

3 participants