Remote parts don't seem to work in snapcraft 3.0

Bug #1800057 reported by Alan Pope 🍺🐧🐱 🦄
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Snapcraft
Won't Fix
Undecided
Unassigned

Bug Description

I've got a yaml which has after: [desktop-gtk2], and an apps stanza which has "desktop-launch foo". When building snapcraft errors with.

Failed to generate snap metadata: The specified command 'desktop-launch' defined in the app 'snes9x-gtk' does not exist or is not executable.
Ensure that 'desktop-launch' is relative to the prime directory.

I'm doing this inside multipass if that matters, and it's a core18 based snap.

name: snes9x
version: '1.56.2' # just for humans, typically '1.2+git' or '1.3.2'
summary: Super NES Emulator
description: |
  Snes9x is a portable, freeware Super Nintendo Entertainment System (SNES)
  emulator. It basically allows you to play most games designed for the SNES
  and Super Famicom Nintendo game systems on your PC or Workstation; they
  include some real gems that were only ever released in Japan.

base: core18

grade: stable
confinement: strict

apps:
  snes9x-gtk:
    environment:
      "LD_LIBRARY_PATH": "$LD_LIBRARY_PATH:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio"
    command: desktop-launch $SNAP/bin/snes9x-gtk
    plugs:
      - x11
      - network
      - network-bind
      - joystick
      - home
      - pulseaudio
      - removable-media
parts:
  snes9x:
    after: [desktop-gtk2]
    source: https://github.com/snes9xgit/snes9x.git
    plugin: autotools
    source-tag: '1.56.2'
    build-packages:
      - libsdl1.2-dev
      - libboost-thread-dev
      - libboost-system-dev
      - libsdl-ttf2.0-dev
      - libasound2-dev
      - zlib1g-dev
      - libpng-dev
      - xorg-dev
      - libpulse-dev
      - libx11-dev
      - libxml2-dev
      - portaudio19-dev
      - intltool
      - libgtk-3-dev
      - libminizip-dev
      - libsdl2-dev
    stage-packages:
      - pulseaudio-utils
      - libpulse0
    override-build: |
      cd gtk
      autoreconf --install
      intltoolize --force
      ./configure
      make
      cp -a snes9x-gtk $SNAPCRAFT_PART_INSTALL/bin

Revision history for this message
Lucy Llewellyn (lucyllewy) wrote :

It's because you've set a `base:`. When you do so, snapcraft thinks you want the "new world order" which doesn't include remote parts. There are two solutions depending on requirements:

1. If the application works against libraries in xenial then remove `base: core18`.
2. Otherwise, you need to add the remote part definition into the `snapcraft.yaml`:

```yaml
  desktop-gtk2:
    source: https://github.com/ubuntu/snapcraft-desktop-helpers.git
    source-subdir: gtk
    plugin: make
    make-parameters: ["FLAVOR=gtk2"]
    build-packages:
      - build-essential
      - libgtk2.0-dev
    stage-packages:
      - libxkbcommon0 # XKB_CONFIG_ROOT
      - ttf-ubuntu-font-family
      - dmz-cursor-theme
      - light-themes
      - adwaita-icon-theme
      - gnome-themes-standard
      - shared-mime-info
      - libgtk2.0-0
      - libgdk-pixbuf2.0-0
      - libglib2.0-bin
      - libgtk2.0-bin
      - unity-gtk2-module
      - locales-all
      - libappindicator1
      - xdg-user-dirs
      - ibus-gtk
      - libibus-1.0-5
```

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

This is by design, extensions or adding the part into the snapcraft.yaml at hand are the migration path.

Changed in snapcraft:
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.