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

Fix `.goreleaser.yaml and Makefile targets #8869

Merged
merged 1 commit into from
Dec 5, 2024
Merged

Conversation

niccoloraspa
Copy link
Member

What is the purpose of the change

This PR:

  • Removes darwin builds from the .goreleaser.yaml as we are no longer publishing them
  • Updated linux-amd64 and linux-arm64 builds to fetch libwasmvm in specific paths
  • Remove deprecated --skip-publish and --skip-validate

Testing and Verifying

I have tested the build locally on an Ubuntu machine, and it is working. However, it is not working on my ARM MacBook.

I encounter the following warnings during the build process:

_/GOROOT/src/plugin/plugin_dlopen.go:19: warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
library/std/src/sys/pal/unix/os.rs:732: warning: Using 'getpwuid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
library/std/src/sys_common/net.rs:207: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking cmd=[go build -mod=readonly -trimpath -tags=netgo,ledger,muslc,osusergo -ldflags=-X github.com/cosmos/cosmos-sdk/version.Name=osmosis -X github.com/cosmos/cosmos-sdk/version.AppName=osmosisd -X github.com/cosmos/cosmos-sdk/version.Version=28.0.0-rc1-SNAPSHOT-fed374b1c -X github.com/cosmos/cosmos-sdk/version.Commit=fed374b1c87228496a0f47798ddbaed97c769f46 -X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger,muslc,osusergo -w -s -linkmode=external -extldflags '-L/usr/lib -lwasmvm_muslc.aarch64 -Wl,-z,muldefs -static -lm' -o /go/src/osmosisd/dist/osmosisd-linux-arm64_linux_arm64/osmosisd ./cmd/osmosisd]
    • # github.com/osmosis-labs/osmosis/v28/cmd/osmosisd
/usr/bin/ld: /tmp/go-link-2404304271/000008.o: in function `pluginOpen':
/_/GOROOT/src/plugin/plugin_dlopen.go:19: warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: /usr/lib/libwasmvm_muslc.x86_64.a(std-742797dd06d019e7.std.e4c3ebae17ee837d-cgu.0.rcgu.o): in function `std::sys::pal::unix::os::home_dir::fallback':
/rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/std/src/sys/pal/unix/os.rs:732: warning: Using 'getpwuid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking 
...

To address these warnings, we would need to use musl libraries instead of glib. However, the musl-gcc compiler is not available in the goreleaser-cross container.

Documentation and Release Note

  • Does this pull request introduce a new feature or user-facing behavior changes?
  • Changelog entry added to Unreleased section of CHANGELOG.md?

Where is the change documented?

  • Specification (x/{module}/README.md)
  • Osmosis documentation site
  • Code comments?
  • N/A

@niccoloraspa niccoloraspa added V:state/compatible/backport State machine compatible PR, should be backported A:no-changelog A:backport/v28.x backport patches to v28.x branch labels Dec 5, 2024
@niccoloraspa niccoloraspa requested review from PaddyMc and a team December 5, 2024 14:20
Copy link
Contributor

coderabbitai bot commented Dec 5, 2024

Walkthrough

The changes in this pull request involve modifications to the release.mk makefile, specifically updating the syntax for the release-dry-run and release-snapshot targets. The release-dry-run target's option for skipping publishing has been changed from --skip-publish to --skip=publish. Additionally, the release-snapshot target has consolidated its options for skipping validation and publishing into a single option, changing from --skip-validate --skip-publish to --skip=publish,validate. These alterations affect how options are specified in Docker run commands during the release process.

Changes

File Path Change Summary
scripts/makefiles/release.mk Updated release-dry-run to use --skip=publish and consolidated release-snapshot options to --skip=publish,validate.

Possibly related PRs

Suggested labels

T:build

Suggested reviewers

  • PaddyMc
  • pablin-10

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 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
Contributor

@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

🧹 Outside diff range and nitpick comments (1)
scripts/makefiles/release.mk (1)

40-40: LGTM! Consider documenting the skip options.

The consolidation of skip flags into --skip=publish,validate is correct and follows modern goreleaser syntax.

Consider adding a comment above the release targets to document the available skip options for better maintainability:

+# Available skip options:
+# - publish: Skip publishing artifacts
+# - validate: Skip validation steps
 release-dry-run:
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 765f2b6 and f8e19b5.

⛔ Files ignored due to path filters (1)
  • .goreleaser.yaml is excluded by !**/*.yaml
📒 Files selected for processing (1)
  • scripts/makefiles/release.mk (2 hunks)
🔇 Additional comments (2)
scripts/makefiles/release.mk (2)

Line range hint 1-40: Verify related configuration changes.

The PR objectives mention removing Darwin builds and updating libwasmvm paths, but these changes aren't visible in the Makefile.

Let's verify the related changes:

✅ Verification successful

Let me gather more context about the PR changes by examining the .goreleaser.yaml file content:


Darwin builds have been removed and libwasmvm paths are correctly configured

The .goreleaser.yaml file confirms:

  • Darwin/macOS builds are completely removed - only Linux builds for amd64 and arm64 are configured
  • libwasmvm paths are correctly set up with architecture-specific paths:
    • x86_64: /usr/lib/libwasmvm_muslc.x86_64.a
    • aarch64: /usr/lib/libwasmvm_muslc.aarch64.a
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for the mentioned changes in .goreleaser.yaml

# Check for Darwin/macOS related configurations
echo "Checking for Darwin/macOS configurations:"
rg -i "darwin|macos" .goreleaser.yaml || echo "No Darwin/macOS configurations found"

# Check for libwasmvm path configurations
echo -e "\nChecking for libwasmvm configurations:"
rg -i "libwasmvm" .goreleaser.yaml || echo "No libwasmvm configurations found"

Length of output: 661


Script:

#!/bin/bash
# Get the full content of .goreleaser.yaml to understand the build configurations
cat .goreleaser.yaml

Length of output: 4726


27-27: LGTM! Verify goreleaser flag compatibility.

The updated syntax for skipping publish is correct for newer versions of goreleaser.

Let's verify the flag compatibility with the used goreleaser version:

✅ Verification successful

The updated skip flag syntax is correct and consistent

The changes to use --skip=publish and --skip=publish,validate are correct and consistent throughout the Makefile. The new syntax:

  • Is used consistently in both release targets (dry-run and snapshot)
  • No instances of the old --skip-publish or --skip-validate syntax remain
  • Follows the comma-separated format for multiple skip values

The goreleaser image version is dynamically set using the Go version (v$(GO_VERSION)), which is a common practice, and the new skip flag syntax is compatible with recent goreleaser versions.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check goreleaser documentation and version compatibility
# Extract goreleaser version from the image tag
version=$(rg -o 'GORELEASER_IMAGE := ghcr.io/goreleaser/goreleaser-cross:v([0-9.]+)' -r '$1' scripts/makefiles/release.mk)
echo "Goreleaser version: $version"

# Check if there are any other instances of old flag syntax that need updating
rg --type make "(-{2}skip-publish|-{2}skip-validate)"

Length of output: 232


Script:

#!/bin/bash
# Let's try a different approach to find the goreleaser image and version
rg "GORELEASER" scripts/makefiles/release.mk -A 2

# Also check for any remaining old-style skip flags in the entire codebase
rg "skip-[a-z]+" --type make

# Let's also see the content of the release.mk to understand the context better
cat scripts/makefiles/release.mk

Length of output: 1572

Copy link
Contributor

@alessandrolomanto alessandrolomanto left a comment

Choose a reason for hiding this comment

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

LGTM!

@niccoloraspa niccoloraspa merged commit 1a181bf into main Dec 5, 2024
1 check passed
@niccoloraspa niccoloraspa deleted the fix/goreleaser branch December 5, 2024 14:31
mergify bot pushed a commit that referenced this pull request Dec 5, 2024
niccoloraspa added a commit that referenced this pull request Dec 5, 2024
(cherry picked from commit 1a181bf)

Co-authored-by: Niccolo Raspa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:backport/v28.x backport patches to v28.x branch A:no-changelog V:state/compatible/backport State machine compatible PR, should be backported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants