provide support for use of DEB_HOST_MULTIARCH in environment variables

Bug #1723945 reported by James Page on 2017-10-16
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd
Medium
Unassigned

Bug Description

For the gnocchi snap, I need to tweak the LD_LIBRARY_PATH to include:

  $SNAP/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/ceph

as the ceph packages are sourced from the archive, rather than being built directly into the snap (thus avoiding long build times).

I'm using:

  environment:
    LD_LIBRARY_PATH: $LD_LIBRARY_PATH:$SNAP/usr/lib/x86_64-linux-gnu/ceph

for testing, but that's obviously not architecture nice; it would be good if snaps automatically exposed some common architecture specific variables to the snap env so that I can just do

  environment:
    LD_LIBRARY_PATH: $LD_LIBRARY_PATH:$SNAP/usr/lib/$DEB_HOST_MULTIARCH/ceph

Kyle Fazzari (kyrofa) wrote :

Snapd defines SNAP_ARCH with deb architectures instead of triplets. Without it defining triplets for you, you cannot use LD_LIBRARY_PATH the way you're doing it now, since the snapcraft-defined stuff is evaluated too late. You can use a remote part as well as a wrapper to get close.

Build the part in question `after: [snap-arch-triplet-generator]`. Then if you make your app look something like this:

app:
  foo:
    command: with_snap_arch_triplet <actual command>

Your command will get $SNAP_ARCH_TRIPLET defined. Note that this will not apply to the `environment` keyword as that's consumed by snapd, but if you create a wrapper for your <actual command> you can set the LD_LIBRARY_PATH there.

That's the best we can do from Snapcraft. I'm going to move this issue over to snapd to see what they think.

affects: snapcraft → snapd
Michael Vogt (mvo) on 2018-01-09
Changed in snapd:
status: New → Triaged
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers