← 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` on core26 projects produces spurious warnings because the lint command hardcodes 'core22' as the build base for the linting instance, causing GLIBC version mismatches.

Suggested action: close not a bug

Reason: The issue describes a bug where `snapcraft lint` hardcodes 'core22' as the build base, causing spurious warnings on core26 projects. However, PR #6272 ('fix(linters): pass build_base to linters and avoid hardcoded fallback') has already been merged, which addresses this exact hardcoded fallback issue. The issue is effectively resolved by this recent fix.

Impact: 70 Quick Win: 42.0 Staleness: 10 Complexity: 40 Confidence: 85 Support Request: 0

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
qwen3.6-35b-a3b-mtp-q6
Impact: 70
Quick Win: 42.0
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

No update history recorded yet.

Related work

  • Likely Fixed By: snapcraft#6272 (confidence 90%)

    PR #6272 fixes the hardcoded core22 fallback in linters by passing the build_base parameter, which directly addresses the root cause of the spurious warnings on core26 projects.

Related issues

No related issues found above the similarity threshold.