Can't push because of symlinked libslang.so

I can build my snap, and run it locally, but when I push it I get the error

Error while processing...
The store was unable to accept this snap.
  - package contains external symlinks: usr/lib/x86_64-linux-gnu/libslang.so

So I included
- libslang2-dev
in the yaml file (just guessing) but that doesn’t help. I built my snap under Ubuntu 18.04 using core18. When I interrogate my Ubuntu 18.04 thus I get:

ll /snap/andy-testsnap-py/x1/usr/lib/x86_64-linux-gnu/libslang.so
lrwxrwxrwx 1 root root 35 Feb 24  2018 /snap/andy-testsnap-py/x1/usr/lib/x86_64-linux-gnu/libslang.so -> /lib/x86_64-linux-gnu/libslang.so.2

if that is of any help. Any ideas how I can resolve this error and successfully push? My full yaml file is:

name: andy-testsnap-py # you probably want to 'snapcraft register <name>'
version: '0.5.1' # just for humans, typically '1.2+git' or '1.3.2'
summary: Single-line elevator pitch for your amazing snap # 79 char long summary
description: |
  This is my-snap's description. You have a paragraph or two to tell the
  most important story about your snap. Keep it under 100 words though,
  we live in tweetspace and your description wants to look good in the snap
  store.

grade: devel # must be 'stable' to release into candidate/stable channels
confinement: strict # use 'strict' once you have the right plugs and slots
base: core18

apps:
    andy-testsnap-py:
        command: desktop-launch python3 $SNAP/usr/bin/testsnap.py
        plugs: [x11, unity7, pulseaudio, home, gsettings, network]
        environment:
            LD_LIBRARY_PATH: $LD_LIBRARY_PATH:$SNAP/usr/lib/x86_64-linux-gnu/pulseaudio

parts:
  desktop-gtk3:
    build-packages:
    - build-essential
    - libgtk-3-dev
    make-parameters:
    - FLAVOR=gtk3
    plugin: make
    source: https://github.com/ubuntu/snapcraft-desktop-helpers.git
    source-subdir: gtk
    stage-packages:
    - libxkbcommon0
    - ttf-ubuntu-font-family
    - dmz-cursor-theme
    - light-themes
    - adwaita-icon-theme
    - gnome-themes-standard
    - shared-mime-info
    - libgtk-3-0
    - libgdk-pixbuf2.0-0
    - libglib2.0-bin
    - libgtk-3-bin
    - unity-gtk3-module
    - libappindicator3-1
    - locales-all
    - xdg-user-dirs
    - ibus-gtk3
    - libibus-1.0-5
    - fcitx-frontend-gtk3
  andy-testsnap-py:
    # See 'snapcraft plugins'
    plugin: python
    python-version: python3
    source: .
    stage-packages:
        # - libc6
        - libssl-dev
        - libjpeg-dev
        - libtiff-dev
        - libsdl1.2-dev
        - libnotify-dev
        - freeglut3
        - ibus-gtk3
        - libwebkitgtk-3.0-0
        - zlib1g
        - libsm6
        - libpulse0
        - libcanberra-gtk-module
        - libslang2-dev
    #after: [desktop-gtk3]
    python-packages:
        #- https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-18.04/wxPython-4.0.4-cp37-cp37m-linux_x86_64.whl
        - https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-18.04/wxPython-4.0.4-cp36-cp36m-linux_x86_64.whl
    override-build: |
        snapcraftctl build
        cp $SNAPCRAFT_PART_SRC/testsnap.py $SNAPCRAFT_PART_INSTALL/usr/bin/
        chmod +x $SNAPCRAFT_PART_INSTALL/usr/bin/testsnap.py

the problem is that the symlink points to /lib/...; it’s external to the snap.

Is there something I can do to fix this situation?

As I said, I already tried including libslang2-dev in the list of “stage-packages” but that didn’t help. Is there something else I can add to “stage-packages” to make this work?

This simple demo project builds and pushes ok in plain 16.04 without the core18 approach (albeit changing the Python and wxPython to lower versions).

The fix for this was to add

libslang2

(not libslang2-dev)

into the list of “stage-packages”.

After rebuilding, I was then able to push to the store OK.

1 Like