Skip to content

Gemforge fails to build when OpenZeppelin is added as a submodule #53

@Enceladus-py

Description

@Enceladus-py

Problem

When OpenZeppelin is added using git submodules instead of the npm package, gemforge build triggers Hardhat to compile all .sol files inside the submodule, including:

  • certora/harnesses/
  • lib/forge-std/
  • test mocks (test/**)
  • non-existent patched imports

These folders contain verification harnesses and Foundry test utilities, which Hardhat cannot compile.

This results in errors such as:

  • Error HHE902: The file .../certora/patched/governance/TimelockController.sol doesn't exist
  • Error HHE902: The package "ds-test" is not installed
  • Error HHE902: There was an error while resolving the import "truffle/Assert.sol"

Environment

  • Gemforge version: 2.0.0
  • Hardhat version: 3.0.16
  • OpenZeppelin version: 4.9.2 (submodule)
  • Node.js version: 23.5.0
  • OS: macOS

How to reproduce

  • gemforge scaffold --hardhat --folder /path/to/new_or_empty_folder
  • cd /path/to/new_or_empty_folder
  • gemforge build

Workaround

I manually deleted the problematic folders inside the OpenZeppelin submodule:

  • rm -rf lib/openzeppelin-contracts/test
  • rm -rf lib/openzeppelin-contracts/lib
  • rm -rf lib/openzeppelin-contracts/certora

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions