← Back to issue list

Different behavior for a virtual package in stage-packages over architectures and time

View original Github issue

Metadata

Project
snapcraft
Number
#5621
Type
issue
State
closed
Author
LiaoU3
Labels
Type: Question
Created
Updated
Closed

Current evaluation

Closed as a question. Maintainer clarified Snapcraft delegates resolution to apt, which handles virtual packages ambiguously and may resolve differently across architectures or over time. Rejected as a Snapcraft bug.

Suggested action:

No scores available.

Issue body

### Bug Description What is the expected behavior when a virtual package is listed in stage-packages in snapcraft.yaml? For example [libasound2](https://github.com/canonical/checkbox/blob/main/checkbox-core-snap/series24/snap/snapcraft.yaml#L290) in checkbox, it is a virtual package in [noble](https://packages.ubuntu.com/noble/libasound2). ``` $ sudo apt install libasound2 [sudo] password for vincent: Reading package lists... Done Building dependency tree... Done Reading state information... Done Package libasound2 is a virtual package provided by: libasound2t64 1.2.11-1ubuntu0.1 (= 1.2.11-1ubuntu0.1) liboss4-salsa-asound2 4.2-build2020-1ubuntu3 You should explicitly select one to install. E: Package 'libasound2' has no installation candidate ``` According to the build log for checkbox24, the behavior seems to be different on [ARM64](https://github.com/canonical/checkbox/actions/runs/16202677370/job/45745393365) and [AMD64](https://github.com/canonical/checkbox/actions/runs/16202677370/job/45745393319). If you search for "asound", you will find that it installed both packages on arm (which is also not correct since these 2 packages conflict with each other), but only libasound2t64 on amd64. Another weird thing is that the [build](https://github.com/canonical/checkbox/actions/runs/15216444593/job/42803001251#logs) on AMD64 on May 24th, it installed both packages, which is different from the current build. ### To Reproduce 1. git clone https://github.com/canonical/checkbox.git 2. cd checkbox/checkbox-core-snap/ 3. ./prepare.sh 24 4. cd series24 5. snapcraft ### Environment - Ubuntu 24.04 - LXD ### snapcraft.yaml ```yaml name: checkbox24 summary: Checkbox runtime and public providers description: "Checkbox runtime and public providers" grade: stable confinement: strict adopt-info: version-calculator base: core24 # Don't forget to add a new slot if a new provider part is added in the parts # section below. slots: provider-resource: interface: content read: - $SNAP/providers/checkbox-provider-resource provider-checkbox: interface: content read: - $SNAP/providers/checkbox-provider-base provider-docker: interface: content read: - $SNAP/providers/checkbox-provider-docker provider-tpm2: interface: content read: - $SNAP/providers/checkbox-provider-tpm2 provider-iiotg: interface: content read: - $SNAP/providers/checkbox-provider-iiotg provider-engineering-tests: interface: content read: - $SNAP/providers/checkbox-provider-engineering-tests provider-sru: interface: content read: - $SNAP/providers/checkbox-provider-sru provider-gpgpu: interface: content read: - $SNAP/providers/checkbox-provider-gpgpu provider-certification-client: interface: content read: - $SNAP/providers/checkbox-provider-certification-client provider-certification-server: interface: content read: - $SNAP/providers/checkbox-provider-certification-server provider-tutorial: interface: content read: - $SNAP/providers/checkbox-provider-tutorial checkbox-runtime: interface: content read: - / package-repositories: - type: apt ppa: colin-king/stress-ng - type: apt ppa: colin-king/ppa parts: version-calculator: plugin: dump source: . override-pull: | craftctl default # version.txt created by prepare.sh export version=`cat $CRAFT_PART_SRC/version.txt` [ $version ] || exit 1 craftctl set version=$version stage: - version.txt ################################################################################ fwts: source-tag: "V25.03.00" source-depth: 1 plugin: autotools source: https://github.com/fwts/fwts.git # needed because default is /usr/local # if you change this update LD_LIBRARY_PATH autotools-configure-parameters: - --prefix=/ stage-packages: - libfdt1 - libbsd0 - libpci3 build-packages: - gcc - make - autoconf - automake - libtool - flex - bison - dh-autoreconf - libglib2.0-dev - libfdt-dev - libbsd-dev after: [version-calculator] ################################################################################ stress-ng: plugin: nil stage-packages: - stress-ng after: [fwts] ################################################################################ acpi-tools: plugin: nil stage-packages: - acpica-tools after: [stress-ng] ################################################################################ checkbox-support: plugin: python source: checkbox-support source-type: local stage-packages: # actual requirements - python3-bluez - python3-pyparsing - libsystemd0 - v4l-utils # added to stage python: - libpython3-stdlib - libpython3.12-stdlib - libpython3.12-minimal - python3-pip - python3-setuptools - python3-wheel - python3-venv - python3-minimal - python3-pkg-resources - python3.12-minimal build-packages: - libbluetooth-dev - python3-dev python-packages: - pynmea2 after: [acpi-tools] stage: - -pyvenv.cfg - -bin/activate* - -**/RECORD - -**/__pycache__ - -debian build-environment: - C_INCLUDE_PATH: /usr/include/python3.12 - PYTHONPATH: $CRAFT_PART_INSTALL/usr/lib/python3/dist-packages:${PYTHONPATH:-} - SETUPTOOLS_SCM_PRETEND_VERSION: "$(cat $CRAFT_STAGE/version.txt)" override-build: | craftctl default ################################################################################ checkbox-ng: plugin: python source: checkbox-ng source-type: local build-packages: - zlib1g-dev - build-essential stage-packages: - perl - python3-markupsafe - python3-jinja2 - python3-packaging - python3-requests-oauthlib - python3-urwid - python3-xlsxwriter # added to stage python: - libpython3-stdlib - libpython3.12-stdlib - libpython3.12-minimal - python3-pip - python3-setuptools - python3-wheel - python3-venv - python3-minimal - python3-pkg-resources - python3.12-minimal - python3-yaml python-packages: - tqdm - picamera # p-p-c dep that wouldnt install in another part after: [checkbox-support] stage: - -pyvenv.cfg - -bin/activate* - -**/RECORD - -**/__pycache__ - -debian build-environment: - PYTHONPATH: $CRAFT_PART_INSTALL/usr/lib/python3/dist-packages:${PYTHONPATH:-} - READTHEDOCS: 'True' # simplifies picamera install - SETUPTOOLS_SCM_PRETEND_VERSION: "$(cat $CRAFT_STAGE/version.txt)" override-build: | craftctl default ################################################################################ checkbox-provider-resource: plugin: dump source: providers/resource source-type: local stage-packages: - cpu-checker - dpkg - dmidecode - libjson-xs-perl - pciutils - smartmontools build-environment: - PYTHONPYCACHEPREFIX: "/tmp" override-build: | cd src && autoreconf -i && cd - export PYTHONPATH=$CRAFT_STAGE/lib/python3.12/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages for path in $(find "$CRAFT_STAGE/providers/" -mindepth 1 -maxdepth 1 -type d); do export PROVIDERPATH=$path${PROVIDERPATH:+:$PROVIDERPATH}; done python3 manage.py validate python3 manage.py build python3 manage.py install --layout=relocatable --prefix=/providers/checkbox-provider-resource --root="$CRAFT_PART_INSTALL" build-packages: - autoconf - automake - libnl-3-dev - libnl-genl-3-dev - pkg-config after: [checkbox-ng] ################################################################################ checkbox-provider-base: plugin: dump source: providers/base source-type: local build-environment: - PYTHONPYCACHEPREFIX: "/tmp" override-build: | export PYTHONPATH=$CRAFT_STAGE/lib/python3.12/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages for path in $(find "$CRAFT_STAGE/providers/" -mindepth 1 -maxdepth 1 -type d); do export PROVIDERPATH=$path${PROVIDERPATH:+:$PROVIDERPATH}; done python3 manage.py validate python3 manage.py build python3 manage.py install --layout=relocatable --prefix=/providers/checkbox-provider-base --root="$CRAFT_PART_INSTALL" override-prime: | # needed because else this will trigger the store autoreviewer and be autorejected # cleaning this bit should not cause any issue but if it does do not only remove this line # contact also the store/update the package because else this will always trigger # a manual review for libamd_path in $(find .. -name "*.so.*"); do echo "Clearing execstack on $libamd_path"; # the || true is because there are some "*.so*.py" in gdblib execstack --clear-execstack "$libamd_path" || true done; craftctl default stage-packages: - python3-opencv - bc - bonnie++ - bpftrace - cryptsetup-bin - dbus - debsums - dmidecode - dmsetup - efibootmgr - ethtool - freeipmi-tools - fswebcam - gir1.2-cheese-3.0 - gir1.2-clutter-1.0 - gir1.2-gst-plugins-base-1.0 - gir1.2-gudev-1.0 - glmark2 - glmark2-es2 - glmark2-wayland - glmark2-es2-wayland - gnome-screenshot - gstreamer1.0-tools - gstreamer1.0-plugins-bad - gstreamer1.0-pulseaudio - hdparm - i2c-tools - ipmitool - iperf - iperf3 - iw - jq - kmod - libasound2 - libcap2-bin - libfdt1 - libsvm3 - lsb-release - lshw - mesa-utils - mokutil - net-tools - nmap - nux-tools - nvme-cli - obexftp - parted - pciutils - pulseaudio-utils - pyotherside-doc - pyotherside-tests - qml-module-io-thp-pyotherside - qml6-module-io-thp-pyotherside - python3-dbus - python3-evdev - python3-gi - python3-natsort - python3-pil - python3-psutil - python3-pyqrcode - python3-serial - python3-yaml - python3-zbar - qml-module-qtquick-controls - qml-module-qtquick-layouts - qmlscene - smartmontools - usbutils - util-linux - uuid-runtime - wget - wmctrl - xz-utils - rt-tests # For realtime performance test - mdadm - on armhf: - python3-rpi.gpio # only in focal - on arm64: - python3-rpi.gpio # only in focal build-packages: - execstack # needed to clear the execstack - libasound2-dev - libcap-dev organize: usr/lib/lib*.so*: usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/ after: [checkbox-provider-resource] ################################################################################ checkbox-provider-docker: plugin: dump source: providers/docker source-type: local build-environment: - PYTHONPYCACHEPREFIX: "/tmp" override-build: | export PYTHONPATH=$CRAFT_STAGE/lib/python3.12/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages for path in $(find "$CRAFT_STAGE/providers/" -mindepth 1 -maxdepth 1 -type d); do export PROVIDERPATH=$path${PROVIDERPATH:+:$PROVIDERPATH}; done python3 manage.py validate python3 manage.py build python3 manage.py install --layout=relocatable --prefix=/providers/checkbox-provider-docker --root="$CRAFT_PART_INSTALL" stage-packages: - apache2-utils after: [checkbox-provider-base] ################################################################################ checkbox-provider-tpm2: plugin: dump source: providers/tpm2 source-type: local build-environment: - PYTHONPYCACHEPREFIX: "/tmp" override-build: | export PYTHONPATH=$CRAFT_STAGE/lib/python3.12/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages for path in $(find "$CRAFT_STAGE/providers/" -mindepth 1 -maxdepth 1 -type d); do export PROVIDERPATH=$path${PROVIDERPATH:+:$PROVIDERPATH}; done python3 manage.py validate python3 manage.py build python3 manage.py install --layout=relocatable --prefix=/providers/checkbox-provider-tpm2 --root="$CRAFT_PART_INSTALL" stage-packages: - clevis-tpm2 after: [checkbox-provider-docker] ################################################################################ checkbox-provider-iiotg: plugin: dump source: providers/iiotg source-type: local build-environment: - PYTHONPYCACHEPREFIX: "/tmp" override-build: | export PYTHONPATH=$CRAFT_STAGE/lib/python3.12/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages for path in $(find "$CRAFT_STAGE/providers/" -mindepth 1 -maxdepth 1 -type d); do export PROVIDERPATH=$path${PROVIDERPATH:+:$PROVIDERPATH}; done python3 manage.py validate python3 manage.py build python3 manage.py install --layout=relocatable --prefix=/providers/checkbox-provider-iiotg --root="$CRAFT_PART_INSTALL" after: [checkbox-provider-tpm2] ################################################################################ checkbox-provider-sru: plugin: dump source: providers/sru source-type: local build-environment: - PYTHONPYCACHEPREFIX: "/tmp" override-build: | export PYTHONPATH=$CRAFT_STAGE/lib/python3.12/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages for path in $(find "$CRAFT_STAGE/providers/" -mindepth 1 -maxdepth 1 -type d); do export PROVIDERPATH=$path${PROVIDERPATH:+:$PROVIDERPATH}; done python3 manage.py validate python3 manage.py build python3 manage.py install --layout=relocatable --prefix=/providers/checkbox-provider-sru --root="$CRAFT_PART_INSTALL" after: [checkbox-provider-iiotg] ################################################################################ checkbox-provider-gpgpu: plugin: dump source: providers/gpgpu source-type: local build-environment: - PYTHONPYCACHEPREFIX: "/tmp" override-build: | export PYTHONPATH=$CRAFT_STAGE/lib/python3.12/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages for path in $(find "$CRAFT_STAGE/providers/" -mindepth 1 -maxdepth 1 -type d); do export PROVIDERPATH=$path${PROVIDERPATH:+:$PROVIDERPATH}; done python3 manage.py validate python3 manage.py build python3 manage.py install --layout=relocatable --prefix=/providers/checkbox-provider-gpgpu --root="$CRAFT_PART_INSTALL" after: [checkbox-provider-sru] ################################################################################ checkbox-provider-certification-client: plugin: dump source: providers/certification-client source-type: local build-environment: - PYTHONPYCACHEPREFIX: "/tmp" override-build: | export PYTHONPATH=$CRAFT_STAGE/lib/python3.12/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages for path in $(find "$CRAFT_STAGE/providers/" -mindepth 1 -maxdepth 1 -type d); do export PROVIDERPATH=$path${PROVIDERPATH:+:$PROVIDERPATH}; done python3 manage.py validate python3 manage.py build python3 manage.py install --layout=relocatable --prefix=/providers/checkbox-provider-certification-client --root="$CRAFT_PART_INSTALL" after: [checkbox-provider-gpgpu] ################################################################################ checkbox-provider-certification-server: plugin: dump source: providers/certification-server source-type: local build-environment: - PYTHONPYCACHEPREFIX: "/tmp" override-build: | export PYTHONPATH=$CRAFT_STAGE/lib/python3.12/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages for path in $(find "$CRAFT_STAGE/providers/" -mindepth 1 -maxdepth 1 -type d); do export PROVIDERPATH=$path${PROVIDERPATH:+:$PROVIDERPATH}; done python3 manage.py validate python3 manage.py build python3 manage.py install --layout=relocatable --prefix=/providers/checkbox-provider-certification-server --root="$CRAFT_PART_INSTALL" after: [checkbox-provider-certification-client] ################################################################################ checkbox-provider-tutorial: plugin: dump source: providers/tutorial source-type: local build-environment: - PYTHONPYCACHEPREFIX: "/tmp" override-build: | export PYTHONPATH=$CRAFT_STAGE/lib/python3.12/site-packages:$SNAPCRAFT_STAGE/usr/lib/python3/dist-packages for path in $(find "$CRAFT_STAGE/providers/" -mindepth 1 -maxdepth 1 -type d); do export PROVIDERPATH=$path${PROVIDERPATH:+:$PROVIDERPATH}; done python3 manage.py validate python3 manage.py build python3 manage.py install --layout=relocatable --prefix=/providers/checkbox-provider-tutorial --root="$CRAFT_PART_INSTALL" after: [checkbox-provider-base] ################################################################################ gnome-randr: source: https://github.com/maxwellainatchi/gnome-randr-rust.git plugin: rust rust-channel: nightly build-packages: - libdbus-1-dev ################################################################################ rpi-support-binaries: plugin: nil stage-packages: - on armhf: - libraspberrypi0 - on arm64: - libraspberrypi0 organize: usr/lib/lib*.so: usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/ ################################################################################ lk-boot-env: plugin: nil source: . override-pull: | craftctl default wget https://raw.githubusercontent.com/snapcore/snapd/master/include/lk/snappy_boot_common.h wget https://raw.githubusercontent.com/snapcore/snapd/master/include/lk/snappy_boot_v2.h wget https://raw.githubusercontent.com/kubiko/dragonboard-gadget/20-lk/snap-boot-sel/lk-boot-env.c build-packages: - wget - on amd64 to armhf: - gcc-arm-linux-gnueabihf:amd64 - on amd64 to arm64: - gcc-aarch64-linux-gnu:amd64 override-build: | mkdir -p ${CRAFT_PART_INSTALL}/bin if [ "${CRAFT_ARCH_TRIPLET_BUILD_FOR}" = "arm-linux-gnueabihf" ]; then arm-linux-gnueabihf-gcc lk-boot-env.c -I/usr/include/ -Iapp/aboot -o ${CRAFT_PART_INSTALL}/bin/lk-boot-env elif [ "${CRAFT_ARCH_TRIPLET_BUILD_FOR}" = "aarch64-linux-gnu" ]; then aarch64-linux-gnu-gcc lk-boot-env.c -I/usr/include/ -Iapp/aboot -o ${CRAFT_PART_INSTALL}/bin/lk-boot-env else # native build gcc lk-boot-env.c -I/usr/include/ -Iapp/aboot -o ${CRAFT_PART_INSTALL}/bin/lk-boot-env fi ################################################################################ parts-meta-info: plugin: nil build-environment: - RUNTIME_VERSION: "$(cat $CRAFT_STAGE/version.txt)" override-build: | craftctl default echo "checkbox-runtime:" >> $CRAFT_PART_INSTALL/parts_meta_info echo "$RUNTIME_VERSION" >> $CRAFT_PART_INSTALL/parts_meta_info after: [checkbox-provider-certification-server] ################################################################################ common-config: plugin: dump source: config/ ``` ### Relevant log output ```shell # In the build log for arm64 Downloading package: liboss4-salsa-asound2 Downloading package: libasound2t64 # In the build log for amd64 Downloading package: libasound2t64 ``` ### Additional context _No response_

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Closed as a question. Maintainer clarified Snapcraft delegates resolution to apt, which handles virtual packages ambiguously and may resolve differently across architectures or over time. Rejected as a Snapcraft bug.
qwen/qwen3.6-35b-a3b Closed as a question. Maintainer clarified that Snapcraft delegates resolution to apt, which handles virtual packages ambiguously and may resolve differently across architectures or over time. No Snapcraft changes were required.
qwen/qwen3.6-35b-a3b Closed as expected behavior. Maintainers noted snapcraft delegates resolution to apt, which inconsistently resolves virtual packages across architectures and over time. Users should specify concrete packages instead.
qwen3.6-35b-a3b-mtp-q6 Closed as expected behavior. Maintainer clarified Snapcraft delegates resolution to apt, causing non-deterministic virtual package handling across architectures and time. No code changes; users should specify concrete packages instead of virtual ones.
qwen3.6-35b-a3b-mtp-q6 Closed as a question. No fix implemented. Maintainer explained Snapcraft delegates to apt, which resolves virtual packages inconsistently across architectures and over time. Users should specify concrete packages instead of virtual ones in stage-packages.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.