Create snap from only binary files

I have a directory of binary files I want to wrap in a Snap to install. The snap folder and release folder are next to each other:

project
  release
  snap

Following the documentation I have a yaml that includes:

parts:
  myBinary:
    plugin: nil
    filesets:
       thefiles: [ ./Release/* ]

The files in the Release folder are not getting copied into the Snap. What needs to be done to include binary files in a Snap? How do I enable trace logging to see what snapcraft is doing?

  • try using the dump plugin
  • make sure your capitalization is correct (release vs Release above), case sensitivity is essential …
parts
  myBinary:
    plugin: dump
      source: release

… should help …

Thank you! So it appears the snap is now created.

‘dump’, really, the documentation is not clear as to what this does.

When I launch the snap I get:

Failed to install file: not supported

In what log file do I go look at to start to understand what this means?

well, it might help if you share your snapcraft.yaml and also be a bit more verbose …

what exactly did you do to “launch the snap” step by step …

It is installing, I did the command line:

snap install …

Didn’t realize you had to use the command line.

so did the install finish or not ? how did you launch the snap after you installed it ?

Yes, it is installed.
Right now I have to launch it directly, the .desktop file is not correct.

this is not getting anywhere if you do not give a lot more information … so lets try again…

instead of “i launch it directly”, can you give me some more hints and i.e. run the app in a terminal, wait til it errors, then copy/paste the whole content from where you started the app (with the full command you used) to the point when the cursor returned ?

or take a screenshot of the terminal or something like that …

it is hard to help you if you give information in small drips with a pipette like that and i lent my crystal ball to someone else recently :slight_smile:

I’m going to mark this thread solved. I was able to package up the binary and get it installed.

It has running issues (font issue, png issue, desktop icon) and I will start new threads for them.

Here is the Snap to package my Qt6 binary:

name: my_binary
base: core20
version: '2.1.0'
summary: Test plan
description: |
  Software used to create multiple plans. 

grade: devel
confinement: devmode
architectures:
  - build-on: amd64
  
parts:
  my_binary:
    plugin: dump
    source: Release
    stage-packages:
      - libpng16-16
      - libgl1
      - libegl1-mesa
      - libfontconfig1
      - libfreetype6
      - libatk1.0-0
      - libgdk-pixbuf2.0-0
      - libgtk-3-0
      - libpango-1.0-0
      - libpangocairo-1.0-0
      - libxcb-icccm4
      - libxcb-image0
      - libxcb-keysyms1
      - libxcb-randr0
      - libxcb-render0
      - libxcb-render-util0
      - libxcb-shape0      
      - libxkbcommon0
      - libxkbcommon-x11-0
      
apps:
  my_binary:
    command: my_binary  
    desktop: my_binary.desktop     

Here is my .desktop file

[Desktop Entry]
Type=Application
Version=2.1.0
Name=My Binary
GenericName="My Binary"
Icon=MyBinary_256.png
Comment=Predict success
Exec="my_binary"
Terminal=false

Installed via command line by:

sudo snap install --dangerous --devmode my_binary.snap

try this to get the fonts and png issues solved:

name: my_binary
base: core20
version: '2.1.0'
summary: Test plan
description: |
  Software used to create multiple plans. 

grade: devel
confinement: devmode
architectures:
  - build-on: amd64
  
parts:
  my_binary:
    plugin: dump
    source: Release
      
apps:
  my_binary:
    command: my_binary  
    extensions: [gnome-3-38]
    desktop: my_binary.desktop     

ah, yes adding

extensions: [gnome-3-38]

solved the bad blank fonts, a png load issue, and the “Show All Applications” blank launch icon issue.

2 Likes