Skip to content

Makefile: device-control goals keep a release-built pkg/plxnative - #991

Merged
GLinnik21 merged 3 commits into
mainfrom
tools/kill-keeps-release-binary
Oct 24, 2026
Merged

GLinnik21 merged 3 commits into
mainfrom
tools/kill-keeps-release-binary

Conversation

@GLinnik21

@GLinnik21 GLinnik21 commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

What

Adds the goals that only drive the television to SIDE_EFFECT_FREE in the Makefile: kill, run, run-stream, verify-deploy, uninstall, fetch-profile, softfloat-probe. Each has tv-lock-require as its one prerequisite and an ssh/scp recipe, so none builds or ships anything. deploy, install, test and all are deliberately not added: they build the binary, so they must stamp.

Why (the observed failure, twice in one day)

make ARM_PROFILE=release builds pkg/plxnative and writes the stamp pkg/.build-config. tools/tv-session.sh then closes the app with make -C "$REPO" FLAVOR="$FLAVOR" kill (relaunch() and the down path), and tests/run.py runs make kill / run / run-stream. None of them pass an ARM_PROFILE, so RUST_CFG gains +profile:tvdev, differs from the release stamp, and (because the goal is not in SIDE_EFFECT_FREE) the parse-time reset runs: rm -f pkg/plxnative pkg/plxnative-storage .../avformat.h pkg/lib*-plx.so.* pkg/.ffabi-ok and the stamp is rewritten to the tvdev configuration. kill builds nothing, yet the next tv-session.sh up died on no pkg/plxnative -- run make.

Test (red, then green)

ci/test_arm_profile.py (already a make check gate) gets DeviceControlGoalsKeepTheBuild. It builds a scratch tree (symlinks to the checkout's Makefile/ci//tools/, but REAL pkg/ and vendor/ directories, so the reset can never delete the checkout's own binary or FFmpeg header sentinel), seeds it with a real make ARM_PROFILE=release stamp plus release outputs, then parses each goal with make -n and a documentation-range placeholder TV. The reset runs at parse time, so a dry run reaches it and no recipe (no ssh) ever runs. It asserts every planted file survives and the stamp is byte-identical. clean is the control that must still reset; print-appid is the already-exempt goal that must pass.

Before the Makefile change:

FAIL: test_goals_that_only_drive_the_tv_keep_a_release_build (...DeviceControlGoalsKeepTheBuild) [kill]
FAIL: ... [run]
FAIL: ... [run-stream]
FAIL: ... [verify-deploy]
FAIL: ... [uninstall]
FAIL: ... [fetch-profile]
FAIL: ... [softfloat-probe]
AssertionError: ... : make kill deleted a release build's files
Ran 10 tests in 6.608s
FAILED (failures=7)

After:

Ran 10 tests in 3.938s
OK

ci/test_tv_session.py (44 tests), ci/test_build_bench.py (44), ci/test_tv_ssh.py (24) and ci/test_deploy_manifest.py (5) also pass. make check was not run locally (the machine is congested); CI gates it.

Notes

  • deploy invokes verify-deploy as a sub-make, so that sub-make can no longer delete the binary it was just asked to check.
  • docs/agent-reference.md said a bare make run after make SYMBOLS=1 deploy deletes pkg/plxnative; that is no longer true, so the sentence now names make deploy.
  • Known callers with the same failure that this PR does NOT cover: make mali-irq-sample (tests/run.py's MaliIrqSampler, tools/profile-graphics) and make plxnative-stackwalk (tools/plxnative-sample). They build standalone ARM helpers into pkg/ (not the app), so they are not "builds nothing"; whether they should join the list is a separate call.
  • make build-bench was not run: this adds goals to a parse-time list and changes no build rule, dependency or flag, so it cannot move a build time.

Extended to every host-only goal (f3b1d40). The same trap hit make test-crate C=plx_gfx on 2026-10-24: it deleted a release-built pkg/plxnative and rewrote the stamp to +profile:tvdev, though it only builds and runs one crate's lib tests in rust-modules/target-fast. The Makefile comment above SIDE_EFFECT_FREE now states the rule: a goal is listed when it builds, reads and ships nothing the stamp describes (not pkg/plxnative, not the ARM library, nothing staged under pkg/), whether it only drives the TV (above) or is host-only. Added: test-fast, test-crate, lint, check-cargo-lint, check-cargo-unit-hostsim, check-localization, check-c-unit, check-python-harness, notices, notices-verify, setup-rust, setup-env, disk-watch, disk-watch-uninstall, fixtures, fixtures-quick, fixtures-pipeline, demo-library, sim-token, sim-macos-token, sim-clean, sim-macos-clean, tv-lock-require, and four print-* queries QUERY_GOALS never listed (print-subs-font-files, print-rust-toolchain, print-rust-codegen, print-cargo-env). Left out on purpose: check, check-unlocked, check-python, check-python-rest and check-cargo (mixes: a step re-runs make on $(RUST_LIB) / pkg/plxnative-storage goals, and every $(MAKE) re-parses with the reset), check-cargo-unit-default (reads pkg/plxnative-storage), the build/ship goals and the pkg/-staging host builds. ci/test_arm_profile.py gains HostOnlyGoalsKeepTheBuild (each added goal keeps a seeded release stamp under make -n, red for test-crate before the Makefile change and green after, plus a pinned list of goals that must stay out) and docs/agent-reference.md states the rule. make check on f3b1d40: all 106 steps ok, including ci/test_arm_profile.py.

No linked issue.

🤖 Generated with Claude Code

`tools/tv-session.sh` closes the app with `make -C $REPO FLAVOR=... kill`, and tests/run.py runs
`make kill`, `run` and `run-stream`, none of them with an ARM_PROFILE. After a
`make ARM_PROFILE=release` build that is a different configuration from the stamp
(`+profile:tvdev` against none), and because these goals were not in SIDE_EFFECT_FREE the
Makefile's parse-time reset deleted pkg/plxnative, the staged FFmpeg libraries and the header
sentinel, and rewrote pkg/.build-config. `kill` builds nothing; the next `tv-session.sh up` then
died on "no pkg/plxnative -- run make". Seen twice in one day.

Add the goals that only drive the television to SIDE_EFFECT_FREE: kill, run, run-stream,
verify-deploy, uninstall, fetch-profile, softfloat-probe. Each has `tv-lock-require` as its only
prerequisite and an ssh/scp recipe. `deploy` and `install` stay out: they build and ship.

ci/test_arm_profile.py gets the regression test. It seeds a scratch tree with a real
`ARM_PROFILE=release` stamp and release outputs, then parses each goal with `make -n` (the reset
runs at parse time, so a dry run reaches it and no recipe runs) and asserts nothing was deleted and
the stamp is byte-identical. `clean` is the control that must still reset it. The scratch tree has
real pkg/ and vendor/ directories so the reset can never delete the checkout's own files.

docs/agent-reference.md said a bare `make run` after `make SYMBOLS=1 deploy` deletes the binary;
it now names `make deploy`, which does.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
GLinnik21 added a commit that referenced this pull request Oct 24, 2026
## What broke

#981 (65e976b) added `rust-modules/gfx/src/shaders/fs_ramp.frag`, whose line-8 comment spells the dev-trigger name `plxnative-hwcnt`. `glsl!` embeds a shader source whole (`concat!(include_str!(..), "\0")`, comments included; nothing strips them), so the name was compiled into the binary. The Nightly workflow's `make ipk` step then failed `ci/check-package.py`'s packaged-binary scan:

`the com.beb.plxnative.nightly package carries no dev-trigger surface ... (found plxnative-hwcnt)`

(seen on PR #991's "ARM build + gates / build + verify" job). #981's only other `plxnative-hwcnt` is a plain `//` comment in `gfx.rs`, which is not compiled in.

## The fix

- `fs_ramp.frag`: line 8 now reads `(HWCNT, 2026-10-24)` instead of naming the trigger. A comment only, so the compiled program is unchanged.
- New test `gfx::tests::no_shader_source_names_a_dev_trigger` reads EVERY file under `rust-modules/gfx/src/shaders/` (it lists the directory, so a new shader is covered by being added; that is the only `shaders/` directory in the tree) and fails on any `plxnative-`. The scan matches the dev-trigger catalog's names (`dev.rs` `DIAG` + `devtrig.rs` `CONTROLLED`, minus the release-legitimate allowlist); the test matches the whole prefix, a superset that nothing in a shader needs, and the failure message says why.

## Red / green

Red, before the reword (`make test-crate C=plx_gfx T=no_shader_source_names_a_dev_trigger`):

```
test gfx::tests::no_shader_source_names_a_dev_trigger ... FAILED
.../rust-modules/gfx/src/shaders/fs_ramp.frag:8: // arithmetic words (`plxnative-hwcnt`, 2026-10-24) where one `mix` is 1-1.5: the three uniform
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 163 filtered out; finished in 0.00s
```

Green, after:

```
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 163 filtered out; finished in 0.00s
```

Whole crate (`make test-crate C=plx_gfx`): `test result: ok. 164 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out`. `make check-nodef` passes. Full `make check` is left to CI.

No linked issue.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
GLinnik21 and others added 2 commits October 24, 2026 15:30
`make test-crate C=plx_gfx` after a `make ARM_PROFILE=release` build deleted pkg/plxnative and
rewrote pkg/.build-config to `features:+profile:tvdev+tel:...` (2026-10-24). The goal builds and
runs one crate's lib tests in rust-modules/target-fast and never produces or reads pkg/plxnative;
`test-hostsim` and `check-nodef` had been listed in SIDE_EFFECT_FREE and it was missed.

The list now follows a rule instead of a memory of which goals were reported: a goal is listed when
it builds, reads and ships nothing the stamp describes (pkg/plxnative, the ARM library, anything
staged under pkg/), judged from the recipe and its prerequisites. Added, host-only: test-fast,
test-crate, lint, check-cargo-lint, check-cargo-unit-hostsim, check-localization, check-c-unit,
check-python-harness, notices, notices-verify, setup-rust, setup-env, disk-watch,
disk-watch-uninstall, fixtures, fixtures-quick, fixtures-pipeline, demo-library, sim-token,
sim-macos-token, sim-clean, sim-macos-clean, and tv-lock-require beside the TV-control goals.
print-subs-font-files, print-rust-toolchain, print-rust-codegen and print-cargo-env were queries
that QUERY_GOALS never listed, so `make -s print-rust-toolchain` reset a release build as readily
as a compile did; they join it.

Left out, each for a reason the Makefile comment now gives: deploy/install/ipk/symbols*/libass/
sentry-native build or ship the binary; the host simulators, check-ass, check-ffmpeg and macapp stage
host libraries into pkg/; the ARM probes write pkg/; telemetry-local writes pkg/telemetry.local.json,
an input of the stamp; `check` is a mix (ci/test_disk_preflight.py runs `make -n` of the ARM library
and pkg/plxnative-storage at the checkout's root, and check-cargo-unit-default grades
pkg/plxnative-storage when it exists), so check, check-unlocked, check-python, check-python-rest,
check-cargo and check-cargo-unit-default stay stamping rather than move the reset into a nested make.

ci/test_arm_profile.py: the scratch-tree scaffolding moves into a ScratchTree base; a sibling class
runs every host-only goal under `make -n` against a seeded release stamp and asserts nothing was
deleted and the stamp is byte-identical. A second test pins the goals that must stay OUT of the list,
one reason each, so the list cannot grow past the rule unnoticed. `clean` remains the control.

docs/agent-reference.md named five TV-control goals as the whole exempt set; it now states the rule.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@GLinnik21
GLinnik21 merged commit fbafac6 into main Oct 24, 2026
24 checks passed
@GLinnik21
GLinnik21 deleted the tools/kill-keeps-release-binary branch October 24, 2026 13:21
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.

1 participant