Skip to content

Nested importing contract from other Forge project causes forge build/lint to fail on 1.4.4 #12403

@guidanoli

Description

@guidanoli

Component

Forge

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

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge Version: 1.4.4-v1.4.4 Commit SHA: 0579449 Build Timestamp: 2025-10-30T15:50:28.714367747Z (1761839428) Build Profile: maxperf

What version of Foundryup are you on?

foundryup: 1.3.0

What command(s) is the bug in?

forge lint

Operating System

Linux

Describe the bug

Summary

On the following multi-project structure:

.
├── project1
│   ├── foundry.toml
│   └── src
│       ├── A.sol
│       └── B.sol
└── project2
    ├── foundry.toml
    └── src
        └── C.sol

... where A is inherited by B, and B is inherited by C.
Running forge lint or forge build on project2 results in error:

[⠊] Compiling...
No files changed, compilation skipped
Error: solar run failed:

error: file ./A.sol not found
 --> ../project1/src/B.sol:5:17
  |
5 | import {A} from "./A.sol";
  |                 ^^^^^^^^^

This issue appears on Foundry 1.4.4 but seems to have been solved on nightly (65f96cf).

Proof of concept

forge-lint-1.4.4-bug-poc.tar.gz

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-bugType: bugT-needs-triageType: this issue needs to be labelled

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions