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

Update goreleaser to release statically linked binary #2560

Closed
wants to merge 4 commits into from

Conversation

kaustubhkapatral
Copy link

@kaustubhkapatral kaustubhkapatral commented Jun 24, 2024

Description

closes: #2559


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • added appropriate labels to the PR
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

Summary by CodeRabbit

  • Chores
    • Updated workflow configuration for more efficient build and release processes.
    • Improved build setup with additional hooks and environment settings to ensure compatibility and performance.

@kaustubhkapatral kaustubhkapatral requested a review from a team as a code owner June 24, 2024 10:51
Copy link
Contributor

coderabbitai bot commented Jun 24, 2024

Walkthrough

The recent changes focus on two primary areas: updating the GitHub Actions workflow for releasing Umee and modifications to the .goreleaser.yml file. The former includes adjustments to versioning and arguments for the GoReleaser actions, while the latter adds hooks, build flags, ldflags parameters, and environment variable settings to facilitate the release of statically linked binaries.

Changes

File Summary of Changes
.github/workflows/release-umee.yml Updated goreleaser/goreleaser-action from v6 to v5. Modified args in test-build and release steps.
.goreleaser.yml Added a hook to download libwasmvm_muslc.x86_64.a, included muslc in build flags, and set CC environment variable.

Sequence Diagram(s)

sequenceDiagram
    participant DevOps as Developer/Operator
    participant GitHub as GitHub Actions
    participant GoReleaser as GoReleaser
    participant System as Build System

    DevOps->>GitHub: Push new tag
    GitHub->>GoReleaser: Execute release process
    GoReleaser->>System: Setup environment
    System->>GoReleaser: Download libwasmvm_muslc.x86_64.a
    GoReleaser->>System: Build with muslc flags and CC environment variable
    GoReleaser->>GitHub: Release statically linked binary
    GitHub->>DevOps: Notify release completion
Loading

Assessment against linked issues

Objective (Issue #) Addressed Explanation
Update goreleaser to build and release statically linked binary (#2559)
Ensure no libwasmvm prerequisite setup for released binaries (#2559)

Poem

In the code where binaries beam,
To realms of staticness we stream,
No more libwasm chase,
On any host, replace,
With muslc and ldflags, a dream.


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 5408f2d and 65f6734.

Files selected for processing (2)
  • .github/workflows/release-umee.yml (1 hunks)
  • .goreleaser.yml (2 hunks)
Additional comments not posted (6)
.goreleaser.yml (3)

9-9: Good addition of pre-build hook.

Adding a hook to download libwasmvm_muslc.x86_64.a ensures that the necessary library is available for static linking, directly supporting the PR's goal of creating a statically linked binary.


18-18: Correct update to build flags.

Including muslc in the build flags is crucial for static linking with musl libc, which is aligned with the PR's objective of simplifying binary deployment.


21-23: Enhanced linking and environment configuration.

The updates to ldflags and the setting of the CC environment variable to x86_64-linux-gnu-gcc are well-thought-out changes that enhance the build process and ensure the binary's compatibility and independence from dynamic libraries.

.github/workflows/release-umee.yml (3)

31-33: Proper setting of environment variables.

Setting the COSMWASM_VERSION environment variable is necessary to ensure that the correct version of the wasmvm library is used, which is crucial for the statically linked binary creation.


43-47: Updated goreleaser action configuration enhances build reliability.

Downgrading to goreleaser-action@v5 and including --clean in the arguments ensures a clean state for each build, which is crucial for avoiding issues with residual files from previous builds.


51-59: Well-configured release step.

The changes to use goreleaser-action@v5 and the inclusion of --clean along with updated release notes handling are well-thought-out adjustments that enhance the release process's reliability and documentation.

Comment on lines -38 to +43
uses: goreleaser/goreleaser-action@v6
uses: goreleaser/goreleaser-action@v5
Copy link
Author

Choose a reason for hiding this comment

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

I had to downgrade the goreleaser version because of this bug. Logs of the failed run using the latest version with the same bug can be found on my fork here

@@ -14,10 +15,12 @@ builds:
binary: umeed
mod_timestamp: "{{ .CommitTimestamp }}"
flags:
- -tags=badgerdb ledger netgo
- -tags=badgerdb ledger netgo muslc
Copy link
Member

Choose a reason for hiding this comment

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

Why adding muslc? We release glibc compatible binaires.

Copy link
Author

Choose a reason for hiding this comment

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

According to this comment it's not possible to build a statically linked binary for glibc systems. Using muslc seems to be the only way to create statically linked deterministic binaries.

Copy link

stale bot commented Jul 27, 2024

This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the S:Stale label Jul 27, 2024
@stale stale bot closed this Aug 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update goreleaser to release statically linked binary
3 participants