Skip to content

The docker CI test fails on recent Foundry versions #1142

Description

@tothtamas28

The docker CI job in test-pr.yaml fails at the Run forge build step when running

forge install --no-git foundry-rs/forge-std@75f1746

inside the container.

This used to work in Foundry v1.5.1, but it no longer does in v1.7.0. When building the image for the test, foundryup is run without a pinned version, hence the regression.

Error

Warning: Found unknown `rpc_endpoints` config for profile `default` defined in foundry.toml.
Installing forge-std in /home/user/foundry/lib/forge-std (url: https://github.com/foundry-rs/forge-std, tag: 75f1746)
Cloning into '/home/user/foundry/lib/forge-std'...
Error: git checkout exited with code 128:
fatal: not a git repository: ../../.git/modules/lib/ds-test
fatal: could not reset submodule index

Analysis

The src/tests/integration/test-data/foundry directory is copied into the container with docker cp, and is not a git repository. The forge-std@75f1746 tag includes ds-test as a git submodule. At some point in the v1.5.1..v1.7.0 range forge likely changed how it handles submodule checkout for libraries, causing the fatal error.

Regression

Bisected to Foundry releases: foundryup --install v1.5.1 works; v1.7.0 does not. Because the Docker image runs foundryup without a pinned version, any new enough base image will exhibit this.

Fixes

Option A: init a git repo before installing libraries

Add git init to the CI step that sets up the Foundry root so that /home/user/foundry is a real git repository before forge install runs. This also makes the --no-git flag redundant and can be dropped.

Option B: use a newer forge-std tag that no longer has the ds-test submodule

Update the pinned tag (currently 75f1746) to a revision where ds-test has been removed. This sidesteps the submodule issue without changing the container setup.

Current workaround

PR #1139 pins Foundry to v1.5.1 in the Dockerfile: foundryup --install v1.5.1. Pinning the version is probably not a bad idea in itself, but in order to be able to update from this version, one of the fixes need to be applied.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions