numpy is used within my snap and is no longer installing all of the components the same way with the update to snapcraft.
I tracked it to the libblas3 package, which uses update-alternatives to place the symlink /usr/lib/libblas.so.3 to /etc/alternatives/libblas.so.3. This file is no longer being packaged into the snap causing numpy, and any code depending on it, to not run when run from within the snap.
Below is the postinst from the libblas3_3.6.0-2ubuntu2_amd64.deb file
#! /bin/sh
set -e
update-alternatives --install /usr/lib/libblas.so.3 libblas.so.3 /usr/lib/libblas/libblas.so.3 10
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
exit 0
An example snapcraft.yaml
name: update-alts
version: '0.1' # just for humans, typically '1.2+git' or '1.3.2'
summary: snap for the update-alternatives issue demo
description: |
Demo snapcraft.yaml to show update-alternatives issue.
grade: devel # must be 'stable' to release into candidate/stable channels
confinement: devmode
parts:
bar-base:
plugin: catkin-tools
rosdistro: kinetic
# source: catkin_ws
stage-packages: [
libblas3
]
apps:
bash:
command: bash
It looks like the issue is the way update-alternatives uses a hard path to /usr/lib/libblas.so.3 without a prefix allowing for installation in an alternate location.
It would be simple enough to add another part or organize the files to fix this in the short term. But I’m wondering what the correct long term fix and just making sure this is known and that other snaps could be affected since it used to work and still does in older versions of snapcraft.
Should snapcraft go back to handling this, does the libblass3 package need to be modified to allow for installation in other locations, or should I add a part that places these missing files in the correct location after the part handling their install is done?