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

Migrate to Go 1.24 and new tools #490

Merged
merged 7 commits into from
Feb 18, 2025
Merged

Migrate to Go 1.24 and new tools #490

merged 7 commits into from
Feb 18, 2025

Conversation

mkysel
Copy link
Collaborator

@mkysel mkysel commented Feb 14, 2025

Fixes #462

I love red diffs!

Summary by CodeRabbit

Summary by CodeRabbit

  • Chores
    • Streamlined automation workflows by removing unnecessary steps for tool installations.
    • Upgraded the Go version to 1.24 across build environments and dependency management for enhanced performance.
    • Standardized tool invocations for code generation, database migrations, and formatting.
    • Removed obsolete tooling support files to simplify development processes.
    • Updated the prerequisites in the README to reflect the new Go version compatibility.
    • Introduced a new Go module for managing build tools and dependencies.
  • Bug Fixes
    • Updated dependencies to ensure compatibility with the latest Go version and improved functionality.

Copy link

coderabbitai bot commented Feb 14, 2025

Walkthrough

The pull request updates multiple CI workflows, Dockerfiles, and developer scripts to streamline the build and tooling processes. Changes include the removal of certain installation steps in GitHub Actions workflows, updating the Go version from 1.23 to 1.24 in Dockerfiles and the go.mod file, and modifying various command invocations to use the Go toolchain (prefixed with go tool). Additionally, obsolete tool management scripts and associated dependencies have been removed or replaced, and dependency versions in go.mod have been updated with the addition of a dedicated tool section.

Changes

File(s) Change Summary
.github/workflows/lint-go.yml, .github/workflows/nightly.yml Removed installation steps: deleted go install github.com/segmentio/golines from lint workflow and removed bufbuild/[email protected] from the nightly workflow.
dev/baked/Dockerfile, dev/docker/Dockerfile, dev/docker/Dockerfile-cli Updated the Go version argument from 1.23 to 1.24.
dev/gen-migration, dev/gen-protos, dev/generate, dev/lint-golines Modified commands to use the Go toolchain: switched commands to go tool migrate create, go tool buf generate, go tool sqlc generate/go tool mockery, and go tool golines.
dev/up, dev/update-tools, tools.go Removed tool installation checks in dev/up and deleted obsolete tool management scripts (dev/update-tools and tools.go).
go.mod Upgraded the Go version and toolchain version; updated dependency versions; added a new tool section listing tools such as buf, abigen, migrate, golines, sqlc, and mockery.
pkg/mocks/metadata_api/mock_MetadataApiClient.go Updated the autogenerated comment to reflect the new version of mockery (v2.51.1 instead of v2.50.0).

Sequence Diagram(s)

sequenceDiagram
    participant Dev as Developer
    participant Migrate as Migration Script (dev/gen-migration)
    participant Protos as Protobuf Script (dev/gen-protos)
    participant CodeGen as Code Generation Script (dev/generate)
    participant Linter as Lint Script (dev/lint-golines)
    participant GoTool as Go Toolchain

    Dev->>Migrate: Run migration creation
    Migrate->>GoTool: Execute "go tool migrate create ..."
    GoTool-->>Migrate: Migration files generated

    Dev->>Protos: Run proto generation
    Protos->>GoTool: Execute "go tool buf generate"
    GoTool-->>Protos: Protobuf code generated

    Dev->>CodeGen: Run code generation
    CodeGen->>GoTool: Execute "go tool sqlc generate"
    GoTool-->>CodeGen: SQL code generated
    CodeGen->>GoTool: Execute "go tool mockery"
    GoTool-->>CodeGen: Mocks generated

    Dev->>Linter: Run code formatting
    Linter->>GoTool: Execute "go tool golines -w ..."
    GoTool-->>Linter: Code formatted
Loading

Possibly related PRs

  • ci: build and test contracts before deploy #401: The changes in the main PR, which involve removing the installation step for the golines tool in the GitHub Actions workflow, are related to the modifications in the retrieved PR that also involve updates to the deployment process and the use of Go tools, specifically the golines tool.
  • Handle pipefail in bash contract scripts #488: The changes in the main PR, which involve removing the installation step for the golines tool in the GitHub Actions workflow, are related to the modifications in the retrieved PR that also involve the golines tool, specifically changing its invocation to use the Go toolchain in the dev/lint-golines script.
  • chore: move all contract related logic to contracts folder #355: The changes in the main PR, which involve modifying the GitHub Actions workflow for linting Go code by removing the installation step for the golines tool, are related to the retrieved PR, as both involve adjustments to the handling of Go tools, specifically the golines tool in the context of the project's build and deployment processes.

Suggested reviewers

  • fbac

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
go.mod (1)

429-436: Introduce Dedicated Tool Section
A new tool block has been added listing tool dependencies such as Buf, abigen, migrate, golines, sqlc, and mockery. This is a good practice for managing tool versions reproducibly; however, make sure that these tools are not redundantly listed in the require section to avoid potential conflicts.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e5665dc and c7e16b4.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (14)
  • .github/workflows/lint-go.yml (0 hunks)
  • .github/workflows/nightly.yml (0 hunks)
  • dev/baked/Dockerfile (1 hunks)
  • dev/docker/Dockerfile (1 hunks)
  • dev/docker/Dockerfile-cli (1 hunks)
  • dev/gen-migration (1 hunks)
  • dev/gen-protos (1 hunks)
  • dev/generate (1 hunks)
  • dev/lint-golines (1 hunks)
  • dev/up (0 hunks)
  • dev/update-tools (0 hunks)
  • go.mod (12 hunks)
  • pkg/mocks/metadata_api/mock_MetadataApiClient.go (1 hunks)
  • tools.go (0 hunks)
💤 Files with no reviewable changes (5)
  • tools.go
  • .github/workflows/lint-go.yml
  • dev/up
  • .github/workflows/nightly.yml
  • dev/update-tools
✅ Files skipped from review due to trivial changes (2)
  • pkg/mocks/metadata_api/mock_MetadataApiClient.go
  • dev/lint-golines
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Push Docker Images to GitHub Packages (xmtpd)
  • GitHub Check: Test (Node)
  • GitHub Check: Lint-Go
🔇 Additional comments (12)
dev/gen-migration (1)

4-4: LGTM! Command updated to use Go toolchain.

The change to use go tool migrate create aligns with the PR objectives of migrating to new tools. The functionality remains unchanged as all parameters are preserved.

dev/generate (1)

6-6: LGTM! Commands updated to use Go toolchain.

The changes to use go tool sqlc generate and go tool mockery align with the PR objectives of migrating to new tools. The functionality remains unchanged.

Also applies to: 10-10

dev/gen-protos (1)

4-4: LGTM! Command updated to use Go toolchain.

The change to use go tool buf generate aligns with the PR objectives of migrating to new tools. The functionality remains unchanged, and proper error handling is maintained.

dev/docker/Dockerfile-cli (1)

2-2:

✅ Verification successful

Verify Go 1.24 compatibility.

The Go version update aligns with the PR objectives. Let's verify the compatibility and latest version.


🌐 Web query:

What is the latest version of Go and when was Go 1.24 released?

💡 Result:

The latest version of Go is 1.24, which was officially released on February 11, 2025[2][5][9]. This release includes significant updates such as full support for generic type aliases[2][5], performance improvements with a new map implementation[2], enhanced WebAssembly support[5], and tools for FIPS 140-3 compliance[5].

Key highlights of Go 1.24:

  • Language changes: Generic type aliases allow parameterized type definitions[2][5].
  • Toolchain improvements: New go get -tool command for managing tool dependencies[2].
  • Runtime optimizations: Reduced CPU overhead by ~2–3% through memory allocation and mutex enhancements[2][5].
  • Security: Added FIPS 140-3 compliant cryptographic modules[5].

For context, prior versions like Go 1.23.6 (released February 4, 2025) included security fixes for crypto/elliptic[1], while Go 1.25 is still in development and slated for August 2025[4].

Citations:


Verified: Go 1.24 is current and compatible.

The Dockerfile update to ARG GO_VERSION=1.24 aligns with the PR’s objectives. Based on the latest release information, Go 1.24—released on February 11, 2025—is the current stable version with the expected performance and feature improvements. No compatibility issues were found.

dev/docker/Dockerfile (1)

2-2: Update Go Version to 1.24
The ARG GO_VERSION change ensures the builder now uses Go 1.24. This is in line with the overall migration objective. Please verify that your code (and any associated tooling) is compatible with Go 1.24.

dev/baked/Dockerfile (1)

2-2: Update Go Version to 1.24
The Dockerfile now uses ARG GO_VERSION=1.24, harmonizing it with the rest of the project. Given that this Dockerfile relies on a Debian-based image (using Bookworm) and apt-get for package management, ensure that any tooling or scripts invoked (e.g. Foundry installation) work as expected with the newer Go version.

go.mod (6)

3-3: Update Go Language Version in Module
The module now specifies go 1.24, reflecting the migration target. Confirm that no breaking language changes affect the project's codebase.


6-7: Bump Core Dependency Versions
The versions for github.com/ethereum/go-ethereum and github.com/golang-migrate/migrate/v4 have been incremented to v1.15.1 and v4.18.2 respectively. Although these are minor updates, please verify that any API changes (if any) do not impact the project functionality.


40-48: Update Cloud Google Dependencies
The indirect dependencies for various cloud.google.com/go/... packages have been updated to newer versions. Ensure that these updates align with your integration requirements and review their release notes for any non-obvious changes.


171-171: Bump Miscellaneous Dependency Versions
Several indirect dependencies have been updated:
github.com/fsnotify/fsnotify is now at v1.8.0
github.com/google/s2a-go is now at v0.1.8
github.com/googleapis/enterprise-certificate-proxy is bumped to v0.3.4
github.com/googleapis/gax-go/v2 is updated to v2.14.1
github.com/segmentio/golines is now at v0.12.2
github.com/vektra/mockery/v2 is updated to v2.51.1
Please double-check that these minor version bumps do not affect dependent code or introduce unexpected behavior.

Also applies to: 198-198, 200-201, 327-327, 352-352


389-392: Update golang.org/x Modules
Several golang.org/x/... modules have been updated (e.g., crypto, exp, mod, net, sync, sys, term, text, time, and tools). Verify that these updated versions are compatible with your code especially if you rely on any behavior from these modules.

Also applies to: 394-399


401-402: Update Google API Modules
The versions for google.golang.org/api and google.golang.org/genproto have been updated. Ensure these are in line with your integration with Google services and that no breaking changes have been introduced.

@mkysel mkysel marked this pull request as ready for review February 14, 2025 19:02
@mkysel mkysel requested review from a team as code owners February 14, 2025 19:02
Copy link
Contributor

@neekolas neekolas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this is getting close. Feel free to re-ping me when we have the issues with the pre-baked images resolved.

@mkysel mkysel requested a review from neekolas February 18, 2025 13:35
Copy link
Collaborator

@fbac fbac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I'm missing two details:

  • abigen can also be removed from dev/up
  • Probably we want to keep the tools dependencies separated from the production go.mod - avoids clashing, bloating production with non related deps, etc.
    What about having a <root>/tools/go.mod, <root>/tools/<tool>/go.mod?

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
go.mod (1)

429-436: Introduce tool dependencies section.
A new tool section has been added listing explicit tool dependencies (buf, abigen, migrate, golines, sqlc, and mockery). Note that while the AI summary mentioned the removal of github.com/segmentio/golines and github.com/vektra/mockery/v2 as dependencies, they are still listed here. Please confirm if they are intended to be maintained as tool dependencies or removed entirely.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 30dcf60 and ee8ef2a.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (15)
  • .github/workflows/lint-go.yml (0 hunks)
  • .github/workflows/nightly.yml (0 hunks)
  • README.md (1 hunks)
  • dev/baked/Dockerfile (1 hunks)
  • dev/docker/Dockerfile (1 hunks)
  • dev/docker/Dockerfile-cli (1 hunks)
  • dev/gen-migration (1 hunks)
  • dev/gen-protos (1 hunks)
  • dev/generate (1 hunks)
  • dev/lint-golines (1 hunks)
  • dev/up (0 hunks)
  • dev/update-tools (0 hunks)
  • go.mod (12 hunks)
  • pkg/mocks/metadata_api/mock_MetadataApiClient.go (1 hunks)
  • tools.go (0 hunks)
💤 Files with no reviewable changes (5)
  • .github/workflows/lint-go.yml
  • .github/workflows/nightly.yml
  • tools.go
  • dev/update-tools
  • dev/up
🚧 Files skipped from review as they are similar to previous changes (9)
  • dev/baked/Dockerfile
  • dev/gen-protos
  • README.md
  • pkg/mocks/metadata_api/mock_MetadataApiClient.go
  • dev/lint-golines
  • dev/docker/Dockerfile-cli
  • dev/docker/Dockerfile
  • dev/gen-migration
  • dev/generate
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Push Docker Images to GitHub Packages (xmtpd-cli)
  • GitHub Check: Push Docker Images to GitHub Packages (xmtpd)
  • GitHub Check: Test (Node)
  • GitHub Check: Build pre-baked anvil-xmtpd
🔇 Additional comments (17)
go.mod (17)

3-3: Update Go version to 1.24.
The module now specifies Go 1.24, which enables the latest language improvements. Please ensure that all build tools and CI configurations are compatible with Go 1.24.


6-7: Upgrade key dependencies for Ethereum and Migration.
The versions for github.com/ethereum/go-ethereum (v1.15.1) and github.com/golang-migrate/migrate/v4 (v4.18.2) have been updated to their latest releases. Verify that these versions work well with your existing code and infrastructure.


40-48: Upgrade Cloud Google Dependencies.
The Cloud Google packages (e.g. cloud.google.com/go, cloud.google.com/go/auth, etc.) have been updated to newer versions. Please double-check that any API calls or behaviors tied to these libraries remain compatible.


109-109: Update bufbuild dependency version.
The dependency github.com/bufbuild/buf has been bumped to v1.50.0. Ensure that any related code generation or tooling integrations continue to function as expected with this version update.


171-171: Upgrade fsnotify to v1.8.0.
The fsnotify library has been updated to v1.8.0, which should improve file system event handling. Confirm that any file-watching functionality behaves correctly after this upgrade.


198-198: Update github.com/google/s2a-go dependency version.
The version has been updated to v0.1.8. Please verify that any API interactions with this package remain unaffected by the change.


200-200: Upgrade enterprise-certificate-proxy dependency.
The dependency github.com/googleapis/enterprise-certificate-proxy is updated to v0.3.4. It is advisable to test all certificate-related logic to ensure compatibility.


201-201: Upgrade gax-go dependency version.
The github.com/googleapis/gax-go/v2 package has been updated to v2.14.1. Verify that any client calls or configurations using this library continue to operate as expected.


327-327: Update golines version in indirect dependencies.
The github.com/segmentio/golines dependency now appears at v0.12.2. Since the AI summary mentioned its removal, please double-check that its relocation (or continued inclusion) is intentional and does not conflict with tooling expectations.


334-334: Upgrade sourcegraph/conc dependency.
The update to github.com/sourcegraph/conc (v0.3.0) should bring improvements to concurrency support. Confirm that any usage of concurrency primitives from this package is still working correctly.


335-335: Update spf13/afero dependency version.
The afero library has been updated to v1.12.0. At this version bump, please ensure that all file manipulation and abstraction layers are tested thoroughly.


336-336: Upgrade spf13/cast dependency.
The dependency github.com/spf13/cast is now at v1.7.1. This minor upgrade should not affect functionality but it is advisable to verify type conversions and related tests.


338-338: Update spf13/pflag dependency version.
The github.com/spf13/pflag library has been upgraded to v1.0.6. Confirm that command-line flag parsing remains robust after this update.


339-339: Upgrade spf13/viper dependency.
The viper dependency is updated to v1.19.0. Please ensure that all configuration loading and parsing functions have been verified against the new version.


340-340: Update sqlc dependency version.
The update to github.com/sqlc-dev/sqlc (v1.28.0) in the indirect dependencies should streamline code generation. It is recommended to re-run your schema-to-code generation steps and tests after this change.


343-343: Upgrade subosito/gotenv dependency.
The GOTENV library now uses v1.6.0, which may include bug fixes and enhancements for environment variable loading. Make sure your environment configuration tests pass.


344-344: Update supranational/blst dependency version.
The github.com/supranational/blst package has been updated to v0.3.14. Please review any cryptographic functions that depend on this library to ensure they continue to operate securely.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
tools/go.mod (2)

1-3: Module Declaration and Go Version Update

The module declaration and Go version update are declared correctly. However, note that the conventional format in many projects is to specify the Go version as go 1.24 (without the patch version) unless you have a specific need for 1.24.0.

Suggested diff (if you decide to standardize the version format):

- go 1.24.0
+ go 1.24

5-12: Tool Dependencies Block

The addition of the tool block clearly lists all the required development tools such as Buf, Abigen, Migrate, Golines, SQLC, and Mockery. This approach improves reproducibility by explicitly declaring tool dependencies.
Consider whether you might want to pin their versions here (or in the require block) to ensure consistency across development environments.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ee8ef2a and 1972ae5.

⛔ Files ignored due to path filters (2)
  • go.sum is excluded by !**/*.sum
  • tools/go.sum is excluded by !**/*.sum
📒 Files selected for processing (6)
  • dev/gen-migration (1 hunks)
  • dev/gen-protos (1 hunks)
  • dev/generate (1 hunks)
  • dev/lint-golines (1 hunks)
  • go.mod (2 hunks)
  • tools/go.mod (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
  • dev/gen-protos
  • dev/gen-migration
  • dev/generate
  • dev/lint-golines
  • go.mod
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Test (Node)
  • GitHub Check: Lint-Go
  • GitHub Check: Build pre-baked anvil-xmtpd
🔇 Additional comments (1)
tools/go.mod (1)

14-382: Extensive Dependencies in the Require Block

The require block includes a comprehensive list of dependencies, each with explicit version details marked as indirect. This level of detail is beneficial for reproducible builds and clarity on which versions are used.
A couple of points to consider:

  • Ensure that all listed dependencies are necessary for the xmtpd-tools module and not residual from older or unused imports.
  • If possible, review the ordering of dependencies to confirm they follow the standard lexicographical order for easier navigation, though many tools auto-generate this list.

Overall, the block looks correctly formatted and achieves the goal of pinning specific versions for robust dependency management.

@mkysel mkysel requested a review from fbac February 18, 2025 16:05
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1972ae5 and c7d87a4.

📒 Files selected for processing (1)
  • contracts/dev/generate (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: abis
  • GitHub Check: Test (Node)
  • GitHub Check: Build pre-baked anvil-xmtpd

@@ -37,7 +37,7 @@ function generate_bindings() {
fi

# Generate Go bindings
if ! abigen --abi "${build_artifact}.abi.json" \
if ! go tool --modfile=../tools/go.mod abigen --abi "${build_artifact}.abi.json" \
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

⚠️ Potential issue

🧩 Analysis chain

Fix the command structure and verify the module file path.

The current command structure has two issues:

  1. The --modfile flag is incorrectly placed. It should be passed to abigen, not to go tool.
  2. The module file path might be incorrect when executed from the repository root.

Apply this diff to fix the command structure:

-    if ! go tool --modfile=../tools/go.mod abigen --abi "${build_artifact}.abi.json" \
+    if ! go tool abigen --modfile=tools/go.mod --abi "${build_artifact}.abi.json" \

Let's verify the module file exists at the expected location:


🏁 Script executed:

#!/bin/bash
# Description: Verify the existence and location of the go.mod file for tools

# Test 1: Check if tools/go.mod exists
if [ -f "tools/go.mod" ]; then
    echo "✓ tools/go.mod exists"
    # Show the module name and Go version
    head -n 5 tools/go.mod
else
    echo "✗ tools/go.mod not found"
    # Try to find it elsewhere
    find . -name "go.mod" -type f -exec sh -c 'echo "Found go.mod at: {}"; head -n 5 {}' \;
fi

Length of output: 173


Review Update: Adjust Command Structure and Validate go.mod File Location

  • The command should pass the --modfile flag directly to abigen (i.e. after go tool abigen).
  • Our verification indicates that the expected module file at tools/go.mod was not found in the repository. Please confirm whether the path should be different or if the file needs to be added.

Apply this diff as a starting point, ensuring you update the module file path if needed:

-    if ! go tool --modfile=../tools/go.mod abigen --abi "${build_artifact}.abi.json" \
+    if ! go tool abigen --modfile=tools/go.mod --abi "${build_artifact}.abi.json" \
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if ! go tool --modfile=../tools/go.mod abigen --abi "${build_artifact}.abi.json" \
if ! go tool abigen --modfile=tools/go.mod --abi "${build_artifact}.abi.json" \

@mkysel mkysel merged commit 5bc532b into main Feb 18, 2025
14 checks passed
@mkysel mkysel deleted the mkysel/migrate-go branch February 18, 2025 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update to go 1.24 and use go tools
3 participants