From 0f9ff9631cfae570ba83122fe8653f43f7a609dc Mon Sep 17 00:00:00 2001 From: Felipe Reyes Date: Wed, 13 Nov 2024 08:06:21 -0800 Subject: [PATCH 1/3] snap: Add rust to build-packages (#682) * snap: Add rust to build-packages When building the snap on s390x some Python modules need to compile their extensions (rust based), this is not needed on amd64 since pypi has compiled packages available. This change add rustc, cargo and pkg-config to the list of build-packages in the snapcraft.yaml definition. * Migrate gh action actions/upload-artifact@v4 * Migration gh action actions/download-artifact@v4 The backport was adjusted to use build-snap.yml workflow instead of test.yml (cherry picked from commit b8747e01d3bcbc50504c6cf5e553843e13ae9f94) --- .github/workflows/build-snap.yml | 5 ++--- snap/snapcraft.yaml | 7 +++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-snap.yml b/.github/workflows/build-snap.yml index 3b841a04..e04cb40c 100644 --- a/.github/workflows/build-snap.yml +++ b/.github/workflows/build-snap.yml @@ -5,8 +5,7 @@ name: Build Snap # Controls when the action will run. Triggers the workflow on push or pull request # events but only for the master branch on: - pull_request: - branches: [ master ] + pull_request # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -20,7 +19,7 @@ jobs: - uses: actions/checkout@v2 - uses: snapcore/action-build@v1 id: snapcraft - - uses: actions/upload-artifact@v1 + - uses: actions/upload-artifact@v4 with: name: charm.snap path: ${{ steps.snapcraft.outputs.snap }} diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 6fb4ef87..9672345e 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -37,6 +37,13 @@ parts: source: . plugin: python python-version: python3 + build-packages: + - libffi-dev + - libpython3.10-dev + - python3-pip + - rustc + - cargo + - pkg-config stage-packages: - git-core - libssl-dev From 9e13846193c54a12a08791a62311a39951023909 Mon Sep 17 00:00:00 2001 From: Felipe Reyes Date: Wed, 13 Nov 2024 13:26:22 -0300 Subject: [PATCH 2/3] Use libpython3.6-dev The 2.8 branch uses core18 to build the snap on, python 3.10 is not available, python 3.6 is the version available in Ubuntu 18.04 (Xenial) --- snap/snapcraft.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 9672345e..6fc72a27 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -39,7 +39,7 @@ parts: python-version: python3 build-packages: - libffi-dev - - libpython3.10-dev + - libpython3.6-dev - python3-pip - rustc - cargo From 60dd304d11b5de6ab0318ce610e02a39ba70467d Mon Sep 17 00:00:00 2001 From: Felipe Reyes Date: Wed, 13 Nov 2024 13:32:05 -0300 Subject: [PATCH 3/3] Use '7.x' snapcraft channel snapcraft-7.x is the last release with core18 support --- .github/workflows/build-snap.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-snap.yml b/.github/workflows/build-snap.yml index e04cb40c..bc944d74 100644 --- a/.github/workflows/build-snap.yml +++ b/.github/workflows/build-snap.yml @@ -19,6 +19,8 @@ jobs: - uses: actions/checkout@v2 - uses: snapcore/action-build@v1 id: snapcraft + with: + snapcraft-channel: "7.x" - uses: actions/upload-artifact@v4 with: name: charm.snap