fix(flatpak): prune microsoft/windows-rs git crates before vendoring

The flatpak CI was failing at "Downloading sources" with "No space left
on device": flatpak-cargo-generator walks the whole workspace Cargo.lock
and emits a `type: git` source for the windows-rs crates (windows +
windows-reactor + ~12 sub-crates, pinned by punktfunk-client-windows),
and flatpak-builder then FULL-clones that multi-GB repo — for a bundle
that only ever compiles `-p punktfunk-client-linux` and never touches a
windows-* crate.

New packaging/flatpak/prune-windows-lock.py writes a copy of Cargo.lock
with the windows-rs git packages stripped (matches on the `source =`
line, so a crate that merely lists a windows dependency is kept;
dependency-free so it also runs on the Deck's stock python). Both the CI
and build-flatpak.sh feed that pruned lock to the generator. The
committed Cargo.lock is untouched — cargo --offline only needs vendored
sources for the crates it actually builds, and the windows-rs crates are
not in the Linux client's dependency closure.

Verified locally: 14 crates pruned (507 -> 493 packages), zero windows-rs
`source =` lines remain, output parses as TOML, all Linux-client deps
(gtk4/ffmpeg-sys-next/sdl3/pipewire) intact.

This unblocks the flatpak build carrying the VAAPI green-screen fix
(a89b19a) for the Steam Deck.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-17 07:43:11 +00:00
parent 80075dcbe8
commit 4df35bd026
3 changed files with 64 additions and 2 deletions
+4 -1
View File
@@ -65,7 +65,10 @@ else
fi
# Needs python3 + aiohttp + tomlkit. On a host that lacks them (e.g. the Deck), generate on the
# Mac / a dev box instead and rsync the result next to the manifest (reused by the branch above).
python3 "$GEN" Cargo.lock -o packaging/flatpak/cargo-sources.json
# Prune the microsoft/windows-rs git crates first (punktfunk-client-windows only) — otherwise
# flatpak-builder full-clones that multi-GB repo and fills the disk. See prune-windows-lock.py.
python3 packaging/flatpak/prune-windows-lock.py Cargo.lock /tmp/Cargo.flatpak.lock
python3 "$GEN" /tmp/Cargo.flatpak.lock -o packaging/flatpak/cargo-sources.json
fi
# --- build into a local ostree repo, then export a single-file bundle --------------------