Skip to content

ci: get github ci to build arm64 linux deb and rpm release packages #7858

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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

nissimk
Copy link

@nissimk nissimk commented Apr 29, 2025

This is the first attempt to get GitHub ci to build release packages for Arm64 Linux. I tested the script on my Raspberry pi but I have not tested the .yml file changes. Please let me know if there are errors when trying to run the workflow in GitHub and I can fix them here.

addresses #7850

A couple of things to note:

  1. I skip the AppImage build on Arm64 because the appImage repo seems to only have builds for amd64 architecture. I left in the alien call to convert the .Deb to an rpm, but I have not tested that.

  2. when developing on arm architecture you get errors when trying to commit because the dev environment script downloads the amd64 binary of go-gitlint and puts it in the .githooks folder. I was able to solve this by building go-gitlint from source, but in case the ci does any git commits it's going to need to do this also when running on an Arm64 runner.

Summary by Sourcery

Add Arm64 Linux builds to the release CI workflow.

Build:

  • Update the DEB package build script to accept an architecture argument (amd64 or arm64).
  • Modify the DEB control file generation to correctly specify the package architecture.

CI:

  • Introduce GitHub Actions workflow jobs to build Linux release packages (.deb, .rpm, .tar.gz) for the Arm64 architecture.
  • Parameterize Linux release package names in the CI workflow to include the architecture.
  • Skip AppImage package generation for Arm64 builds due to tooling limitations.
  • Update the OS runner for Arm64 builds to ubuntu-22.04-arm.
  • Specify a dedicated Flutter profile for Arm64 Linux builds (production-linux-arm64).

Copy link
Contributor

sourcery-ai bot commented Apr 29, 2025

Reviewer's Guide by Sourcery

This pull request modifies the GitHub Actions release workflow and the Debian package build script to enable building Arm64 Linux deb and rpm packages.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Add an Arm64 job to the release workflow matrix.
  • Added a new job configuration for arm64 architecture.
  • Specified the target triple as arm64-unknown-linux-gnu.
  • Set the runner OS to ubuntu-22.04-arm.
  • Defined the Flutter profile as production-linux-arm64.
.github/workflows/release.yml
Update artifact naming conventions in the release workflow to include architecture.
  • Modified variables for zip, deb, rpm, and AppImage names to include the architecture (${{ matrix.job.arch }}).
.github/workflows/release.yml
Conditionally skip the AppImage build and upload steps for Arm64 architecture.
  • Added an if condition to the 'Build Linux package (.AppImage)' step.
  • Added an if condition to the 'Upload AppImage package' step.
.github/workflows/release.yml
Modify the Debian package build script to accept architecture as an argument and update the control file.
  • Added a new input parameter for the architecture.
  • Added validation for the provided architecture (only amd64 and arm64 supported).
  • Used sed to replace the alternative architecture string with the specified architecture in the DEBIAN/control file.
frontend/scripts/linux_distribution/deb/build_deb.sh

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@CLAassistant
Copy link

CLAassistant commented Apr 29, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @nissimk - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider standardizing the package naming convention; the added architecture seems to use a double hyphen (--${{ matrix.job.arch }}) instead of a single one (e.g., -linux-${{ matrix.job.arch }}).
  • The build_deb.sh script could be made more robust by using a dedicated placeholder like [ARCHITECTURE] in the DEBIAN/control template file instead of replacing the alternative architecture string.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@LucasXu0
Copy link
Collaborator

LucasXu0 commented May 5, 2025

Hi @nissimk, could you add ARM64 support to the flutter_ci.yaml, except for the release.yml?

@nissimk nissimk force-pushed the build_arm64 branch 2 times, most recently from c9ec4c6 to c775178 Compare May 13, 2025 19:02
@nissimk
Copy link
Author

nissimk commented May 17, 2025

So this still is not building...I figured out how to run the actions in my fork, so I've been testing there: nissimk#2

The first issue was that the flutter-action was not working for aarch64. There's an issue here: subosito/flutter-action#345 with a workaround to use master instead of stable for the channel. I was trying to do that for just aarch64 but I couldn't figure that out so I just changed the channel to master for all architectures. Not sure what impact this has.

The next issue that I haven't been able to get around is the install-action for cargo-make fails to find the installer for cargo-make on aarch64. I'm not sure how to work around this one without changing the action to manually installing the appropriate version of cargo-make or contributing to the install-action upstream repo.

Do you have any suggestions of how to proceed?

@LucasXu0
Copy link
Collaborator

I have tried to set up Flutter on arm64 in GitHub Actions, but neither of my attempts worked.

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.

3 participants