From febe54a9366ee08d1505801c0cb8fbfd58be9cc2 Mon Sep 17 00:00:00 2001 From: Callahan Date: Wed, 1 May 2024 07:38:22 -0500 Subject: [PATCH 1/3] tests(spread): drop check for specific files in ppa tests (#4772) The source package has changed and the test isn't particularly important. Signed-off-by: Callahan Kovacs --- .../package-repositories/test-multi-keys/snap/snapcraft.yaml | 4 ---- .../package-repositories/test-multi-keys/snap/snapcraft.yaml | 4 ---- 2 files changed, 8 deletions(-) diff --git a/tests/spread/core22/package-repositories/test-multi-keys/snap/snapcraft.yaml b/tests/spread/core22/package-repositories/test-multi-keys/snap/snapcraft.yaml index 19fe27377d..b5035779e3 100644 --- a/tests/spread/core22/package-repositories/test-multi-keys/snap/snapcraft.yaml +++ b/tests/spread/core22/package-repositories/test-multi-keys/snap/snapcraft.yaml @@ -14,10 +14,6 @@ parts: stage-packages: - test-ppa - puppet-tools-release # Comes from the Puppet repo - override-build: | - craftctl default - # This file comes from the puppet-tools-release package. - test -f ${CRAFT_PART_INSTALL}/usr/share/doc/puppet-tools-release/bill-of-materials apps: test-ppa: diff --git a/tests/spread/core24/package-repositories/test-multi-keys/snap/snapcraft.yaml b/tests/spread/core24/package-repositories/test-multi-keys/snap/snapcraft.yaml index 6bd0363b7c..661dda867e 100644 --- a/tests/spread/core24/package-repositories/test-multi-keys/snap/snapcraft.yaml +++ b/tests/spread/core24/package-repositories/test-multi-keys/snap/snapcraft.yaml @@ -14,10 +14,6 @@ parts: stage-packages: - test-ppa - puppet-tools-release # Comes from the Puppet repo - override-build: | - craftctl default - # This file comes from the puppet-tools-release package. - test -f ${CRAFT_PART_INSTALL}/usr/share/doc/puppet-tools-release/bill-of-materials apps: test-multi-keys: From 3e3428ec17cdc9589ac033fd0870500d4ccf19ac Mon Sep 17 00:00:00 2001 From: Callahan Date: Wed, 1 May 2024 14:42:04 -0500 Subject: [PATCH 2/3] build(deps): bump craft-application to 2.6.3 (#4779) Bump craft-application, enable gnome test, and add a regression test for BUILD_ON vars. Signed-off-by: Callahan Kovacs --- docs/requirements.txt | 2 +- requirements-devel.txt | 2 +- requirements.txt | 2 +- .../snaps/test-variables/snap/snapcraft.yaml | 5 +++++ .../environment/test-variables/task.yaml | 16 ++++++++++++++-- .../library-gnome/snap/snapcraft.yaml | 2 +- tests/spread/core24/linters-pack/task.yaml | 15 +++++++-------- tests/unit/commands/test_remote.py | 4 ++-- 8 files changed, 32 insertions(+), 16 deletions(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index bae5d431ea..5550c30fde 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,7 +1,7 @@ attrs==23.1.0 catkin-pkg==0.5.2 click==8.1.7 -craft-application==2.6.2 +craft-application==2.6.3 craft-archives==1.1.3 craft-cli==2.5.1 craft-grammar==1.2.0 diff --git a/requirements-devel.txt b/requirements-devel.txt index 430fe45e98..9220b73367 100644 --- a/requirements-devel.txt +++ b/requirements-devel.txt @@ -11,7 +11,7 @@ click==8.1.7 codespell==2.2.6 colorama==0.4.6 coverage==7.4.4 -craft-application==2.6.2 +craft-application==2.6.3 craft-archives==1.1.3 craft-cli==2.5.1 craft-grammar==1.2.0 diff --git a/requirements.txt b/requirements.txt index 6822b35e8c..dc9e755c64 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,7 +5,7 @@ cffi==1.16.0 chardet==5.2.0 charset-normalizer==3.3.2 click==8.1.7 -craft-application==2.6.2 +craft-application==2.6.3 craft-archives==1.1.3 craft-cli==2.5.1 craft-grammar==1.2.0 diff --git a/tests/spread/core24-suites/environment/snaps/test-variables/snap/snapcraft.yaml b/tests/spread/core24-suites/environment/snaps/test-variables/snap/snapcraft.yaml index a5ae6de89f..2355cd6d51 100644 --- a/tests/spread/core24-suites/environment/snaps/test-variables/snap/snapcraft.yaml +++ b/tests/spread/core24-suites/environment/snaps/test-variables/snap/snapcraft.yaml @@ -6,6 +6,11 @@ grade: devel confinement: strict base: core24 +platforms: + s390x: + build-on: amd64 + build-for: s390x + parts: hello: plugin: nil diff --git a/tests/spread/core24-suites/environment/test-variables/task.yaml b/tests/spread/core24-suites/environment/test-variables/task.yaml index a1b1a752df..15c6fbae11 100644 --- a/tests/spread/core24-suites/environment/test-variables/task.yaml +++ b/tests/spread/core24-suites/environment/test-variables/task.yaml @@ -1,5 +1,11 @@ summary: Test scriptlets variables on core24 +# limit to amd64 for BUILD_ON variables +systems: + - ubuntu-24.04 + - ubuntu-24.04-64 + - ubuntu-24.04-amd64 + environment: SNAP/test_variables: test-variables @@ -38,6 +44,10 @@ execute: | "^SNAPCRAFT_PART_INSTALL=${root}/parts/hello/install$" \ "^SNAPCRAFT_STAGE=${root}/stage$" \ "^SNAPCRAFT_PRIME=${root}/prime$" \ + "^CRAFT_ARCH_BUILD_ON=amd64$" \ + "^CRAFT_ARCH_TRIPLET_BUILD_ON=x86_64-linux-gnu$" \ + "^CRAFT_ARCH_BUILD_FOR=s390x$" \ + "^CRAFT_ARCH_TRIPLET_BUILD_FOR=s390x-linux-gnu$" \ "^CRAFT_PARALLEL_BUILD_COUNT=[0-9]\+$" \ "^CRAFT_PROJECT_DIR=${root}$" \ "^CRAFT_PART_NAME=hello$" \ @@ -52,10 +62,12 @@ execute: | done } - snapcraft pull + # exercise lifecycle commands with and without `--platform` and `--build-for` + + snapcraft pull --platform s390x check_vars pull.txt - snapcraft build + snapcraft build --build-for s390x check_vars build.txt snapcraft stage diff --git a/tests/spread/core24/linters-pack/library-gnome/snap/snapcraft.yaml b/tests/spread/core24/linters-pack/library-gnome/snap/snapcraft.yaml index 6b2c95e7a6..21ad58e5b6 100644 --- a/tests/spread/core24/linters-pack/library-gnome/snap/snapcraft.yaml +++ b/tests/spread/core24/linters-pack/library-gnome/snap/snapcraft.yaml @@ -92,6 +92,6 @@ parts: build-snaps: [core24, gtk-common-themes, gnome-46-2404/latest/edge] override-prime: | set -eux - for snap in "core24" "gtk-common-themes" "gnome-42-2204"; do + for snap in "core24" "gtk-common-themes" "gnome-46-2404"; do cd "/snap/$snap/current" && find . -type f,l -name *.so.* -exec rm -f "$CRAFT_PRIME/{}" \; done diff --git a/tests/spread/core24/linters-pack/task.yaml b/tests/spread/core24/linters-pack/task.yaml index ad40bfb6dd..f94171c242 100644 --- a/tests/spread/core24/linters-pack/task.yaml +++ b/tests/spread/core24/linters-pack/task.yaml @@ -20,13 +20,12 @@ restore: | execute: | cd "${SNAP}" - # Remove this once library-gnome works (it will probably fail - # on the diff check. - if ! snapcraft pack 2> output.txt && [ "${SNAP}" = library-gnome ]; then - exit 0 - fi + snapcraft pack 2> output.txt - test -f linter-test_0.1_*.snap + test -f linter-test_*.snap - sed -n '/^Running linters/,/^Creating snap/p' < output.txt > linter_output.txt - diff -u linter_output.txt expected_linter_output.txt + # linter for gnome snap is not working as-expected (#4751) + if [ "${SNAP}" != "library-gnome" ]; then + sed -n '/^Running linters/,/^Creating snap/p' < output.txt > linter_output.txt + diff -u linter_output.txt expected_linter_output.txt + fi diff --git a/tests/unit/commands/test_remote.py b/tests/unit/commands/test_remote.py index 920e22f8ad..35ea6d857e 100644 --- a/tests/unit/commands/test_remote.py +++ b/tests/unit/commands/test_remote.py @@ -658,11 +658,11 @@ def test_build_for_error( "craft_application.services.remotebuild.RemoteBuildService.start_builds" ) app = application.create_app() - assert app.run() == 78 + assert app.run() == 1 _, err = capsys.readouterr() - assert "build-for 'nonexistent' is not supported." in err + assert "Architecture 'nonexistent' is not supported." in err ######################## From 7aeffed1937c26678c401372cc1a3f95bed1b650 Mon Sep 17 00:00:00 2001 From: Callahan Date: Fri, 3 May 2024 09:20:29 -0500 Subject: [PATCH 3/3] fix: set CRYPTOGRAPHY_OPENSSL_NO_LEGACY (#4784) cryptography>=42.0 cannot load legacy algorithms on Ubuntu 20.04 for armhf, ppc64el, riscv64, and s390x. https://cryptography.io/en/latest/openssl/#legacy-provider-in-openssl-3-x for details on legacy algorithms. Fixes LP#2064639 Signed-off-by: Callahan Kovacs --- snap/snapcraft.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 1750609e86..70754e382e 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -16,6 +16,10 @@ assumes: environment: PATH: "$SNAP/libexec/snapcraft:/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" LD_LIBRARY_PATH: "$SNAP/none" + # cryptography>=42.0 cannot load legacy algorithms on + # Ubuntu 20.04 for armhf, ppc64el, riscv64, and s390x + CRYPTOGRAPHY_OPENSSL_NO_LEGACY: "1" + apps: snapcraft: