Issue priming python snap

Every time I try to package a specific snap, socli-snap, I get this error whenever in the priming stage: https://pastebin.com/RiJtBNCF. This happens in both Ubuntu 16.04 and Lubuntu 17.10.

Any ideas on what’s going on here? Thanks in advance for any help you can provide!

This is a conflict between the file you’ve specified to be the application command and a directory which exists in your final filesystem.

You have in your snapcraft.yaml:

apps:
  socli:
    command: socli

With this configuration snapcraft will look for prime/socli which it finds, but when it comes to actually collecting the executable it discovers that it’s a directory and throws it’s arms in the air.

There are three solutions:

  1. replace the command with bin/socli as that is the actual location of your command,
  2. move the folder called socli from your snap’s root directory. This can be achieved with organize:, or
  3. do not stage the offending directory.

Example 1.

apps:
  socli:
    command: bin/socli # ensure we reference the correct socli executable

Example 2.

parts:
  socli:
    source: https://github.com/gautamkrishnar/socli.git
    plugin: python
    organize:
      socli: usr/share/socli # move the socli directory out of the way

Example 3.

parts:
  socli:
    source: https://github.com/gautamkrishnar/socli.git
    plugin: python
    stage:
      - -socli # do not stage the socli directory
1 Like

Fantastic! Didn’t know such an issue could happen. Thanks for your tremendously great help!