Skip to content

Conversation

@Zeglius
Copy link
Contributor

@Zeglius Zeglius commented Dec 28, 2025

Previously, the flatpak-builder action used hardcoded directories for the build output, local repository, and build state. This change introduces new input parameters to make these directories configurable:

  • 'build-dir': Specifies the directory for the application build output.
  • 'repo-name': Specifies the directory for the flatpak repository.
  • 'state-dir': Specifies the directory to store the build cache.

This flexibility is crucial for environments like GitHub Actions, where default working directories might have limited space. By allowing users to specify paths, they can leverage volume mountpoints (e.g., /mnt) that offer more disk space, preventing "running out of space" errors during the build process.

Previously, the flatpak-builder action used hardcoded directories for the build output, local repository, and build state. This change introduces new input parameters to make these directories configurable:

-   'build-dir': Specifies the directory for the application build output.
-   'repo-name': Specifies the directory for the flatpak repository.
-   'state-dir': Specifies the directory to store the build cache.

This flexibility is crucial for environments like GitHub Actions, where default working directories might have limited space. By allowing users to specify paths, they can leverage volume mountpoints (e.g., /mnt) that offer more disk space, preventing "running out of space" errors during the build process.

Signed-off-by: Zeglius <[email protected]>
@Zeglius
Copy link
Contributor Author

Zeglius commented Dec 28, 2025

An example of use would be:

jobs:
  flatpak:
    name: "Flatpak"
    runs-on: ubuntu-latest
    container:
      image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-48
      options: --privileged
      volumes:
        - /mnt/flatpak_workflow:/mnt/flatpak_workflow
    steps:
    - uses: actions/checkout@v4
    - uses: flatpak/flatpak-github-actions/flatpak-builder@v6
      with:
        bundle: palette.flatpak
        manifest-path: org.gnome.zbrown.Palette.yml
        cache-key: flatpak-builder-${{ github.sha }}
        build-dir: /mnt/flatpak_workflow/build-dir
        repo-name: /mnt/flatpak_workflow/repo
        state-dir: /mnt/flatpak_workflow/.flatpak-builder

@Zeglius Zeglius force-pushed the enable-custom-mountpoint branch from b880ab7 to fde823c Compare December 29, 2025 13:49
@bilelmoussaoui bilelmoussaoui merged commit 0a63139 into flatpak:master Dec 29, 2025
11 checks passed
@bilelmoussaoui
Copy link
Member

When i tested your patch at bilelmoussaoui/ashpd#322 i get the same limited space error (see https://github.com/bilelmoussaoui/ashpd/actions/runs/20575989270), any clues?

@Zeglius
Copy link
Contributor Author

Zeglius commented Dec 29, 2025

When i tested your patch at bilelmoussaoui/ashpd#322 i get the same limited space error (see bilelmoussaoui/ashpd/actions/runs/20575989270), any clues?

You forgot to mount a host volume, should be like this:

    container:
      # ...
      volumes:
        - /mnt/<whatever>:/mnt/<whatever>

The point of this PR was to allow using the hosts /mnt for the cache, which, for some reason, has a lot of free space in Github runners.
Without that volumes param, you will just end up using the default partition (roughly under /home (?), not exaclty sure) and more likely filling it up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants