Best way to solve "This part is missing libraries that cannot be satisfied with any available stage-packages known to snapcraft"

I am moving my snap from old version of snapcraft 2.43 to the new one 4.2 .

While creating the snap using snapcraft I get the following lines:

This part is missing libraries that cannot be satisfied with any available stage-packages known to snapcraft:
- usr/local/lib/libwiringPi.so
- usr/local/lib/libwiringPiDev.so
These dependencies can be satisfied via additional parts or content sharing. Consider validating configured filesets if this dependency was built.

And looking at the snap folder structure after installation the folder local is missing in the new one (which contains the libwiringPi.so and libwiringPiDev.so in the old one).

The error when the program is running

userName@nanopiduo2:~$ sudo smart-home 
    /snap/smart-home/x2/scripts/cScripts/phisicalComponents/sendingSignals/offSignal/turnOffWiringPiSetupPhys:
     error while loading shared libraries: libwiringPi.so: cannot open 
    shared object file: No such file or directory

snapcraft.yaml file:

name: smart-home
base: core20
version: '0.7'  # Just for humans, typically '1.2+git' or '1.3.2'
summary: The best app that I made.
description: |
  The best app smart home snap.

grade: devel  # stable
confinement: devmode  # use 'strict' once you have the right plugs and slot
#architectures: [all]
architectures:
  - build-on: armhf
    run-on: armhf

parts:
  smart-home:
    plugin: dump
    source: .
    build-attributes: [keep-execstack]
    override-build: |
      git clone https://github.com/guyluz11/WiringNP.git
      # git clone https://github.com/friendlyarm/WiringNP  // Does not work on the armbian os,  https://forum.armbian.com/topic/13889-nanopiduo2-wiringnp-unable-to-determine-board-revision/
      cd WiringNP/
      chmod 755 build
      ./build
      cd ..

      scripts/bashScripts/nativeExecutableMaker.sh  # Downloading dart-sdk for the correct architecture.

      cd scripts/bashScripts/
      ./compileAllCFiles.sh # Have to be executed when working directory is this file location
      cd ../..

      rm -r SmartDeviceDart

      snapcraftctl build

    build-packages:
      - wget
      - unzip
      - git
      - gcc
      - g++
      - make
      - libatlas-base-dev
      - libasound-dev
      #      - libblas3
      #      - libatlas3-base
      # - apt-get install g++ or avr-libc # stdint.h: No such file or directory
    stage-packages:
      - libatlas-base-dev
      - libevent-dev

apps:
  smart-home:
    command: main.exe $SNAP
    daemon: simple
    plugs: [network, network-bind, gpio, hardware-observe, audio-playback, audio-record, pulseaudio, alsa]

Here is a link of the project in case you need to take a look for more information.

What should I do in order to solve the This part is missing libraries that cannot be satisfied with any available stage-packages known to snapcraft.
Will adding part that will use the dump plugin will be enough, or there is bigger process that I miss.

i’d make wiringNP its own part and also make sure it gets installed to $SNAPCRAFT_PART_INSTALL/usr/lib/ (instead of usr/local/lib) …

same goes for the dart stuff, make it its own part, add proper part ordering with the after: directive …

all things you install in a part to $SNAPCRAFT_PART_INSTALL are available to the next part in order via the $SNAPCRAFT_STAGE dir …

3 Likes