Repository navigation
Make: a PLATFORM axis (webos, desktop, tizen), with no build change yet - #1482
Merged
Merged
Conversation
`PLATFORM ?= webos` joins FLAVOR as a validated Makefile axis. FLAVOR is the install identity; PLATFORM is the target OS, and the word now means a build target after the bottom layer crate became `plx_os`. Values come from a new `ci/platform_axis.py --list`, read at parse time the way `ci/flavor.py --list` is, so `make PLATFORM=webso ...` is a message and not a build of something nobody asked for. A value must be exactly one listed word (a `filter` of the value against the list would pass `webos bogus` and `%`). `sim`, `sim-*`, `macapp` and `macapp-zip` imply `desktop` when PLATFORM was not given on the command line or in the environment; an explicit value wins, and the public target names do not change. PLATFORM does not choose the compatibility axis: the Rust target, sysroot and, later, the managed TFM, firmware floor and signing path stay separate variables. `print-platform` and `print-rust-target` are explicit query goals in QUERY_GOALS, so asking resets nothing under `pkg/`, and `print-rust-target` answers the same under every PLATFORM. The script is not named `ci/platform.py`: `mkmacapp.py`, `build-libass.py` and `test-compat.py` import the standard library's `platform`, and Python puts a script's own directory first on `sys.path`, so a file of that name would shadow it for all of them. `ci/test_platform_axis.py` pins the list, the refusal, the implication (read from a dry run in a scratch tree), the untouched `pkg/` and the shadow case, with a control that proves its probe would notice one. No recipe reads PLATFORM yet, so with the default every target builds what it built before. Co-Authored-By: Claude <noreply@anthropic.com>
…seeded test_a_refused_value_is_refused_whatever_the_goal dry-ran `all` and `sim-macos` with the default cwd, so in the real checkout, against this file's own rule that every goal dry run uses a scratch tree. Were the refusal ever to regress, the Makefile's parse-time stamp reset would have run on the developer's tree and deleted pkg/plxnative and the staged libraries. The test now lives in a ScratchTree class, seeds a stamp that is not the current configuration's and a built binary before each goal, and asserts both survive the refusal. That removes the hazard and pins "the refusal comes before the reset" by observation: a refusal moved below the reset prints the same error, so the message alone could not show it. The seed and the untouched-assertion are shared with the existing asking-never-resets test. Co-Authored-By: Claude <noreply@anthropic.com>
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.
Step W1 of the platform plan (discussion #1460).
PLATFORMbecomes a make variable with three values:webos,desktop,tizen. Later steps hang the per-platform crates and packaging on it. Nothing reads it yet, so no build changes.What changes
Makefile: a PLATFORM block right after the FLAVOR block. A bad value stops make before the stamp reset deletes anything.PLATFORMS := $(shell python3 ci/platform_axis.py --list), thenPLATFORM ?= webos, then a refusal unless the value is exactly one word from the list. A barefilterwould also passwebos bogusand%.sim,sim-%,macappandmacapp-zipimplyPLATFORM := desktopwhen PLATFORM was not given. An explicit value wins.print-platformandprint-rust-target, sit beside the otherprint-*targets and are inQUERY_GOALS, so they leavepkg/alone.print-rust-targetprintsRUST_TARGET, which does not move with PLATFORM: the platform does not choose the compatibility axis (Rust target, sysroot, firmware floor, signing).DISK_ENTRIESuntouched). PLATFORM is not exported and is not part ofRUST_CFGorRUST_TDIR.ci/platform_axis.py: the list and--list. It imports onlysys. It is notci/platform.py, becauseci/mkmacapp.py,ci/build-libass.pyandci/test-compat.pyimport the stdlibplatform, and aci/platform.pywould shadow it for every script run fromci/.ci/test_platform_axis.py(22 tests), inci/check-python-steps.txt. It covers:--list, the default, and each value from the command line and from the environment;webso,WEBOS, empty,webos bogus,webos webos,%,web%andandroid;print-rust-targetunchanged under all three platforms;pkg/untouched, with a control showing a building goal does reset it;ci/, each consumer importing the realplatformwhen run fromci/, and a control with a fakeplatform.py.QUERY_GOALSentry and a plantedci/platform.pyeach fail the intended tests.Known properties
FLAVOR, aPLATFORMset in the environment is read. A stray value fails every make invocation with the refusal message.sim-*(check-replay,screenshots,screenshots-sim,site-video-sim) do not imply desktop yet. That matters once PLATFORM selects something, so it is left for W4, the simulator as its own platform.make -s print-flavor, median of 30 runs, repeated twice: 89 → 101 ms).Verify
make -s print-flavor print-appid: byte-identical before and after (debug,com.beb.plxnative.debug).make -s print-platform print-rust-target:webos,armv7-unknown-linux-gnueabi.make -nof the default goal: byte-identical before and after (57 lines), including the ARM link line and both cargo lines. Also identical:ipk,RELEASE=1 ipk,FLAVOR=stable RELEASE=1 ipk,sim-macos,sim-linux,macapp,lint,check-nodefandtest-hostsim. A byte-identical binary is not claimed.python3 ci/test_platform_axis.py:Ran 22 testsOK.ci/test_disk_preflight.py:Ran 54 testsOK.ci/test_arm_profile.py,ci/test_ci_split.py,ci/test_check_collisions.py,flavor.py --selftestandci/check-deps.share green.build-bench
--only noop,leaf,app,arm, 3 runs each, basee2088058dagainst this change, on one Mac. The ARM row was skipped on both sides because a fresh worktree has no ARM staticlib and the bench never builds one. Other lanes were building outside the check lock, so the load moved between 3.8 and 16 on 10 cores.Pair 2 printed the tool's "load > 10 cores, numbers are noisy" warning on both sides.
The change side read slower in both pairs, and that is host load, not the change:
print-bench-configprints, and that config and the whole dry run are byte-identical.🤖 Generated with Claude Code