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

Forge nightly version (foundryup) fails to compile with unresolved imports #9271

Closed
2 tasks done
aviggiano opened this issue Nov 6, 2024 · 4 comments · Fixed by #9274
Closed
2 tasks done

Forge nightly version (foundryup) fails to compile with unresolved imports #9271

aviggiano opened this issue Nov 6, 2024 · 4 comments · Fixed by #9274
Labels
A-remappings Area: remappings P-high Priority: high T-bug Type: bug T-needs-triage Type: this issue needs to be labelled

Comments

@aviggiano
Copy link

aviggiano commented Nov 6, 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 (57bb12e 2024-11-06T00:26:30.417023000Z)

What command(s) is the bug in?

forge build

Operating System

macOS (Apple Silicon)

Describe the bug

My project is not compiling after running foundryup

This version compiled: https://github.com/SizeCredit/size-solidity/actions/runs/11483354647/job/31958586649 (nightly-c3069a50ba18cccfc4e7d5de9b9b388811d9cc7b also compiles)

The current version (nightly-57bb12e022fb9ea46a4a7ca8647eb016e8d43ca3) is not compiling:

Unable to resolve imports:
      "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol" in ".../size-solidity/src/Size.sol"
      "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol" in ".../size-solidity/src/Size.sol"
      "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol" in ".../size-solidity/src/Size.sol"
      "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol" in ".../size-solidity/test/local/actions/Upgrade.t.sol"
      "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol" in ".../size-solidity/src/Size.sol"
with remappings:
      @openzeppelin/contracts/=.../size-solidity/lib/openzeppelin-contracts/contracts/
      @chainlink/=.../size-solidity/lib/chainlink/
      @src/=.../size-solidity/src/
      @test/=.../size-solidity/test/
      @script/=.../size-solidity/script/
      @solady/=.../size-solidity/lib/solady/src/
      @chimera/=.../size-solidity/lib/chimera/src/
      @crytic/properties/=.../size-solidity/lib/properties/
      @aave/=.../size-solidity/lib/aave-v3-core/contracts/
      halmos-cheatcodes/=.../size-solidity/lib/halmos-cheatcodes/src/
      ERC4626/=.../size-solidity/lib/properties/lib/ERC4626/contracts/
      aave-v3-core/=.../size-solidity/lib/aave-v3-core/
      chainlink/=.../size-solidity/lib/chainlink/contracts/
      chimera/=.../size-solidity/lib/chimera/src/
      ds-test/=.../size-solidity/lib/forge-std/lib/ds-test/src/
      erc4626-tests/=.../size-solidity/lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/
      forge-std/=.../size-solidity/lib/forge-std/src/
      openzeppelin-contracts-upgradeable/=.../size-solidity/lib/openzeppelin-contracts-upgradeable/
      openzeppelin-contracts/=.../size-solidity/lib/openzeppelin-contracts/
      properties/=.../size-solidity/lib/properties/contracts/
      solady/=.../size-solidity/lib/solady/
      solmate/=.../size-solidity/lib/properties/lib/solmate/src/
Compiling 240 files with Solc 0.8.23
Solc 0.8.23 finished in 264.43ms
Error: Compiler run failed:
Error (6275): Source "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol" not found: File not found. Searched the following locations: ".../size-solidity".
ParserError: Source "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol" not found: File not found. Searched the following locations: ".../size-solidity".
 --> src/Size.sol:4:1:
  |
4 | import {AccessControlUpgradeable} from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Error (6275): Source "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol" not found: File not found. Searched the following locations: ".../size-solidity".
ParserError: Source "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol" not found: File not found. Searched the following locations: ".../size-solidity".
 --> src/Size.sol:6:1:
  |
6 | import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Error (6275): Source "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol" not found: File not found. Searched the following locations: ".../size-solidity".
ParserError: Source "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol" not found: File not found. Searched the following locations: ".../size-solidity".
 --> src/Size.sol:7:1:
  |
7 | import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Error (6275): Source "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol" not found: File not found. Searched the following locations: ".../size-solidity".
ParserError: Source "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol" not found: File not found. Searched the following locations: ".../size-solidity".
 --> src/Size.sol:8:1:
  |
8 | import {PausableUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Error (6275): Source "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol" not found: File not found. Searched the following locations: ".../size-solidity".
ParserError: Source "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol" not found: File not found. Searched the following locations: ".../size-solidity".
 --> test/local/actions/Upgrade.t.sol:6:1:
  |
6 | import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


@aviggiano aviggiano added T-bug Type: bug T-needs-triage Type: this issue needs to be labelled labels Nov 6, 2024
@zerosnacks
Copy link
Member

cc @grandizzy this appears related to the recent change we made in #9246

@grandizzy
Copy link
Collaborator

cc @grandizzy this appears related to the recent change we made in #9246

yeah, that is the case, going to revert that for now and consider this failure when reworking fix from #9246

@grandizzy
Copy link
Collaborator

the issue is that with the change (checking remappings to add against existing) if there's @openzeppelin/contracts already added then @openzeppelin/contracts-upgradeable remapping will be discarded (as it matches the start...)

@zerosnacks
Copy link
Member

@aviggiano nightly has been released, please re-run foundryup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-remappings Area: remappings P-high Priority: high T-bug Type: bug T-needs-triage Type: this issue needs to be labelled
Projects
None yet
3 participants