fix: install flatpak tooling on Ubuntu CI runners to fix spawn flatpak ENOENT#593
Conversation
Agent-Logs-Url: https://github.com/docmirror/dev-sidecar/sessions/91a7df2e-c37b-4875-8223-06bf12be4fa6 Co-authored-by: cute-omega <[email protected]>
spawn flatpak ENOENT
|
Merge the origin/master branch, in which it has solved C++ 17 problems. Then you can make a new commit to trigger the CI/CD. @copilot |
…build-flatpak-tooling Co-authored-by: cute-omega <[email protected]>
Done — merged |
There was a problem hiding this comment.
Pull request overview
This PR fixes Ubuntu CI failures when electron-builder attempts to build the Flatpak target by ensuring the required Flatpak tooling is installed on Ubuntu GitHub Actions runners before npm run electron:build.
Changes:
- Add an Ubuntu-only step to install
flatpakandflatpak-builder(plus supporting packages) before the Electron build. - Print
flatpakandflatpak-builderversions in CI logs to aid troubleshooting. - Apply the same fix consistently across both CI workflows that run
npm run electron:build.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
.github/workflows/test-and-upload.yml |
Installs Flatpak tooling on Ubuntu runners immediately before npm run electron:build and prints versions. |
.github/workflows/build-and-release.yml |
Mirrors the same Ubuntu-only Flatpak tooling install/version logging step for consistency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ak builds Agent-Logs-Url: https://github.com/docmirror/dev-sidecar/sessions/0dcd8216-cd79-4fbe-81d3-5d9a91acbdad Co-authored-by: cute-omega <[email protected]>
…ilds Agent-Logs-Url: https://github.com/docmirror/dev-sidecar/sessions/c6fd9c27-0b2c-4c22-b81d-841fee506390 Co-authored-by: cute-omega <[email protected]>
… Ubuntu 24.04 Agent-Logs-Url: https://github.com/docmirror/dev-sidecar/sessions/4e70ef25-82cd-4930-afbb-57a4430fa246 Co-authored-by: cute-omega <[email protected]>
… debug output Agent-Logs-Url: https://github.com/docmirror/dev-sidecar/sessions/66295aec-d09e-4a8b-bb58-6c3e3bc916b4 Co-authored-by: cute-omega <[email protected]>
|
Why doesn't it trigger any CI/CD? Although the target branch of this PR has changed in order not to mess master branch up, CI/CD is still needed. |
|
…his PR Agent-Logs-Url: https://github.com/docmirror/dev-sidecar/sessions/244d9c03-0157-46b8-860f-1952b4c51276 Co-authored-by: cute-omega <[email protected]>
The CI wasn't triggering because the |
…uirements Agent-Logs-Url: https://github.com/docmirror/dev-sidecar/sessions/67d78beb-71d3-4ec7-9b9f-4066b30332aa Co-authored-by: cute-omega <[email protected]>
…ze is 512x512 Agent-Logs-Url: https://github.com/docmirror/dev-sidecar/sessions/323c45be-6aa2-4c95-8f8c-b3c193d7515f Co-authored-by: cute-omega <[email protected]>
…tpak build Agent-Logs-Url: https://github.com/docmirror/dev-sidecar/sessions/2fef6935-b1fb-4f10-9d08-51afd56dd541 Co-authored-by: cute-omega <[email protected]>
…n instead Agent-Logs-Url: https://github.com/docmirror/dev-sidecar/sessions/e98bf7c7-efc0-4c19-a3cb-e959631cbff3 Co-authored-by: cute-omega <[email protected]>
Add 'fix*' branch pattern to trigger workflows
dev-sidecar→cn.docmirror.DevSidecar)flatpak: { icon: ... }block fromvue.config.js(unsupported by electron-builder)build/mac/1024x1024.png(Flatpak max icon size is 512x512; the directory-based icon config doesn't support per-target overrides)Original prompt
Create a PR that fixes the failing GitHub Actions job in docmirror/dev-sidecar run https://github.com/docmirror/dev-sidecar/actions/runs/24313663002/job/70987606718?pr=592.
Failure: ubuntu build step
npm run electron:buildfails withspawn flatpak ENOENTduring electron-builder flatpak target packaging. The workflow.github/workflows/test-and-upload.yml(commit ref 91d8ed5) currently does not install flatpak tooling.Implement Option A:
.github/workflows/test-and-upload.ymlto install required flatpak tooling on Ubuntu runners before thenpm run electron:buildstep.flatpakandflatpak-builder(e.g.,flatpak --versionandflatpak-builder --version).Additionally:
Acceptance criteria:
spawn flatpak ENOENT.The following is the prior conversation context from the user's chat exploration (may be truncated):
User: Please find a solution for this failing job. Use the logs, job definition, and any referenced files where the failure occurred. Keep your response focused on the solution and include code suggestions when appropriate.
Assistant: The job is failing during the Linux (ubuntu-latest) Electron build when
electron-buildertries to create a Flatpak package, but the runner doesn’t have theflatpakbinary installed.What failed (from logs)
The build reaches the Flatpak target and then dies with:
NestedError: Cannot cleanupError: spawn flatpak ENOENTThat error means: the process tried to execute
flatpak, but it’s not on PATH.Where it’s triggered (workflow)
In
.github/workflows/test-and-upload.yml(ref:91d8ed568ec805b0170607be09ebb2b962ad1bca), the Linux build step runs:npm run electron:build(inpackages/gui)…and later the workflow expects
.flatpakartifacts to exist and uploads them. So Flatpak is intended to be produced on Ubuntu, but the environment isn’t prepared for it.Solution options (pick one)
Option A (recommended): Install Flatpak on Ubuntu before building
Add a step before
npm run electron:buildthat installs Flatpak (and typicallyflatpak-buildertoo).Patch for
.github/workflows/test-and-upload.yml(ref:91d8ed568ec805b0170607be09ebb2b962ad1bca), insert before the"npm run electron:build"step:This resolves
spawn flatpak ENOENTby ensuring the binary exists on the runner.Option B: Disable Flatpak output in CI (if Flatpak isn’t required)
If you don’t need Flatpak artifacts from CI, change your Electron build config (likely in
packages/guielectron-builder config) to not build theflatpaktarget on Linux, and remove/guard the Flatpak rename + upload steps in the workflow.A minimal workflow-only mitigation (keeps build working, skips upload failures) would be to remove these Linux lines:
mv ...-x86_64.flatpak,...-arm64.flatpak,...-armv7l.flatpakUpload ... .flatpakstepsBut note: this does not fix the build itself if electron-builder is still configured to produce Flatpak; it just avoids expecting the files. To truly fix, you must also stop electron-builder from attempting Flatpak.
Why this is the correct fix
The failure is not a JS/TS code issue; it’s a missing system dependency on
ubuntu-latest.electron-builderinvokes external tooling for some targets (Flatpak being one of them). Installing the required OS packages (Option A) aligns the runner environment with what the build expects and should make the Ubuntu job succeed without changing your app code.User: Try your option A. After installing flatpak tools, show flatpak and flatpak-builder's version. Make a pull request for it. You may need to edit all relative files not only
test-and-upload.ymlAssistant: I’ve initiated the pull request workflow to add an Ubuntu-only step that installs Flatpak + flatpak-builder and prints both versions, and we’re now waiting for your confirmation in the approval dialog to proceed with creating the PR and applying the changes.
This pull request was created from Copilot chat.