From cfcbb42f1d747b4d44aa3b78602733bdda9e7378 Mon Sep 17 00:00:00 2001 From: Callahan Kovacs Date: Mon, 22 Jan 2024 09:49:30 -0600 Subject: [PATCH 1/4] feat(providers): use core24 buildd daily image for devel Signed-off-by: Callahan Kovacs --- snapcraft/providers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snapcraft/providers.py b/snapcraft/providers.py index 268904ef3e..a69d98d5be 100644 --- a/snapcraft/providers.py +++ b/snapcraft/providers.py @@ -42,7 +42,7 @@ "core18": bases.BuilddBaseAlias.BIONIC, "core20": bases.BuilddBaseAlias.FOCAL, "core22": bases.BuilddBaseAlias.JAMMY, - "devel": bases.BuilddBaseAlias.DEVEL, + "devel": bases.BuilddBaseAlias.NOBLE, } # TODO: move to a package data file for shellcheck and syntax highlighting From 887ad398b900436c62ec0b392d780e722ba66463 Mon Sep 17 00:00:00 2001 From: Callahan Kovacs Date: Thu, 25 Jan 2024 08:09:59 -0600 Subject: [PATCH 2/4] fix: readd `devel` base Signed-off-by: Callahan Kovacs --- snapcraft/providers.py | 1 + 1 file changed, 1 insertion(+) diff --git a/snapcraft/providers.py b/snapcraft/providers.py index 37657b7b2b..5d6a9b743b 100644 --- a/snapcraft/providers.py +++ b/snapcraft/providers.py @@ -43,6 +43,7 @@ "core20": bases.BuilddBaseAlias.FOCAL, "core22": bases.BuilddBaseAlias.JAMMY, "core24": bases.BuilddBaseAlias.NOBLE, + "devel": bases.BuilddBaseAlias.NOBLE, } # TODO: move to a package data file for shellcheck and syntax highlighting From ae1a9e8a93da4f21a7eb9b058440a0fa72c7ff61 Mon Sep 17 00:00:00 2001 From: Callahan Kovacs Date: Thu, 25 Jan 2024 11:53:21 -0600 Subject: [PATCH 3/4] fix: point devel back to devel Signed-off-by: Callahan Kovacs --- snapcraft/providers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snapcraft/providers.py b/snapcraft/providers.py index 5d6a9b743b..81dafda48a 100644 --- a/snapcraft/providers.py +++ b/snapcraft/providers.py @@ -43,7 +43,7 @@ "core20": bases.BuilddBaseAlias.FOCAL, "core22": bases.BuilddBaseAlias.JAMMY, "core24": bases.BuilddBaseAlias.NOBLE, - "devel": bases.BuilddBaseAlias.NOBLE, + "devel": bases.BuilddBaseAlias.DEVEL, } # TODO: move to a package data file for shellcheck and syntax highlighting From 43c6ca742ef2486cd1e88031267acaea2febd6ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A6=B8=E0=A7=8C=E0=A6=AE=E0=A7=8D=E0=A6=AF=E0=A6=A6?= =?UTF-8?q?=E0=A7=80=E0=A6=AA=20=E0=A6=98=E0=A7=8B=E0=A6=B7?= <72045785+soumyaDghosh@users.noreply.github.com> Date: Thu, 8 Feb 2024 23:46:59 +0530 Subject: [PATCH 4/4] Added support for `webkitgtk2-4.0` and added `GI_TYPELIB_PATH` for gi path (#4451) Signed-off-by: Callahan Kovacs Co-authored-by: Alex Lowe Co-authored-by: Callahan --- snapcraft/extensions/gnome.py | 43 ++++++++++++++---- tests/unit/extensions/test_gnome.py | 67 ++++++++++++++++++++++------- 2 files changed, 86 insertions(+), 24 deletions(-) diff --git a/snapcraft/extensions/gnome.py b/snapcraft/extensions/gnome.py index a82f48a3e4..a6939728ad 100644 --- a/snapcraft/extensions/gnome.py +++ b/snapcraft/extensions/gnome.py @@ -155,8 +155,17 @@ def get_root_snippet(self) -> Dict[str, Any]: } }, "layout": { - "/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/webkit2gtk-4.0": { - "bind": "$SNAP/gnome-platform/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/webkit2gtk-4.0" + "/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/webkit2gtk-4.0": { + "bind": ( + "$SNAP/gnome-platform/usr/lib/" + "$CRAFT_ARCH_TRIPLET_BUILD_FOR/webkit2gtk-4.0" + ) + }, + "/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/webkit2gtk-4.1": { + "bind": ( + "$SNAP/gnome-platform/usr/lib/" + "$CRAFT_ARCH_TRIPLET_BUILD_FOR/webkit2gtk-4.1" + ) }, "/usr/share/xml/iso-codes": { "bind": "$SNAP/gnome-platform/usr/share/xml/iso-codes" @@ -189,11 +198,14 @@ def get_part_snippet(self, *, plugin_name: str) -> Dict[str, Any]: "LD_LIBRARY_PATH": prepend_to_env( "LD_LIBRARY_PATH", [ - f"/snap/{sdk_snap}/current/lib/$CRAFT_ARCH_TRIPLET", - f"/snap/{sdk_snap}/current/usr/lib/$CRAFT_ARCH_TRIPLET", + f"/snap/{sdk_snap}/current/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR", + f"/snap/{sdk_snap}/current/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR", f"/snap/{sdk_snap}/current/usr/lib", f"/snap/{sdk_snap}/current/usr/lib/vala-current", - f"/snap/{sdk_snap}/current/usr/lib/$CRAFT_ARCH_TRIPLET/pulseaudio", + ( + f"/snap/{sdk_snap}/current/usr/lib/" + "$CRAFT_ARCH_TRIPLET_BUILD_FOR/pulseaudio" + ), ], ), }, @@ -201,7 +213,10 @@ def get_part_snippet(self, *, plugin_name: str) -> Dict[str, Any]: "PKG_CONFIG_PATH": prepend_to_env( "PKG_CONFIG_PATH", [ - f"/snap/{sdk_snap}/current/usr/lib/$CRAFT_ARCH_TRIPLET/pkgconfig", + ( + f"/snap/{sdk_snap}/current/usr/lib/" + "$CRAFT_ARCH_TRIPLET_BUILD_FOR/pkgconfig" + ), f"/snap/{sdk_snap}/current/usr/lib/pkgconfig", f"/snap/{sdk_snap}/current/usr/share/pkgconfig", ], @@ -217,7 +232,7 @@ def get_part_snippet(self, *, plugin_name: str) -> Dict[str, Any]: }, { "GDK_PIXBUF_MODULE_FILE": ( - f"/snap/{sdk_snap}/current/usr/lib/$CRAFT_ARCH_TRIPLET" + f"/snap/{sdk_snap}/current/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR" "/gdk-pixbuf-current/loaders.cache" ), }, @@ -235,11 +250,23 @@ def get_part_snippet(self, *, plugin_name: str) -> Dict[str, Any]: [ f"/snap/{sdk_snap}/current/usr/lib/python3.10", f"/snap/{sdk_snap}/current/usr/lib/python3/dist-packages", - f"/snap/{sdk_snap}/current/usr/lib/$CRAFT_ARCH_TRIPLET" + f"/snap/{sdk_snap}/current/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR" "/gobject-introspection", ], ), }, + { + "GI_TYPELIB_PATH": prepend_to_env( + "GI_TYPELIB_PATH", + [ + f"/snap/{sdk_snap}/current/usr/lib/girepository-1.0", + ( + f"/snap/{sdk_snap}/usr/lib/" + "$CRAFT_ARCH_TRIPLET_BUILD_FOR/girepository-1.0" + ), + ], + ) + }, ], } diff --git a/tests/unit/extensions/test_gnome.py b/tests/unit/extensions/test_gnome.py index 2e60b75222..7296145a9a 100644 --- a/tests/unit/extensions/test_gnome.py +++ b/tests/unit/extensions/test_gnome.py @@ -93,8 +93,11 @@ def test_get_root_snippet(gnome_extension): } }, "layout": { - "/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/webkit2gtk-4.0": { - "bind": "$SNAP/gnome-platform/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/webkit2gtk-4.0" + "/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/webkit2gtk-4.0": { + "bind": "$SNAP/gnome-platform/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/webkit2gtk-4.0" + }, + "/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/webkit2gtk-4.1": { + "bind": "$SNAP/gnome-platform/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/webkit2gtk-4.1" }, "/usr/share/xml/iso-codes": { "bind": "$SNAP/gnome-platform/usr/share/xml/iso-codes" @@ -141,8 +144,11 @@ def test_get_root_snippet_with_external_sdk(gnome_extension_with_build_snap): } }, "layout": { - "/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/webkit2gtk-4.0": { - "bind": "$SNAP/gnome-platform/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/webkit2gtk-4.0" + "/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/webkit2gtk-4.0": { + "bind": "$SNAP/gnome-platform/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/webkit2gtk-4.0" + }, + "/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/webkit2gtk-4.1": { + "bind": "$SNAP/gnome-platform/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/webkit2gtk-4.1" }, "/usr/share/xml/iso-codes": { "bind": "$SNAP/gnome-platform/usr/share/xml/iso-codes" @@ -202,19 +208,20 @@ def assert_get_part_snippet(gnome_instance): { "LD_LIBRARY_PATH": ":".join( [ - "/snap/gnome-42-2204-sdk/current/lib/$CRAFT_ARCH_TRIPLET", - "/snap/gnome-42-2204-sdk/current/usr/lib/$CRAFT_ARCH_TRIPLET", + "/snap/gnome-42-2204-sdk/current/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR", + "/snap/gnome-42-2204-sdk/current/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR", "/snap/gnome-42-2204-sdk/current/usr/lib", "/snap/gnome-42-2204-sdk/current/usr/lib/vala-current", "/snap/gnome-42-2204-sdk/current/usr/lib/" - "$CRAFT_ARCH_TRIPLET/pulseaudio", + "$CRAFT_ARCH_TRIPLET_BUILD_FOR/pulseaudio", ] ) + "${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" }, { "PKG_CONFIG_PATH": ( - "/snap/gnome-42-2204-sdk/current/usr/lib/$CRAFT_ARCH_TRIPLET/pkgconfig:" + "/snap/gnome-42-2204-sdk/current/usr/lib/" + "$CRAFT_ARCH_TRIPLET_BUILD_FOR/pkgconfig:" "/snap/gnome-42-2204-sdk/current/usr/lib/pkgconfig:" "/snap/gnome-42-2204-sdk/current/usr/share/pkgconfig" "${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" @@ -228,7 +235,7 @@ def assert_get_part_snippet(gnome_instance): }, { "GDK_PIXBUF_MODULE_FILE": ( - "/snap/gnome-42-2204-sdk/current/usr/lib/$CRAFT_ARCH_TRIPLET" + "/snap/gnome-42-2204-sdk/current/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR" "/gdk-pixbuf-current/loaders.cache" ) }, @@ -243,12 +250,24 @@ def assert_get_part_snippet(gnome_instance): [ "/snap/gnome-42-2204-sdk/current/usr/lib/python3.10", "/snap/gnome-42-2204-sdk/current/usr/lib/python3/dist-packages", - "/snap/gnome-42-2204-sdk/current/usr/lib/$CRAFT_ARCH_TRIPLET" + "/snap/gnome-42-2204-sdk/current/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR" "/gobject-introspection", ] ) + "${PYTHONPATH:+:$PYTHONPATH}" }, + { + "GI_TYPELIB_PATH": ":".join( + [ + "/snap/gnome-42-2204-sdk/current/usr/lib/girepository-1.0", + ( + "/snap/gnome-42-2204-sdk/usr/lib/" + "$CRAFT_ARCH_TRIPLET_BUILD_FOR/girepository-1.0" + ), + ] + ) + + "${GI_TYPELIB_PATH:+:$GI_TYPELIB_PATH}" + }, ] } @@ -266,18 +285,22 @@ def test_get_part_snippet_with_external_sdk(gnome_extension_with_build_snap): { "LD_LIBRARY_PATH": ":".join( [ - "/snap/gnome-44-2204-sdk/current/lib/$CRAFT_ARCH_TRIPLET", - "/snap/gnome-44-2204-sdk/current/usr/lib/$CRAFT_ARCH_TRIPLET", + "/snap/gnome-44-2204-sdk/current/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR", + "/snap/gnome-44-2204-sdk/current/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR", "/snap/gnome-44-2204-sdk/current/usr/lib", "/snap/gnome-44-2204-sdk/current/usr/lib/vala-current", - "/snap/gnome-44-2204-sdk/current/usr/lib/$CRAFT_ARCH_TRIPLET/pulseaudio", + ( + "/snap/gnome-44-2204-sdk/current/usr/lib/" + "$CRAFT_ARCH_TRIPLET_BUILD_FOR/pulseaudio" + ), ] ) + "${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" }, { "PKG_CONFIG_PATH": ( - "/snap/gnome-44-2204-sdk/current/usr/lib/$CRAFT_ARCH_TRIPLET/pkgconfig:" + "/snap/gnome-44-2204-sdk/current/usr/lib/" + "$CRAFT_ARCH_TRIPLET_BUILD_FOR/pkgconfig:" "/snap/gnome-44-2204-sdk/current/usr/lib/pkgconfig:" "/snap/gnome-44-2204-sdk/current/usr/share/pkgconfig" "${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" @@ -291,7 +314,7 @@ def test_get_part_snippet_with_external_sdk(gnome_extension_with_build_snap): }, { "GDK_PIXBUF_MODULE_FILE": ( - "/snap/gnome-44-2204-sdk/current/usr/lib/$CRAFT_ARCH_TRIPLET" + "/snap/gnome-44-2204-sdk/current/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR" "/gdk-pixbuf-current/loaders.cache" ) }, @@ -306,12 +329,24 @@ def test_get_part_snippet_with_external_sdk(gnome_extension_with_build_snap): [ "/snap/gnome-44-2204-sdk/current/usr/lib/python3.10", "/snap/gnome-44-2204-sdk/current/usr/lib/python3/dist-packages", - "/snap/gnome-44-2204-sdk/current/usr/lib/$CRAFT_ARCH_TRIPLET" + "/snap/gnome-44-2204-sdk/current/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR" "/gobject-introspection", ] ) + "${PYTHONPATH:+:$PYTHONPATH}" }, + { + "GI_TYPELIB_PATH": ":".join( + [ + "/snap/gnome-44-2204-sdk/current/usr/lib/girepository-1.0", + ( + "/snap/gnome-44-2204-sdk/usr/lib/" + "$CRAFT_ARCH_TRIPLET_BUILD_FOR/girepository-1.0" + ), + ] + ) + + "${GI_TYPELIB_PATH:+:$GI_TYPELIB_PATH}" + }, ] }