Snap a simple Silk.net application

Dear all, i am trying since 2 days to snap a simple silk.net application. The source code is copied from Hello Window | Silk.NET. Goal should be to develop the application on my host (Ubuntu 22) and to use it on my ubuntu core 22 system with ubuntu frame / wayland. Both system arch. are x64.

My dotnet application is working perfect if I run it with “dotnet run” on my host. I solved a lot of issue to get it snapped but if I start the snap on my host I’m at a point where I can’t go any further.

I build, install and start the snap like this:

snapcraft clean
snapcraft --use-lxd --debug
sudo snap install *.snap --devmode --dangerous
sudo silk-test

I get following error message:

silk-test: ./src/window.c:533: glfwSetWindowPos: Assertion `window != NULL' failed.
Aborted (core dumped)

This is my current yaml:

name: silk-test
base: core22
version: '0.1'
summary: Single-line elevator pitch for your amazing snap
description: |
  This is my-snap's description. 
grade: devel
confinement: devmode

architectures:
  - build-on: [amd64]
    build-for: [amd64]

parts:
  silk-test:
    plugin: dotnet
    dotnet-build-configuration: Release
    dotnet-self-contained-runtime-identifier: linux-x64
    source: .
    build-packages:
      - dotnet-sdk-8.0
    stage-packages:
      - libicu70
      - libgl1-mesa-dri
      - libwayland-client0
      - libglfw3
      - libglfw3-dev
      - libglfw3-wayland
      - libwayland-egl1-mesa
      - libwayland-cursor0
      - libwayland-server0
      - libxkbcommon0
      - libxkbcommon-x11-0
      - libegl1
      - xkb-data
      - libx11-xcb1
      - libglu1-mesa
     
apps:
  silk-test:
    command: silk-test
    environment:
      WAYLAND_DISPLAY: wayland-0
      SDL_VIDEODRIVER: wayland
      XDG_RUNTIME_DIR: /run/user/1000
      XKB_DEFAULT_RULES: evdev
      XKB_CONFIG_ROOT: $SNAP/usr/share/X11/xkb
      XLOCALEDIR: $SNAP/usr/share/X11/locale
      LIBGL_DRIVERS_PATH: $SNAP/usr/lib/x86_64-linux-gnu/dri
      LD_LIBRARY_PATH: "$SNAP/usr/lib/x86_64-linux-gnu:$SNAP/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH"

    plugs: 
      - opengl
      - desktop
      - desktop-legacy
      - unity7
      - x11
      - wayland
      - network
      - network-bind
      - home

I guess something is missing.

First strange thing is that the linter says that libglfw.so.3.3’ is unused but as far I understood I need this lib for silk.net.

Second point I struggle is the missing dependency liblttng-ust.so.0 because I have already installed :slight_smile:

sudo ldconfig -p | grep "libl"
        liblz4.so.1 (libc6,x86-64) => /lib/x86_64-linux-gnu/liblz4.so.1
        liblzo2.so.2 (libc6,x86-64) => /lib/x86_64-linux-gnu/liblzo2.so.2
        liblzma.so.5 (libc6,x86-64) => /lib/x86_64-linux-gnu/liblzma.so.5
        liblzma.so (libc6,x86-64) => /lib/x86_64-linux-gnu/liblzma.so
  ->      liblttng-ust.so.1 (libc6,x86-64) => /lib/x86_64-linux-gnu/liblttng-ust.so.1
    ->    liblttng-ust.so (libc6,x86-64) => /lib/x86_64-linux-gnu/liblttng-ust.so
        liblttng-ust-tracepoint.so.1 (libc6,x86-64) => /lib/x86_64-linux-gnu/liblttng-ust-tracepoint.so.1
      ..
      ..

Lint warnings:

Maybe somebody can help me

Regards

This sounds extreme, but give a go :slight_smile:

Remove the entirety of your stage packages except for .NET Runtime itself Edit: including .NET because you didn’t have it to begin with - since you’re using static .NET binaries.

Remove the entirety of your environment definitions.

Then replace these with this line:

apps:
  silk-test:
    extensions: [gnome]

Which does those and more. Try snapcraft clean to reset the build environment, then try build and run it again, hopefully there’ll be significantly less errors, it might even be functional.

https://snapcraft.io/docs/gnome-extension