← Back to issue list

`snapcraft lint` produces spurious warnings on core26 projects

View original Github issue

Metadata

Project
snapcraft
Number
#6332
Type
issue
State
open
Author
astrojuanlu
Labels
—
Created
Updated
Closed
—

Current evaluation

`snapcraft lint` hardcodes a core22 build instance, so linting core24/core26 snaps gives spurious glibc errors and unused-library warnings. Root cause confirmed in code; maintainer's fix PR #6448 was closed unmerged, so the bug persists.

Suggested action: keep open

Reason: Root cause is verified in the source: snapcraft/commands/lint.py sets `build_base = providers.SNAPCRAFT_BASE_TO_PROVIDER_BASE["core22"]` unconditionally when preparing the lint instance, so every lint run uses core22 regardless of the snap's base, producing the reported GLIBC_PRIVATE/glibc 2.42 errors and bogus 'unused library' warnings. Maintainer wak327 explicitly acknowledged the hardcoded core22 and opened PR #6448 to launch an instance matching the snap's base, but that PR was closed without merge after 2 days with zero reviewers, so the bug is not resolved. The issue is valid and still reproducible, so it must stay open; the only remaining friction is that any new attempt must also handle unsupported bases falling back to core22 and the separate Multipass-provider block (craft-providers#169).

Evaluated by: mr-cal-bot

Impact: 55 Quick Win: 26 Complexity: 40 Confidence: 88 Actionability: 78

Issue body

### Check existing issues - [x] I've verified that this bug isn't described by any existing issues. ### Bug description I've observed that `snapcraft lint` gives errors and warnings that aren't shown during `snapcraft pack`. In my case: ``` ... /bin/bash: symbol lookup error: /snap/core26/current/lib/x86_64-linux-gnu/libc.so.6: undefined symbol: __tunable_is_initialized, version GLIBC_PRIVATE /bin/bash: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.42' not found (required by /snap/core26/current/lib/x86_64-linux-gnu/libtinfo.so.6) /bin/bash: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.38' not found (required by /snap/core26/current/lib/x86_64-linux-gnu/libtinfo.so.6) /bin/bash: symbol lookup error: /snap/core26/current/lib/x86_64-linux-gnu/libc.so.6: undefined symbol: __tunable_is_initialized, version GLIBC_PRIVATE /bin/bash: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.42' not found (required by /snap/core26/current/lib/x86_64-linux-gnu/libtinfo.so.6) /bin/bash: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.38' not found (required by /snap/core26/current/lib/x86_64-linux-gnu/libtinfo.so.6) /bin/bash: symbol lookup error: /snap/core26/current/lib/x86_64-linux-gnu/libc.so.6: undefined symbol: __tunable_is_initialized, version GLIBC_PRIVATE /bin/bash: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.42' not found (required by /snap/core26/current/lib/x86_64-linux-gnu/libtinfo.so.6) /bin/bash: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.38' not found (required by /snap/core26/current/lib/x86_64-linux-gnu/libtinfo.so.6) Lint warnings: - library: libcurl.so.4: unused library 'usr/lib/x86_64-linux-gnu/libcurl.so.4.8.0'. (https://documentation.ubuntu.com/snapcraft/stable/how-to/debugging/use-the-library-linter) - library: libevent_core-2.1.so.7: unused library 'usr/lib/x86_64-linux-gnu/libevent_core-2.1.so.7.0.1'. (https://documentation.ubuntu.com/snapcraft/stable/how-to/debugging/use-the-library-linter) - library: libfido2.so.1: unused library 'usr/lib/x86_64-linux-gnu/libfido2.so.1.16.0'. (https://documentation.ubuntu.com/snapcraft/stable/how-to/debugging/use-the-library-linter) - library: libicuio.so.78: unused library 'usr/lib/x86_64-linux-gnu/libicuio.so.78.2'. (https://documentation.ubuntu.com/snapcraft/stable/how-to/debugging/use-the-library-linter) - library: libicutest.so.78: unused library 'usr/lib/x86_64-linux-gnu/libicutest.so.78.2'. (https://documentation.ubuntu.com/snapcraft/stable/how-to/debugging/use-the-library-linter) ... ``` Apparently this is because `core22` is hardcoded: https://github.com/canonical/snapcraft/blob/429f628949378c1c93434e8805310818e53ac752/snapcraft/commands/lint.py#L164 So `snapcraft lint` will always use it, regardless of the base of the `.snap` being linted. I tried to "run snapcraft lint on destructive mode" but I don't see the corresponding flag. ### Steps to reproduce - Run `snapcraft pack` for a core26 snap, for example https://github.com/canonical/mysql-snap/pull/34. Lint is executed as part of the pack, and no warnings are given about missing libraries. - Run `snapcraft lint` for that same snap. Chances are lots of warnings on unused libraries are raised, plus other warnings and errors. ### Environment I'm running Snapcraft 9.0.1 inside a Multipass VM with Ubuntu 24.04 while packing a core26 snap. ### snapcraft.yaml ```yaml ``` ### Log output ```shell ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 55
Quick Win: 26
Complexity: 40
Confidence: 88
Actionability: 78
keep open `snapcraft lint` hardcodes a core22 build instance, so linting core24/core26 snaps gives spurious glibc errors and unused-library warnings. Root cause confirmed in code; maintainer's fix PR #6448 was closed unmerged, so the bug persists.
stealth/space-bunny-alpha
Impact: 50
Quick Win: 32
Complexity: 25
Confidence: 90
Actionability: 85
keep open `snapcraft lint` always launches a core22 build environment (hardcoded at snapcraft/commands/lint.py:164), so linting core24/core26 snaps yields spurious unused-library warnings and glibc errors. Fix is in open PR #6448.
stealth/space-bunny-alpha
Impact: 55
Quick Win: 30
Complexity: 38
Confidence: 95
Actionability: 88
needs triage Snapcraft 9.0.1 runs core26 snap linting in a hard-coded core22 environment, causing GLIBC failures and spurious unused-library warnings absent from pack; no maintainer triage yet.
qwen3.6-35b-a3b-mtp-q6
Impact: 70
Quick Win: 42
Staleness: 10
Complexity: 40
Confidence: 85
Support Request: 0
close not a bug `snapcraft lint` on core26 projects produces spurious warnings because the lint command hardcodes 'core22' as the build base for the linting instance, causing GLIBC version mismatches.
qwen/qwen3.6-35b-a3b
Staleness: 15
Complexity: 45
Confidence: 85
Support Request: 10
needs triage snapcraft lint produces spurious warnings on core26 projects due to hardcoded core22 base in lint.py. Issue reported 12 days ago, no maintainer response yet.
qwen3.6-35b-a3b-mtp-q6
Staleness: 5
Complexity: 20
Confidence: 90
Support Request: 5
needs triage snapcraft lint generates spurious warnings for core26 projects due to a hardcoded core22 base in lint.py. Issue is fresh, unlabelled, and awaiting maintainer review.

Update history

Date Change
updated

Related work

  • Related To: canonical/snapcraft#6448 (confidence 92%)

    PR 'fix(lint): lint snaps in a build environment matching their base' targets exactly this hardcoded core22, but was closed without merge, so it does not resolve the issue.

  • Blocked By: craft-providers#169 (confidence 70%)

    lint.py raises "'snapcraft lint' is not supported with Multipass as the build provider", a related constraint a new fix must consider when changing instance base selection.

Related issues

Issue Project State Summary Similarity
#4751 Use `ld` from the base snap for library linting snapcraft open Triaged enhancement to make snapcraft lint resolve libraries with the target base snap's dynamic linker instead of host ldd, preventing spurious core24/core26 warnings; the TODO remains in current code.
73%