From 4a694e6e4293f7cc270f0a70a2c84fa86d3b6e80 Mon Sep 17 00:00:00 2001 From: Tiago Nobrega Date: Wed, 2 Aug 2023 19:09:49 -0300 Subject: [PATCH] dependencies: bump craft-archives Also add a spread test that ensures we can fetch foreign architecture packages, and their dependencies, correctly. --- requirements-devel.txt | 3 +- requirements.txt | 3 +- .../core22/package-repo-archs/armhf.yaml | 38 ++++++++++++++++++ .../core22/package-repo-archs/i386.yaml | 39 +++++++++++++++++++ .../core22/package-repo-archs/task.yaml | 19 +++++++++ 5 files changed, 100 insertions(+), 2 deletions(-) create mode 100644 tests/spread/core22/package-repo-archs/armhf.yaml create mode 100644 tests/spread/core22/package-repo-archs/i386.yaml create mode 100644 tests/spread/core22/package-repo-archs/task.yaml diff --git a/requirements-devel.txt b/requirements-devel.txt index 5e78ee1d644..cfe0859396d 100644 --- a/requirements-devel.txt +++ b/requirements-devel.txt @@ -11,7 +11,8 @@ click==8.1.3 codespell==2.2.4 colorama==0.4.6 coverage==7.2.5 -craft-archives==1.1.2 +#craft-archives==1.1.2 +git+https://github.com/canonical/craft-archives.git@CRAFT-1926-source-architectures#egg=craft_archives craft-cli==1.2.0 craft-grammar==1.1.1 craft-parts==1.19.6 diff --git a/requirements.txt b/requirements.txt index 66627af67f8..d409da272d7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,7 +5,8 @@ cffi==1.15.1 chardet==5.1.0 charset-normalizer==3.1.0 click==8.1.3 -craft-archives==1.1.2 +#craft-archives==1.1.2 +git+https://github.com/canonical/craft-archives.git@CRAFT-1926-source-architectures#egg=craft_archives craft-cli==1.2.0 craft-grammar==1.1.1 craft-parts==1.19.6 diff --git a/tests/spread/core22/package-repo-archs/armhf.yaml b/tests/spread/core22/package-repo-archs/armhf.yaml new file mode 100644 index 00000000000..30ace53fcdd --- /dev/null +++ b/tests/spread/core22/package-repo-archs/armhf.yaml @@ -0,0 +1,38 @@ +name: test-archs +version: '1.0' +summary: test package repos with different architectures +description: test package repos with different architectures +grade: stable +confinement: strict +base: core22 +architectures: + - build-on: amd64 + +package-repositories: + # The repo that contains libpython3.11-minimal:armhf + - type: apt + formats: [deb] + architectures: [armhf] + components: [main] + suites: [jammy] + key-id: F23C5A6CF475977595C89F51BA6932366A755776 + url: https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu + # Also add the armhf arch for the "ports" repo, to fetch python's deps + - type: apt + architectures: [ armhf ] + components: [ main ] + suites: [ jammy, jammy-security, jammy-updates ] + key-id: F6ECB3762474EDA9D21B7022871920D1991BC93C + url: http://ports.ubuntu.com/ubuntu-ports + + +parts: + mypart: + plugin: nil + build-packages: + - file + stage-packages: + - libpython3.11-minimal:armhf + override-build: | + file ${CRAFT_PART_INSTALL}/usr/lib/arm-linux-gnueabihf/libssl.so.3 | grep "ARM" + craftctl default diff --git a/tests/spread/core22/package-repo-archs/i386.yaml b/tests/spread/core22/package-repo-archs/i386.yaml new file mode 100644 index 00000000000..6b2925e74d6 --- /dev/null +++ b/tests/spread/core22/package-repo-archs/i386.yaml @@ -0,0 +1,39 @@ +name: test-archs +version: '1.0' +summary: test package repos with different architectures +description: test package repos with different architectures +grade: stable +confinement: strict +base: core22 +architectures: + - build-on: amd64 + +package-repositories: + # The repo that contains libpython3.11-minimal:i386 + - type: apt + formats: [deb] + architectures: [i386] + components: [main] + suites: [jammy] + key-id: F23C5A6CF475977595C89F51BA6932366A755776 + url: https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu + # Also add the i386 arch for the official archives, to fetch python's deps + - type: apt + architectures: [i386] + key-id: F6ECB3762474EDA9D21B7022871920D1991BC93C + key-server: keyserver.ubuntu.com + formats: [deb] + components: [main] + suites: [jammy] + url: https://archive.ubuntu.com/ubuntu + +parts: + mypart: + plugin: nil + build-packages: + - file + stage-packages: + - libpython3.11-minimal:i386 + override-build: | + file ${CRAFT_PART_INSTALL}/usr/lib/i386-linux-gnu/libssl.so.3 | grep "ELF 32-bit" + craftctl default diff --git a/tests/spread/core22/package-repo-archs/task.yaml b/tests/spread/core22/package-repo-archs/task.yaml new file mode 100644 index 00000000000..766587e9db7 --- /dev/null +++ b/tests/spread/core22/package-repo-archs/task.yaml @@ -0,0 +1,19 @@ +summary: Test using package-repositories with different architectures on core22 + +environment: + SNAP_ARCH/i386: i386 + SNAP_ARCH/armhf: armhf + SNAPCRAFT_BUILD_ENVIRONMENT: "" + +restore: | + snapcraft clean + +execute: | + # The task works by copying one of the arch-specific yaml files as + # "snapcraft.yaml", and then building it. + rm -rf snap/ + mkdir snap + cp "$SNAP_ARCH".yaml snap/snapcraft.yaml + + # The part's build script does the checking. + snapcraft build --verbose --use-lxd