Add armhf cross-compilation support via candidate-armhf branch#119
Conversation
Co-authored-by: lengau <4305943+lengau@users.noreply.github.com>
Co-authored-by: lengau <4305943+lengau@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR configures the ruff snap for armhf cross-compilation to resolve out-of-memory build failures on armhf architecture. The solution builds armhf binaries on arm64/amd64 machines with more available memory, using a static musl binary approach proven in the uv snap.
Key changes:
- Configured armhf-only platform with cross-compilation from arm64/amd64 build hosts
- Added Ubuntu ARM ports repository and cross-compilation toolchain packages
- Implemented static musl binary build using armv7-unknown-linux-musleabihf target with custom override-build script
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot fix the build issue from https://github.com/snapcrafters/ruff/actions/runs/19030236464/job/54342989050?pr=119 |
…ion path Co-authored-by: lengau <4305943+lengau@users.noreply.github.com>
Fixed in cf7f88d. The build was failing because:
The changes now match the working uv-snap approach more closely. |
|
@copilot snap/snapcraft.yaml:35 should be using the target architecture, not the build host architecture |
Co-authored-by: lengau <4305943+lengau@users.noreply.github.com>
Corrected in 51601f1. Changed back to |
|
@copilot this should:
|
Co-authored-by: lengau <4305943+lengau@users.noreply.github.com>
Added CI workflows for candidate-armhf in 3fa051d:
However, I cannot change the PR base branch from |
|
@copilot Add a step to the PR workflow that runs the tests |
Co-authored-by: lengau <4305943+lengau@users.noreply.github.com>
Co-authored-by: lengau <4305943+lengau@users.noreply.github.com>
|
@copilot on this branch we should only build on arm, not on amd64 |
Co-authored-by: lengau <4305943+lengau@users.noreply.github.com>
|
@copilot merge the pull-request and pull-request-armhf workflows |
Co-authored-by: lengau <4305943+lengau@users.noreply.github.com>
|
@copilot why isn't it getting the PR number? |
Co-authored-by: lengau <4305943+lengau@users.noreply.github.com>
.github/workflows/pull-request.yaml
Outdated
| os: [ubuntu-latest, ubuntu-24.04-arm] | ||
| runs-on: ${{ matrix.os }} | ||
| build-and-test: | ||
| name: 🧪 Build and test snap |
There was a problem hiding this comment.
@copilot this won't work because it's cross-compiling.
There was a problem hiding this comment.
Fixed in 0079328. Removed the test step from the PR workflow since cross-compiled armhf binaries cannot run on the arm64 build runner. The workflow now only builds the snap to validate compilation. Testing will occur in the release workflow where the snap can be tested on actual armhf hardware.
Co-authored-by: lengau <4305943+lengau@users.noreply.github.com>
Summary: candidate-armhf branch for cross-compilation
This PR implements the changes needed for a candidate-armhf branch that enables cross-compilation for armhf architecture on arm64 build machines. The implementation follows the same approach used in the uv snap at https://github.com/lengau/uv-snap/.
Completed Tasks
Key Configuration Changes
How This Solves the Memory Issue
The original issue (#117) was that building armhf natively ran out of memory. This solution:
enable-patchelfbuild-attribute usesldfor the build-on host, not the build-for host canonical/snapcraft#5836)Branch Management
candidatebranch. The base branch should be changed tocandidate-armhfthrough the GitHub UI. Once merged tocandidate-armhf, the sync-to-armhf workflow will keep it synchronized with updates from the maincandidatebranch.Latest Changes
Removed the test step from the PR workflow since we're cross-compiling armhf binaries on arm64 runners. The armhf binaries cannot be tested on arm64. Testing will occur in the release workflow after the snap is published to the store, where it can be installed and tested on actual armhf hardware.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.