← Back to issue list

component does not take snap version when no version provided

View original Github issue

Metadata

Project
snapcraft
Number
#5115
Type
issue
State
open
Author
stephensp
Labels
Status: Triaged Type: Enhancement
Created
Updated
Closed
—

Current evaluation

Component version inheritance was triaged as an enhancement; maintainers adopted component-level adopt-info, and follow-up #5240 was closed after implementation merged in canonical/snapcraft#5753.

Suggested action: close resolved

Reason: The maintainer explicitly selected component-level adopt-info as the strategy and linked it to follow-up #5240. The tracker records #5240 as closed and states that component version adoption was implemented and merged via canonical/snapcraft#5753, addressing the request through explicit adoption rather than implicit inheritance.

Evaluated by: mr-cal-bot

Impact: 45 Quick Win: 19 Complexity: 55 Confidence: 97 Actionability: 92

Issue body

### Bug Description component does not take snap version when no version provided as is defined by the spec "A component might have an optionally set version. Snapcraft will have mechanisms to set this." ### To Reproduce 1. Build a snap + component when no component version is provided. Component version can be deleted from: https://git.launchpad.net/~portias/+git/kernel-snaps-u24.04/tree/snapcraft.yaml?h=portias/pc-components 2. The version of the component is <comp_name>_.comp instead of <comp_name>_.comp ### Environment This reproduces on any environment. ### snapcraft.yaml ```yaml name: pc-kernel adopt-info: kernel grade: stable summary: Ubuntu generic kernel description: The Ubuntu generic kernel package as a snap source-code: https://git.launchpad.net/~canonical-kernel-snaps/canonical-kernel-snaps/+git/kernel-snaps-u24.04 issues: https://bugs.launchpad.net/canonical-kernel-snaps/+filebug?field.tags=pc-kernel contact: https://answers.launchpad.net/canonical-kernel-snaps/+addquestion type: kernel confinement: strict build-base: core24 platforms: amd64: arm64: components: nvidia-550-ko: type: test summary: nvidia 550 kernel objects description: nvidia 550 kernel objects nouveau: type: test summary: nouveau kernel module description: nouveau kernel module parts: kernel: source: https://git.launchpad.net/canonical-kernel-snaps source-type: git source-branch: main plugin: nil build-packages: - kmod stage-packages: - linux-image-uc-generic override-build: | echo BULID # Determine version and 'uname -r' unamer=$(basename "$CRAFT_PART_INSTALL"/lib/modules/*) version="$(apt show linux-image-uc-"$unamer" 2>/dev/null | sed -n 's/^Version: //p' | head -n1)" # Set the snap package version craftctl set version=$version # Update depmod /usr/sbin/depmod -b "$CRAFT_PART_INSTALL" "$unamer" craftctl default # Move nouveau out of the file tree find "$CRAFT_PART_INSTALL" -name nouveau.ko.zst -exec mv '{}' "$CRAFT_PART_INSTALL" \; # Move nouveau into a dedicated component organize: nouveau.ko.zst: (component/nouveau)/ override-stage: | echo STAGE # Determine 'uname -r' unamer=$(basename "$CRAFT_PART_INSTALL"/lib/modules/*) # Move modules mv "$CRAFT_PART_INSTALL"/lib/modules "$CRAFT_PART_INSTALL"/ # Copy firmware "$CRAFT_PART_SRC"/copy-firmware -m "$CRAFT_PART_INSTALL"/modules/"$unamer" -f "$CRAFT_PART_INSTALL"/lib/firmware \ "$CRAFT_PART_INSTALL"/_tmp # Move the dtbs if [ -d "$CRAFT_PART_INSTALL"/lib/firmware/"$unamer" ] ; then mv "$CRAFT_PART_INSTALL"/lib/firmware/"$unamer" "$CRAFT_PART_INSTALL"/_tmp/lib/firmware/ fi mv "$CRAFT_PART_INSTALL"/_tmp/lib/firmware "$CRAFT_PART_INSTALL"/ # Move boot files mv "$CRAFT_PART_INSTALL"/boot/System.map-"$unamer" "$CRAFT_PART_INSTALL"/ mv "$CRAFT_PART_INSTALL"/boot/config-"$unamer" "$CRAFT_PART_INSTALL"/ mv "$CRAFT_PART_INSTALL"/boot/kernel.efi-"$unamer" "$CRAFT_PART_INSTALL"/kernel.efi # Move docs mv "$CRAFT_PART_INSTALL"/usr/share/doc "$CRAFT_PART_INSTALL"/ # Clean up remaining stage package files rm -rf "$CRAFT_PART_INSTALL"/{_tmp,boot,lib,usr} # Create compat symlink for installing headers on classic ln -s /usr/src/linux-headers-"$unamer" "$CRAFT_PART_INSTALL"/modules/"$unamer"/build # Create a mountpoint for firmware updates (LP: #2051144) mkdir "$CRAFT_PART_INSTALL"/firmware/updates craftctl default #TODO temporary workaround for nouveau hooks not being in canonical-kernel-snaps repo nouveau-scripts: source: ./component-hooks plugin: nil override-build: | craftctl default cp install.sh remove.sh $CRAFT_PART_INSTALL #duplicate install.sh as a post refres hook cp install.sh $CRAFT_PART_INSTALL/post-refresh.sh organize: install.sh: (component/nouveau)/snap/hooks/install post-refresh.sh: (component/nouveau)/snap/hooks/post-refresh remove.sh: (component/nouveau)/snap/hooks/remove files: plugin: dump source: files nvidia-550-ko-comp: source: ./component-hooks plugin: nil stage-packages: - binutils - make override-build: | craftctl default version="$(craftctl get version)" #clean up unnecessary libs rm -f -- $CRAFT_PART_INSTALL/usr/lib/$(uname -m)-linux-gnu/libc.so.6 apt-get download linux-objects-nvidia-550-server-${version%.*}-generic \ linux-signatures-nvidia-${version%.*}-generic for i in `find . -name '*.deb'` ; do dpkg-deb -x $i nvidia-objects ; done mkdir -p $CRAFT_PART_INSTALL/bits mv nvidia-objects/lib/modules/*/kernel/nvidia-550srv/bits/* $CRAFT_PART_INSTALL/bits # Reuse the install hook as the post-refresh hook cp link-and-install.sh $CRAFT_PART_INSTALL/post-refresh.sh cp link-and-install.sh $CRAFT_PART_INSTALL/install.sh cp remove.sh $CRAFT_PART_INSTALL/remove.sh organize: bits/: (component/nvidia-550-ko)/bits usr/bin: (component/nvidia-550-ko)/bin usr/lib: (component/nvidia-550-ko)/lib install.sh: (component/nvidia-550-ko)/snap/hooks/install post-refresh.sh: (component/nvidia-550-ko)/snap/hooks/post-refresh remove.sh: (component/nvidia-550-ko)/snap/hooks/remove ``` ### Relevant log output ```shell None. ``` ### Additional context _No response_

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 45
Quick Win: 19
Complexity: 55
Confidence: 97
Actionability: 92
close resolved Component version inheritance was triaged as an enhancement; maintainers adopted component-level adopt-info, and follow-up #5240 was closed after implementation merged in canonical/snapcraft#5753.
stealth/space-bunny-alpha
Impact: 52
Quick Win: 21
Complexity: 57
Confidence: 93
Actionability: 94
close resolved Component version adoption was implemented through per-component adopt-info, superseding the original request for automatic snap-version inheritance.
qwen/qwen3.6-35b-a3b
Impact: 70
Quick Win: 22
Complexity: 60
Confidence: 90
Actionability: 80
close resolved Components should inherit snap version when no version is provided. Resolved by implementing adopt-info for components via PR #5753.
qwen/qwen3.8-27b
Impact: 50
Quick Win: 22
Staleness: 25
Complexity: 55
Confidence: 72
Support Request: 5
keep open Component version not inherited from snap when no explicit version is set. Triaged as enhancement; fix planned via component-level adopt-info support, scheduled for 25.10 cycle. Component adopt-info now appears in docs and code.
qwen/qwen3.6-35b-a3b
Staleness: 45
Complexity: 60
Confidence: 90
Support Request: 10
keep open Component version inheritance from snap version when not explicitly set. Issue is triaged with a planned implementation strategy relying on `adopt-info` support for components in a future release cycle.
qwen3.6-35b-a3b-mtp-q6
Staleness: 50
Complexity: 60
Confidence: 90
Support Request: 5
keep open Enhancement to make components inherit the snap version when unspecified. Triaged and acknowledged; maintainers plan to implement via adopt-info support in a future release cycle.

Update history

No update history recorded yet.

Related work

  • Superseded By: snapcraft#5240 (confidence 99%)

    The maintainer moved the requested versioning behavior to the component adopt-info analogue tracked in #5240.

  • Likely Fixed By: canonical/snapcraft#5753 (confidence 97%)

    The #5240 tracker summary identifies this merged PR as the implementation of component version adoption.

Related issues

Issue Project State Summary Similarity
#5240 Add `adopt-info` analogue for components snapcraft closed Implemented component version adoption via merged PR #5753 (commits 6b6f7d9ee, 766562286), allowing craftctl to set component versions in Snapcraft 8.13.
73%
#2080695 `adopt-info:` for components snapcraft (launchpad) closed Feature request for adopting component versions via adopt-info was implemented in canonical/snapcraft PR #5753 (commits 6b6f7d9ee, 766562286), letting craftctl set component metadata. ClOSED as completed by ~mr-cal.
71%