Command: in manifest : please more documentation or examples

Manifest below.

I have had endless issues trying to find useful documentation regarding command: in the manifest. There is only one example on Building your first Flatpak - Flatpak documentation . And I rarely get it to work.

I almost inevitably get an “Error: Command ‘snis.sh’ not found”

I have tried different names, paths, everything I can think of.

It can’t be as hard as I am making it.

What am I missing?

Yes, the file snis.sh is in /app/bin/snis.sh

id: io.github.smcameron.space-nerds-in-space
runtime: org.freedesktop.Platform
runtime-version: "25.08"
sdk: org.freedesktop.Sdk
command: snis.sh

finish-args:
  - --socket=x11
  - --share=ipc
  - --device=dri
  - --share=network
  - --socket=pulseaudio

cleanup:
  - '/patches'

modules:

  # author prefers not to host asset binaries on git. So I host them.
  #This module removes the need to download many assets on the first run.
  - name: assets_not_hosted
    buildsystem: simple
    build-commands:
      - cp -R share ${FLATPAK_DEST}/share
      - cp -R patches ${FLATPAK_DEST}
    sources:
      - type: git
        url: https://github.com/vpelss/snis_flatpak.git
        commit: 3bb2936da03097a5ef8769f1819d8cbe92f140f4

  - name: portaudio
    buildsystem: cmake-ninja
    config-opts:
      - -DCMAKE_POLICY_VERSION_MINIMUM=3.5
    sources:
      - type: git
        url: https://github.com/PortAudio/portaudio.git
        tag: v19.7.0
        commit: 147dd722548358763a8b649b3e4b41dfffbcfbb6

  - name: nanotts_pico2wav
    buildsystem: simple
    build-commands:
      - patch svoxpico/picoapi.c  -i ${FLATPAK_DEST}/patches/picoapi_patch.txt
      - mkdir -p ${FLATPAK_DEST}/bin/lang
      - cd svoxpico; ./autogen.sh && ./configure --host `uname -m` && make -j
      - make
      -  install -Dm755 nanotts ${FLATPAK_DEST}/bin/nanotts
      - cp -R lang ${FLATPAK_DEST}/bin
    sources:
      - type: git
        url: https://github.com/gmn/nanotts.git
        commit: d8b91f3d9d524c30f6fe8098ea7a0a638c889cf9

  - shared-modules/lua5.3/lua-5.3.5.json
  - shared-modules/glu/glu-9.json
  - shared-modules/glew/glew.json

  - name: snis
    buildsystem: simple
    build-commands:
      - make install PREFIX=${FLATPAK_DEST} WITHVOICECHAT=yes
      - install -Dm0644 share/applications/${FLATPAK_ID}.svg "${FLATPAK_DEST}/share/icons/hicolor/scalable/apps/${FLATPAK_ID}.svg"
      - install -Dm0644 share/metainfo/${FLATPAK_ID}.metainfo.xml.template "${FLATPAK_DEST}/share/metainfo/${FLATPAK_ID}.metainfo.xml.template"
      - install -Dm0644 share/applications/${FLATPAK_ID}.desktop "${FLATPAK_DEST}/share/applications/${FLATPAK_ID}.desktop"
      #- install -Dm755 snis.sh ${FLATPAK_DEST}/bin/snis.sh
    sources:
      - type: git
        url: https://github.com/smcameron/space-nerds-in-space.git
        commit: 6e62b2100ccb7e91949c58868a658b882fabae3e

  - name: snis_sh
    buildsystem: simple
    build-commands:
      - install -Dm755 snis.sh ${FLATPAK_DEST}/bin/snis.sh
    sources:
      - type: script
        dest-filename: snis.sh
        commands:
          - cd /app/bin
          - exec ./snis_client --fullscreen --auto-download-assets

The command option should work with any executable binary in /app/bin.
In fact, building the manifest locally worked without issue.

What do you use to build the manifest?

If you’re not already using it, I’d recommend using the Flatpak of Flatpak Builder. See the Flathub documentation for the command recommended by us:

I had a sneaking suspicion that someone would come back and say it already works :slight_smile:

I have tried both:

flatpak run org.flatpak.Builder --user --force-clean --install-deps-from=flathub --repo=/home/adsiltia/snis_repo --state-dir=/home/adsiltia/.flatpak-builder --install /home/adsiltia/snis_builddir  /home/adsiltia/io.github.smcameron.space-nerds-in-space/io.github.smcameron.space-nerds-in-space.yml

and

flatpak run org.flatpak.Builder --user --force-clean /home/adsiltia/snis_builddir /home/adsiltia/io.github.smcameron.space-nerds-in-space/io.github.smcameron.space-nerds-in-space.yml

Funny thing is that the first one worked a few months ago…

Anything obviously wrong?

The only thing that seems off when I build is that there is no longer a /home/adsiltia/snis_repo created on the first one and I think there was in the past.

Would it be relevant that I am using WSL2? Hmmm. Maybe I should build and test on a linux PC.

Update. A new linux build (not wsl2) works with no errors.

Now to figure out what broke in my wsl2 setup. I know I have had to kill it and restart it in the task manger in the past to solve some odd behavior. But that did not solve this case. If / when I figure out what is going on, I will update.

A small win.

flatpak run org.flatpak.Builder --user --keep-build-dirs --force-clean --state-dir=/home/adsiltia/.flatpak-builder ~/snis_builddir ~/io.github.smcameron.space-nerds-in-space/io.github.smcameron.space-nerds-in-space.yml

failed repeatedly with “Error: Command ‘snis.sh’ not found”.

Then I tried

flatpak-builder --user --keep-build-dirs --force-clean --state-dir=/home/adsiltia/.flatpak-builder ~/snis_builddir ~/io.github.smcameron.space-nerds-in-space/io.github.smcameron.space-nerds-in-space.yml

and it works.

Then I tried the following again:

flatpak run org.flatpak.Builder --user --keep-build-dirs --force-clean --state-dir=/home/adsiltia/.flatpak-builder ~/snis_builddir ~/io.github.smcameron.space-nerds-in-space/io.github.smcameron.space-nerds-in-space.yml

and it worked.

That makes me think that “flatpak run org.flatpak.Builder” doesn’t have the same rights on my wsl2 ubuntu as flatpak-builder does. But where and why?

Using the org.flatpak.Hello document example, after successfully using the “flatpak-builder” (as mentioned above), then going back to “flatpak run org.flatpak.Builder” I get the following warning.

** (process:12905): WARNING **: 21:05:21.512: Unknown bus method ReloadConfig
Pruning cache

Might this hint at the issue using “flatpak run org.flatpak.Builder” using WSL2?