Repository navigation
android: rebuild the drm artifacts on every package, and fail on a failed build - #34
Merged
Merged
Conversation
…iled build The freshness guard compared mtimes: it failed if any file under an artifact's crates was newer than the artifact itself. Ages answer the wrong question, and they did so in both directions the same day. It fired on a tree that was current. A branch switch rewrote modules/gndrm-android/Cargo.toml and modules/gndrm-daemon/Cargo.toml with byte-identical content, so they were newer than libgamenative_drm.so; cargo compares content hashes, correctly reported everything fresh, and left the artifact from three days before. The guard called it stale, and rerunning the package could never clear it because nothing rewrites an artifact that cargo considers current. The other direction was worse and silent: if a builder did not rewrite an artifact — because it failed, or because it skipped one — the old artifact was newer than the sources, so the guard passed and the payload carried it. A failed `build-android.sh` was not even checked; its exit code was ignored. So the artifacts are now always built by the run that packages them. The Rust side is forced to recompile by touching the workspace's own *.rs and Cargo.toml (third-party crates stay cached, which is what holds this to ~53 s; the C shim and the C++ engine rebuild unconditionally anyway), each builder's exit code is checked, and every shipped artifact must be newer than a mark taken before the builders ran. That is the only claim the guard needs to make: the payload carries what this run built. Cost: a package run goes from ~60 s to ~111 s on a warm tree. Verified: the reported failure (identical content, newer mtime) packages and exits 0; appending a syntax error to modules/gndrm-uapi/src/lib.rs exits 1 with "error: build-android.sh failed" instead of packaging the previous artifact; restoring the file and repacking exits 0. File: android/package-gamescope.sh (the freshness guard, the builder invocations and the artifact checks; check_fresh and its per-artifact source lists are gone).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
The payload's freshness guard compared mtimes: it failed if any file under an artifact's crates was newer than the artifact. Ages answer the wrong question, and they did so in both directions on the same day.
False positive, which is what started this. A branch switch rewrote
modules/gndrm-android/Cargo.tomlandmodules/gndrm-daemon/Cargo.tomlwith byte-identical content, so they were newer thanlibgamenative_drm.so; cargo compares content hashes, correctly reported everything fresh, and left the artifact from three days earlier. The guard called it stale — and rerunning the package could never clear it, because nothing rewrites an artifact that cargo considers current:False negative, which is worse and silent. If a builder did not rewrite an artifact — because it failed, or skipped one — the old artifact was newer than the sources, so the guard passed and the payload carried it. A failed
build-android.shwas not even checked: its exit code was ignored.Change
The artifacts are always built by the run that packages them:
*.rsandCargo.toml— third-party crates stay cached, which holds this to ~53 s; the C shim and the C++ engine rebuild unconditionally anyway;build-lsfg.sh,build-shim.sh,build-android.sh);libgndrm_shim.so,libgamenative_drm.so,libadrenotools_gamescope.so,liblsfg_engine.so) must be newer than a mark taken before the builders ran.That is the only claim the guard has to make: the payload carries what this run built.
check_freshand its per-artifact source lists are gone.Cost: a package run goes from ~60 s to ~111 s on a warm tree (measured; 53 s of it the forced drm rebuild).
Verified
gndrm-uapi/src/lib.rserror: build-android.sh failedFile
android/package-gamescope.shonly — the builder invocations, the freshness guard, and the artifact checks.