Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

snapcraft.yaml: fix missing primed packages in manifest #15029

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/workflows/snap-builds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ jobs:
esac

- name: Build snapd snap
uses: snapcore/action-build@v1
uses: snapcore/action-build@v1.3.0
with:
snapcraft-channel: 8.x/stable
snapcraft-args: --verbose

- name: Check built artifact
run: |
unsquashfs snapd*.snap meta/snap.yaml usr/lib/snapd/
unsquashfs snapd*.snap snap/manifest.yaml meta/snap.yaml usr/lib/snapd/
if cat squashfs-root/meta/snap.yaml | grep -q "version:.*dirty.*"; then
echo "PR produces dirty snapd snap version"
cat squashfs-root/usr/lib/snapd/dirty-git-tree-info.txt
Expand All @@ -75,6 +75,12 @@ jobs:
cat squashfs-root/usr/lib/snapd/dirty-git-tree-info.txt
exit 1
fi
if yq '.primed-stage-packages' squashfs-root/snap/manifest.yaml | grep -q '^- libseccomp2=.*'; then
true
else
echo "primed-stage-packages missing in manifest" 1>&2
exit 1
fi

- name: Uploading snapd snap artifact
uses: actions/upload-artifact@v4
Expand Down
21 changes: 18 additions & 3 deletions build-aux/snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,28 @@ parts:
- -usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/libnss_*.so.2
override-build: |
craftctl default
cp -rT "${CRAFT_PART_INSTALL}/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}" "${CRAFT_PART_INSTALL}/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}"
cp -avT "${CRAFT_PART_INSTALL}/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}" "${CRAFT_PART_INSTALL}/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}"
rm -rf "${CRAFT_PART_INSTALL}/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}"
rm -f "${CRAFT_PART_INSTALL}/lib/${DYNAMIC_LINKER}"
find "${CRAFT_PART_INSTALL}/usr/share/doc" \( -not -type d -not -name "copyright" -delete \) -o \( -type d -empty -delete \)
<<:
- *dynamic-linker
# FIXME: uncomment when https://bugs.launchpad.net/snapcraft/+bug/2097440 is fixed
# override-prime: |
# craftctl default
# python3 "${CRAFT_PROJECT_DIR}/build-aux/snap/local/patch-dl.py" "/snap/snapd/current/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/${DYNAMIC_LINKER}"

# FIXME: remove when https://bugs.launchpad.net/snapcraft/+bug/2097440 is fixed
prime-runtime:
plugin: nil
after:
- runtime
<<:
- *dynamic-linker
override-prime: |
craftctl default
python3 "${CRAFT_PROJECT_DIR}/build-aux/snap/local/patch-dl.py" "/snap/snapd/current/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/${DYNAMIC_LINKER}"
CRAFT_PART_INSTALL="${CRAFT_PART_INSTALL}/../../runtime/install" \
python3 "${CRAFT_PROJECT_DIR}/build-aux/snap/local/patch-dl.py" "/snap/snapd/current/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/${DYNAMIC_LINKER}"

apparmor:
plugin: autotools
Expand Down Expand Up @@ -171,7 +184,7 @@ parts:
# copy in a pregenerated list of network address families so that the
# parser gets built to support as many as possible even if glibc in
# the current build environment does not support them
cp "${LOCAL_APPARMOR_DIR}"/af_names.h .
cp -a "${LOCAL_APPARMOR_DIR}"/af_names.h .
make -j"${CRAFT_PARALLEL_BUILD_COUNT}"
install -Dm755 -t "${CRAFT_PART_INSTALL}/usr/lib/snapd" apparmor_parser
install -Dm644 -t "${CRAFT_PART_INSTALL}/usr/lib/snapd/apparmor" parser.conf
Expand Down Expand Up @@ -533,10 +546,12 @@ parts:
# Must run after everything else
- snapd
- runtime
- prime-runtime
- apparmor
- dynamic-linker
<<:
- *dynamic-linker
override-prime: |
craftctl default
"${CRAFT_PROJECT_DIR}/build-aux/snap/local/verify-dl.py" \
"/snap/snapd/current/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/${DYNAMIC_LINKER}"
Loading