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

bug: platform-specific submodule version inconsistency during forge test execution #9759

Open
1 of 2 tasks
ckartik opened this issue Jan 26, 2025 · 1 comment
Open
1 of 2 tasks
Labels
T-bug Type: bug T-to-reproduce Type: requires reproduction

Comments

@ckartik
Copy link

ckartik commented Jan 26, 2025

Component

Forge

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

  • Foundry
  • Foundryup

What version of Foundry are you on?

No response

What version of Foundryup are you on?

No response

What command(s) is the bug in?

No response

Operating System

None

Describe the bug

Description

When running forge-test, there's an inconsistent behavior between Linux and macOS platforms regarding submodule versioning. On Linux, the system pulls new versions of submodules during test execution, even when specific versions are committed, while macOS maintains the committed versions.

Current Behavior

  1. On Linux:

    • Running forge-test triggers a new submodule pull
    • The pulled version differs from the committed version
    • This affects OpenZeppelin upgrades validation, causing build failures
  2. On macOS:

    • Running forge-test maintains the committed submodule versions
    • No unexpected version changes occur
    • Builds complete successfully

Example

This inconsistency manifests in OpenZeppelin upgrades validation, where Linux builds fail due to AST validation errors while macOS builds succeed. Specific error:
ASTDereferencerError: No node with id -18 of type FunctionDefinition
Copy
This error occurs because the validation attempts to process negative AST IDs (e.g., -18) from require statements, which should be ignored as per OpenZeppelin/openzeppelin-upgrades#1118.

Related Issues

Steps to Reproduce

  1. Commit a specific version of submodules
  2. Run forge-test on Linux
  3. Check submodule versions
  4. Compare with the same process on macOS

Expected Behavior

  • Submodule versions should remain consistent with committed versions across all platforms
  • forge-test should not trigger automatic updates of submodules unless explicitly requested

Environment

  • Linux: [version details]
  • macOS: [version details]
  • Forge version: [version number]
@ckartik ckartik added T-bug Type: bug T-needs-triage Type: this issue needs to be labelled labels Jan 26, 2025
@github-project-automation github-project-automation bot moved this to Todo in Foundry Jan 26, 2025
@zerosnacks zerosnacks self-assigned this Jan 28, 2025
@zerosnacks zerosnacks added T-to-investigate Type: to investigate and removed T-needs-triage Type: this issue needs to be labelled labels Jan 28, 2025
@zerosnacks
Copy link
Member

zerosnacks commented Jan 28, 2025

Hi @ckartik

I've tried reproducing your issue but I am unable to. We don't have any conditional logic for different operating systems when interacting with git nor do we run forge upgrade prior to forge test.

My hunch is that is related to the issue reported #9453 and the version you check into .gitmodules does not contain a branch / tag which is causing issues when (re)cloning the repo and subsequently running forge update.

I think the behavior you are seeing is something that will be fixed in #9522

Would you mind posting your .gitmodules, your version of foundryup --version and the version of forge --version?

Related: https://book.getfoundry.sh/announcements

@zerosnacks zerosnacks added T-to-reproduce Type: requires reproduction and removed T-to-investigate Type: to investigate labels Jan 30, 2025
@zerosnacks zerosnacks removed their assignment Jan 30, 2025
@zerosnacks zerosnacks changed the title Platform-specific submodule version inconsistency during forge-test execution bug: platform-specific submodule version inconsistency during forge test execution Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: bug T-to-reproduce Type: requires reproduction
Projects
Status: Todo
Development

No branches or pull requests

2 participants