Flathub build fails because of "No such file or directory" error

Hi, I’m having a problem with building my Flathub submission here. The build fails because of the following error:

install: cannot stat ‘icons/icon.svg’: No such file or directory

Now the source for the build is a zip file downloaded from Github which contains an “icon” folder containing a file called “icon.svg” and other png files.

To install the icons I am using the following commands:

    - install -Dm644 icons/icon.svg /app/share/icons/hicolor/scalable/apps/com.github.scrivanolabs.scrivano.svg
    - install -Dm644 icons/scrivano_64.png /app/share/icons/hicolor/64x64/apps/com.github.scrivanolabs.scrivano.png
    - install -Dm644 icons/scrivano_128.png /app/share/icons/hicolor/128x128/apps/com.github.scrivanolabs.scrivano.png
    - install -Dm644 icons/scrivano_256.png /app/share/icons/hicolor/256x256/apps/com.github.scrivanolabs.scrivano.png
    - install -Dm644 icons/scrivano_512.png /app/share/icons/hicolor/512x512/apps/com.github.scrivanolabs.scrivano.png

The build (see here) successfully copies the png icons but somehow when copying the svg icon triggers an error.

Locally everything installs correctly using the following command:

flatpak-builder --user --install --force-clean build-dir com.github.scrivanolabs.scrivano.yml

Does anyone has any clue on what might be the issue here?

Ok someone in the flatpak matrix channel pointed out that I accidentally changed the directory structure of the sources and this was the problem. It appears, for some unknown reasons, that the Flathub builder relies on the files in the sources to be contained in a folder (i.e. the zip file should contain all the files inside some folder, instead of the files being in the root directory).
Not exactly why this is the case and why the PNG icons were installed correctly, while the SVG file had trouble. However, restoring the previous directory has fixed my issue.

1 Like