Skip to content

snapcraft lint produces spurious warnings on core26 projects #6332

Description

@astrojuanlu

Check existing issues

  • 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:

build_base = providers.SNAPCRAFT_BASE_TO_PROVIDER_BASE["core22"]

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 [DPE-10579] Build MySQL 9.7 as snap mysql-snap#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

Log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions