Lint Warning with dotnet-sdk-8.0

Hello everyone,
on Xubuntu 24.04, I’m trying to create a snap application from a minimal .NET 8.0 project using GtkSharp. The project was generated from the GtkSharp template, a sort of HelloWorld.

Repository: TestGtkSharp

In my snapcraft.yaml file, the dotnet plugin is based on core22 (as the dotnet plugin is, at this time, temporarily disabled for core24).

name: testgtksharp
version: '0.1'
base: core22
grade: devel
confinement: devmode
summary: Snap a GtkSharp application
description: |
  This is my-snap's description.

parts:
  testgtksharp:
    plugin: dotnet
    dotnet-build-configuration: Release
    dotnet-self-contained-runtime-identifier: linux-x64
    source: .
    build-packages:
      - dotnet-sdk-8.0
apps:
  testgtksharp:
    extensions: [gnome]
    command: TestGtkSharp

Building the snap is successful but Lint generates a warning:

$ snapcraft --debug
Generated snap metadata
Lint warnings:
- library: libcoreclrtraceptprovider.so: missing dependency 'liblttng-ust.so.0'. (https://snapcraft.io/docs/linters-library)
Created snap package testgtksharp_0.1_amd64.snap

I installed the snap with:

sudo snap install testgtksharp_0.1_amd64.snap --devmode --dangerous

Then I run it, and all seems to work fine.
I’m planning to generate a snap for another of my real application that displays the same warning, I don’t know if the warning can cause program instability. A web search shows that this is not a new problem.
What can be done to remove it ?

liblttng-ust is in the liblttng-ust1 package which you could add to your part with a stage-packages entry, but I fear there is no such ancient version of it in the archive as your binary looks for, so it might or might not work to quieten the linter message

@ogra: thanks for your answer.
Yes I tried to add liblttng-ust1 as stage-packages, but the available version is liblttng-ust.so.1, while the need is liblttng-ust.so.0.
With:

stage-packages:
      - liblttng-ust1

What I get:

Lint warnings:
- library: libcoreclrtraceptprovider.so: missing dependency 'liblttng-ust.so.0'. (https://snapcraft.io/docs/linters-library)
- library: liblttng-ust-ctl.so.5: unused library 'usr/lib/x86_64-linux-gnu/liblttng-ust-ctl.so.5.0.0'. (https://snapcraft.io/docs/linters-library)
- library: liblttng-ust-cyg-profile-fast.so.1: unused library 'usr/lib/x86_64-linux-gnu/liblttng-ust-cyg-profile-fast.so.1.0.0'. (https://snapcraft.io/docs/linters-library)
- library: liblttng-ust-cyg-profile.so.1: unused library 'usr/lib/x86_64-linux-gnu/liblttng-ust-cyg-profile.so.1.0.0'. (https://snapcraft.io/docs/linters-library)
- library: liblttng-ust-dl.so.1: unused library 'usr/lib/x86_64-linux-gnu/liblttng-ust-dl.so.1.0.0'. (https://snapcraft.io/docs/linters-library)
- library: liblttng-ust-fd.so.1: unused library 'usr/lib/x86_64-linux-gnu/liblttng-ust-fd.so.1.0.0'. (https://snapcraft.io/docs/linters-library)
- library: liblttng-ust-fork.so.1: unused library 'usr/lib/x86_64-linux-gnu/liblttng-ust-fork.so.1.0.0'. (https://snapcraft.io/docs/linters-library)
- library: liblttng-ust-libc-wrapper.so.1: unused library 'usr/lib/x86_64-linux-gnu/liblttng-ust-libc-wrapper.so.1.0.0'. (https://snapcraft.io/docs/linters-library)
- library: liblttng-ust-pthread-wrapper.so.1: unused library 'usr/lib/x86_64-linux-gnu/liblttng-ust-pthread-wrapper.so.1.0.0'. (https://snapcraft.io/docs/linters-library)

Heh, yeah, as suspected (and it added even more noise)

You could either build it from upstream source in its own part with the expected old version or simply override the linter warning in your snapcraft.yaml if the lib is not actually used by your binaries …

I’m going to try the 2nd solution because my dotnet projects work fine without being packaged in snap, and even packaged in AppImage format, while liblttng-ust.so.0 is not present, and the dotnet publish command doesn’t generate any warnings.

So, as explained in the doc, I try to ignore the file with:

lint:
  ignore:
    - library:
      - /usr/lib/**/liblttng-ust.so*

but the warning is still present. What am I doing wrong ?

You need to list the lib that causes the message, not the lib from the message output :wink:

Try libcoreclrtraceptprovider.so* instead… (And indeed make sure the path actually matches the location within the snap)

I can’t find the right way.
The file libcoreclrtraceptprovider.so is located in /usr/lib/dotnet/shared/Microsoft.NETCore.App/8.0.15/ and in /snap/testgtksharp/current/ which should correspond to $SNAP ?
I’ve tried all these paths but it fails.

/usr/lib/dotnet/shared/Microsoft.NETCore.App/8.0.15/libcoreclrtraceptprovider.so*
$SNAP/libcoreclrtraceptprovider.so*
/snap/testgtksharp/current/libcoreclrtraceptprovider.so*
$SNAP_LIBRARY_PATH/libcoreclrtraceptprovider.so*

You need to suppress $SNAP and the first slash (take another look at the doc example I linked), the path needs to be relative to the top level of the snap… If it actually lives in the very top level of your snap you don’t need any path at all and just the filename…

It’s ok, the warning has disappeared.
Thanks for your help.

As suggested by @ogra, It works by adding in snapcraft.yaml:

lint:
  ignore:
    - library:
      - libcoreclrtraceptprovider.so*
1 Like