Skip to content

Commit

Permalink
chore: migrate snapcraft itself to core24
Browse files Browse the repository at this point in the history
Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>
  • Loading branch information
mr-cal committed Oct 29, 2024
1 parent 187187d commit b14f427
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
20 changes: 9 additions & 11 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: snapcraft
base: core22
base: core24
summary: easily create snaps
description: |
Snapcraft aims to make upstream developers' lives easier and as such is not
Expand All @@ -15,7 +15,6 @@ assumes:
# https://github.com/canonical/snapcraft/issues/4187
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"
Expand Down Expand Up @@ -90,21 +89,20 @@ parts:
- execstack
- gpg
- gpgv
- libffi7
- libffi8
- libsodium23
- libxml2
- libxslt1.1
- libpython3-stdlib
- libpython3.10-stdlib
- libpython3.10-minimal
- libpython3.12-stdlib
- libpython3.12-minimal
- python3-pip
- python3-setuptools
- python3-wheel
- python3-venv
- python3-minimal
- python3-distutils
- python3-pkg-resources
- python3.10-minimal
- python3.12-minimal
- squashfs-tools
- xdelta3
build-attributes:
Expand All @@ -120,7 +118,7 @@ parts:
ln -s "$LIBSODIUM" "$TRIPLET_PATH/libsodium.so"
# Restore patched files
PYTHON_PACKAGE_PATH="${SNAPCRAFT_PART_INSTALL}/usr/lib/python3.10/"
PYTHON_PACKAGE_PATH="${SNAPCRAFT_PART_INSTALL}/usr/lib/python3.12/"
CTYPES_INIT="ctypes/__init__.py"
CTYPES_INIT_ORIG="patched/${CTYPES_INIT}.orig"
[ -f "${CTYPES_INIT_ORIG}" ] && mv "${CTYPES_INIT_ORIG}" "${PYTHON_PACKAGE_PATH}/${CTYPES_INIT}"
Expand All @@ -136,7 +134,7 @@ parts:
fi
# Disable site packages
sed -i "${SNAPCRAFT_PART_INSTALL}/usr/lib/python3.10/site.py" \
sed -i "${SNAPCRAFT_PART_INSTALL}/usr/lib/python3.12/site.py" \
-e 's/^ENABLE_USER_SITE = None$/ENABLE_USER_SITE = False/'
libgit2:
Expand Down Expand Up @@ -175,7 +173,7 @@ parts:
- "PIP_NO_BINARY": ":all:"
# Use base image's libsodium for PyNaCl.
- "SODIUM_INSTALL": "system"
- "CFLAGS": "$(pkg-config python-3.10 yaml-0.1 --cflags)"
- "CFLAGS": "$(pkg-config python-3.12 yaml-0.1 --cflags)"
override-build: |
${SNAP}/libexec/snapcraft/craftctl default
Expand All @@ -187,7 +185,7 @@ parts:
${SNAP}/libexec/snapcraft/craftctl set grade="$grade"
# The new implementation still requires this.
ln -sf ../usr/bin/python3.10 $SNAPCRAFT_PART_INSTALL/bin/python3
ln -sf ../usr/bin/python3.12 $SNAPCRAFT_PART_INSTALL/bin/python3
after: [snapcraft-libs, libgit2]

chisel:
Expand Down
1 change: 0 additions & 1 deletion tools/freeze-requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ pip install -e .[docs]
pip freeze --exclude-editable > requirements-docs.txt
requirements_fixups "requirements-docs.txt"

# Set the configured python-apt and python-distutils-extra packages.
pip install -e .[dev]
pip freeze --exclude-editable > requirements-devel.txt
requirements_fixups "requirements-devel.txt"
Expand Down

0 comments on commit b14f427

Please sign in to comment.