Need help debugging why my flatpak build is not working

I am working on build a flatpak for the open source software BOINC. It is used by scientists to distribute computational workloads to the computers of volunteers. I think I got the entire build process down right, but I can’t seem to actually run the app due to a missing file error.

I’m guessing this is an easy fix, but I have googled and chatgptd to no avail. Any help would be greatly appreciated.

In my build directory I have a file org.thesciencecommons.boinc.yml with the contents:

app-id: org.thesciencecommons.boinc
runtime: org.freedesktop.Platform
runtime-version: '23.08'
sdk: org.freedesktop.Sdk
runtime: org.freedesktop.Platform.GL
runtime: org.freedesktop.Platform.GL.nvidia
runtime: org.freedesktop.Platform.GL.mesa-git
runtime: org.freedesktop.Platform.GL.default
runtime: org.freedesktop.Platform.VAAPI.Intel
command: boincmgr
finish-args:
  # X11 + XShm access
  - --share=ipc
  - --socket=fallback-x11
  # Wayland access
  - --socket=wayland
  # Needs to talk to the network:
  - --share=network
  # Needs to save files locally
  #- --filesystem=xdg-documents
  #- --metadata=X-DConf=migrate-path=/org/gnome/dictionary/
 # GPU acceleration
  - --device=dri
modules:
  ##### freeglut and libXmu needed for projects that display graphics
  ##### https://boinc.berkeley.edu/trac/wiki/GraphicsApi#api
  - name: libnotify
    buildsystem: meson
    sources:
      - type: git
        url: https://gitlab.gnome.org/GNOME/libnotify.git
    config-opts:
      - -Dtests=false
      - -Dman=false
      - -Dgtk_doc=false
      - -Ddocbook_docs=disabled
  - name: glu
    buildsystem: meson
    sources:
      - type: archive
        url: https://archive.mesa3d.org/glu/glu-9.0.3.tar.xz
        sha256: bd43fe12f374b1192eb15fe20e45ff456b9bc26ab57f0eee919f96ca0f8a330f
    cleanup: 
      - /include
      - /lib/*.a
      - /lib/*.la
      - /lib/pkgconfig
  - name: freeglut
    buildsystem: cmake-ninja
    sources:
      - type: archive
        url: https://github.com/FreeGLUTProject/freeglut/releases/download/v3.4.0/freeglut-3.4.0.tar.gz
        sha256: 3c0bcb915d9b180a97edaebd011b7a1de54583a838644dcd42bb0ea0c6f3eaec
    cleanup:
      - /include
  - name: libXmu
    sources:
      - type: archive
        url: https://www.x.org/releases/individual/lib/libXmu-1.1.4.tar.gz
        sha256: 3091d711cdc1d8ea0f545a13b90d1464c3c3ab64778fd121f0d789b277a80289
    cleanup:
      - /include
      - /share
  - name: wxWidgets
    buildsystem: cmake-ninja
    sources:
      - type: git
        url: https://github.com/wxWidgets/wxWidgets.git
        tag: v3.2.2.1
        commit: a812fffda3fe686c94e24bff27e8effd96e4de64
    cleanup:
      - /bin
      - /include
      - /share
      - /lib/wx/include
  #####
  - name: boinc
    buildsystem: autotools
    make-install-args:
      - DESTDIR=${FLATPAK_DEST}
      - prefix=
      - exec_prefix=
    sources:
      - type: git
        url: https://github.com/BOINC/boinc.git
      ### Patch to change 2 prefs - workaround the broken simple GUI and exit the boinc client when boincmgr closes
      - type: file
        path: org.thesciencecommons.boinc.metainfo.xml
     # - type: patch
     #   path: change-application-defaults.patch
      - type: shell
        commands:
          - ./_autosetup
    config-opts:
      - --disable-server
      - --disable-fcgi
    post-install:
      ### Overwrite BOINCDIR or else it will warn that it can't find gui_rpc_auth.cfg
      - sed -i 's:#BOINCDIR=/var/lib/boinc:BOINCDIR=/:' ${FLATPAK_DEST}/etc/boinc-client.conf
      - install -Dm644 clientgui/res/boinc.svg ${FLATPAK_DEST}/share/icons/hicolor/scalable/apps/${FLATPAK_ID}.svg
      - install -Dm644 clientgui/res/boinc.desktop ${FLATPAK_DEST}/share/applications/${FLATPAK_ID}.desktop
      - install -Dm644 org.thesciencecommons.boinc.metainfo.xml ${FLATPAK_DEST}/share/metainfo/${FLATPAK_ID}.metainfo.xml
      - desktop-file-edit --remove-key=Path ${FLATPAK_DEST}/share/applications/${FLATPAK_ID}.desktop
      - desktop-file-edit --set-icon=${FLATPAK_ID} ${FLATPAK_DEST}/share/applications/${FLATPAK_ID}.desktop
    cleanup:
      - /usr

This builds without any significant errors with flatpak-builder --user --install --force-clean build-dir org.thesciencecommons.boinc.yml however when I try a flatpak run org.thesciencecommons.boinc I get the error bwrap: execvp /bin/boincmgr: No such file or directory

I have gotten a shell within the flatpak with flatpak run --command=sh --devel org.thesciencecommons.boinc and have verified that there is a file at /app/bin/boincmgr as expected. And I can successfully run it from within the shell, but I can’t get it to run with flatpak run I have also tried specifying absolute and relative paths in my flatpak run command with no change in results.

Why can’t flatpak see this binary?

I think the wrong runtime gets set. flatpak-builder seems to take the last value which is in your case runtime: org.freedesktop.Platform.VAAPI.Intel but this is just a extension to the runtime. Remove all but runtime: org.freedesktop.Platform.

All the extensions you’ve listed already get downloaded & activated if the system requires them (see Freedesktop Platform metadata & Flatpak metadata under [Extension NAME]).

At least in my test flatpak fails with a similar error if the wrong runtime is set:

flatpak run --runtime=org.freedesktop.Platform.GL.default//23.08 org.gnome.Evolution
bwrap: execvp evolution: No such file or directory

If there’s still some issue you could try to run your application with flatpak run --verbose.

That was exactly the problem, thank you!!