Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ concurrency:
cancel-in-progress: true

jobs:
build:
name: 🧪 Build snap
strategy:
matrix:
os: [ubuntu-latest, ubuntu-24.04-arm]
runs-on: ${{ matrix.os }}
build-and-test:
name: 🧪 Build and test snap
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@copilot this won't work because it's cross-compiling.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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.

runs-on: ubuntu-24.04-arm
steps:
- name: 🧪 Build snap
uses: snapcrafters/ci/test-snap-build@main
- name: 🗒️ Run tests
uses: snapcrafters/ci/run-tests@main
with:
issue-number: ${{ github.event.pull_request.number }}
github-token: ${{ secrets.GITHUB_TOKEN }}
test-script: ./test.sh
56 changes: 56 additions & 0 deletions .github/workflows/release-to-candidate-armhf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Release (armhf)

on:
# Run the workflow each time new commits are pushed to the candidate-armhf branch.
push:
branches: [ "candidate-armhf" ]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read
issues: write

jobs:
release:
name: 🚢 Release armhf to latest/candidate
runs-on: ubuntu-latest
environment: "Candidate Branch"
steps:
- name: 🚢 Release to latest/candidate
uses: snapcrafters/ci/release-to-candidate@main
with:
architecture: armhf
launchpad-token: ${{ secrets.LP_BUILD_SECRET }}
repo-token: ${{ secrets.SNAPCRAFTERS_BOT_COMMIT }}
store-token: ${{ secrets.SNAP_STORE_CANDIDATE }}

call-for-testing:
name: 📣 Create call for testing
needs: release
environment: "Candidate Branch"
runs-on: ubuntu-latest
outputs:
issue-number: ${{ steps.issue.outputs.issue-number }}
steps:
- name: 📣 Create call for testing
id: issue
uses: snapcrafters/ci/call-for-testing@main
with:
architectures: armhf
github-token: ${{ secrets.GITHUB_TOKEN }}

test:
name: 🗒️ Test snap on armhf
needs: call-for-testing
runs-on: ubuntu-24.04-arm
steps:
- name: 🗒️ Run tests
uses: snapcrafters/ci/run-tests@main
with:
issue-number: ${{ needs.call-for-testing.outputs.issue-number }}
github-token: ${{ secrets.GITHUB_TOKEN }}
test-script: ./test.sh
32 changes: 32 additions & 0 deletions .github/workflows/sync-to-armhf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Sync to armhf branch

on:
push:
branches:
- candidate
workflow_dispatch:
workflow_call:

permissions:
issues: write
contents: write

jobs:
sync-armhf:
name: 🔄 Sync candidate branch to candidate-armhf
runs-on: ubuntu-latest
steps:
- name: Checkout the source
uses: actions/checkout@v4
with:
token: ${{ secrets.SNAPCRAFTERS_BOT_COMMIT }}
fetch-depth: 0
ref: candidate-armhf
- name: Merge from candidate
run: |
git pull
git config --global user.name "Snapcrafters Bot"
git config --global user.email "bot@snapcrafters.org"

git merge origin/candidate -m 'chore: merge candidate to candidate-armhf'
git push
48 changes: 32 additions & 16 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,19 @@ issues:
source-code: https://github.com/astral-sh/ruff
website: https://github.com/astral-sh/ruff

package-repositories:
- type: apt
architectures: [$CRAFT_ARCH_BUILD_FOR]
formats: [deb, deb-src]
components: [main]
suites: [noble, noble-updates, noble-backports]
key-id: F6ECB3762474EDA9D21B7022871920D1991BC93C
url: http://ports.ubuntu.com/ubuntu-ports

platforms:
amd64:
arm64:
# Disabled until we can fix https://github.com/snapcrafters/ruff/issues/117
# armhf:
ppc64el:
riscv64:
s390x:
armhf:
build-on: [arm64, amd64]
build-for: [armhf]

parts:
ruff:
Expand All @@ -49,15 +54,26 @@ parts:
source-tag: $SNAPCRAFT_PROJECT_VERSION
source-depth: 1
build-environment:
# See: https://github.com/lengau/uv-snap/issues/10
- to arm64:
- JEMALLOC_SYS_WITH_LG_PAGE: 16
- to ppc64el:
- JEMALLOC_SYS_WITH_LG_PAGE: 16
stage:
- bin/ruff
organize:
ruff: bin/ruff
# Build a static binary. Needed for armhf because of https://github.com/canonical/snapcraft/issues/5836
- CARGO_BUILD_TARGET: armv7-unknown-linux-musleabihf
- CARGO_TARGET_ARMV7_UNKNOWN_LINUX_MUSLEABIHF_LINKER: rust-lld
- CARGO_CFG_TARGET_FEATURE: crt-static
- CC: clang-20
- CARGO_PROFILE_RELEASE_LTO: "off"
build-packages:
- libclang-20-dev
- cmake
- gcc-arm-linux-gnueabihf
- libc6-dev-armhf-cross
# Use clang for the armhf build so we can build for musl.
- clang-20
- musl-dev
- musl-tools
override-build: |
rustup target add ${CARGO_BUILD_TARGET}
craftctl default
# manually install the ruff binary as its target dir differs
install -Dvm755 ./target/${CARGO_BUILD_TARGET}/release/ruff "${CRAFT_PART_INSTALL}/bin/ruff"

apps:
ruff:
Expand Down
Loading