Skip to content

fix: the machine can install from this tree, and the package states its own flags - #7

Merged
tension-atoi merged 12 commits into
mainfrom
feat/gpui-0.3-port
Oct 22, 2026
Merged

tension-atoi merged 12 commits into
mainfrom
feat/gpui-0.3-port

Conversation

@tension-atoi

@tension-atoi tension-atoi commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

The port itself is in main (PR #6). This carries the work that came after it: the machine can install a branch before it is merged, the package states its own build flags, and the gate now holds that.

The machine can install from this tree

scripts/install-machine --from-local builds the package from the local checkout — the PKGBUILD is copied into the repository's scratch and its source points at the local tree — and then installs, restarts and verifies it, exactly as the published path does. A change is tried on the machine before it is merged.

Three corrections fell out of writing it, each one caught by the script refusing to do the wrong thing: the tree check now compares the branch with its own remote counterpart (the local path exists precisely to install a branch that is not main yet); the check knows about --from-local; and the build gets the vendored Zig 0.16, because the system's has moved to 0.17.

The package states its own build flags

The ported tree could not be packaged: inside makepkg the link failed with

undefined symbol: wl_log_trampoline_to_rust_client

and by hand it linked. The cause was the build machine's flags, not the tree. Three of them, each isolated by an A/B test:

  • -flto=auto (CFLAGS/CXXFLAGS/LDFLAGS, from makepkg's global OPTIONS=(… lto …)) reaches the C shim that wayland-backend's build script compiles. The object then carries .gnu.lto_* bytecode instead of code, and rust-lld cannot read it. The Rust code carries its own LTO, in the crate's release profile; that is the LTO that belongs to this build.
  • -C opt-level=3 (RUSTFLAGS) is not merely redundant: rustc enables cfg(debug_assertions) only when opt-level is 0, so the flag switches the debug assertions off — in the test profile too. gpui records the bounds of an element only under all(debug_assertions, feature = "test-support"), so the measurements the visual bench reads vanish and the eighteen tests that read them fail. The crate's release profile already asks for opt-level 3; the test profile must keep its own.
  • -C target-cpu=native (RUSTFLAGS) builds the binary for the machine that happens to build the package. A package is downloaded by machines that are not this one, and a binary tuned for the builder's CPU faults on an older CPU, where the instructions are simply absent.

The package now states its own flags: the architecture's baseline, no builder-specific tuning, no C-level LTO to poison the C shim. The tests also move to the debug profile, where the measurements exist.

The gate holds it

A new gate step, build-flags, checks the flags where they enter — before the build — so a flag that would break the build, or the binary, is named where it enters instead of surfacing later as a linker error or as a fault on another machine.

The flags enter a build from two places, and both are checked: the environment the build inherits, and the package's own declaration — asked of the PKGBUILD itself, so the check cannot drift from what the package does.

Checking the packaged binary's instructions instead would have to carve out the aws-lc-sys and aes crates' own runtime-guarded assembly, and a carve-out is where such a check rots. The cause is one line of configuration, so the cause is what is checked.

Measured

with the machine's flags with the package's flags
the link fails: 1 undefined symbol ok
the tests 247 passed, 18 failed 265 passed, 0 failed
AVX2 instructions in the binary 233 908 2 238
AVX-512 instructions 52 26 — and those 26 are aws-lc-sys's and the aes crate's own assembly, guarded by their runtime capability checks, not ours

The AVX2 row is the same tree built twice, the only difference being the flag: -C target-cpu=native makes LLVM vectorise a hundred times more, in the widest width the builder's CPU has. On a CPU that lacks it, the binary faults with SIGILL.

makepkg --noconfirm on the branch: exit 0, 265 tests pass, the shim object is real code with no .gnu.lto_* sections.

scripts/verify and scripts/ci-replay: both green.

The record, with the logs: evidence/runs/pkgbuild-flags-20261021/.

Syster-Agent added 12 commits October 21, 2026 21:05
**The catalogue's minimum: 560 px.** The target, now proven by the row's
ladder. With it, the name's cell keeps its floor of 165 px (the p90's 143
px of text plus the identity glyph) and the columns that say *where* give
way. Measured at 560: the name 165, the version 93.5, the source 45, the
measurement 71.5, the size 80, the state 85 — every column present, the
name whole. The 660 px that the name would need without the ladder stays
in the test as the historical fact.

**The window's floor: derived, 620 px wide** — 560 + 56 = 616, rounded.
And the height moved with it, because the composition said so: at 480 px
of height the measurement was 183 px for the catalogue, five rows instead
of six. The height is now 520, derived the same way:

  120  the bank, at its tallest (measured)
  +  5  the edge
  + 216  the catalogue: six rows
  + 48  the plate: its identity alone
  = 389  the band
  + 88  the header
  + 36  the drawer's band
  = 513  rounded to 520

At 620 × 520, measured: the catalogue gets 223 px — six rows — and the
plate keeps its identity.

**The plate yields first, and it never leaves the flow.** The overlay is
gone: one always knows which package is selected. The plate reduces
instead — its body, then its actions (29.5 px), then its tabs (34.5 px),
down to its identity (47.5 px). And the chrome, measured, is 131.5 px —
not the 96 that had been estimated. The floor was an estimate; it is now
a measurement.

265 UI tests, both gates green.
A change is tried on the machine before it is merged. `scripts/install-machine
--from-local` builds the package from the local checkout — the PKGBUILD is
copied into the repository's scratch and its source points at the local
tree — and then installs, restarts and verifies it, exactly as the
published path does.
The check demanded main, which is right for the published path and wrong
for the local one — the local path exists precisely to install a branch
before it is merged.
The local path installs a branch before it is merged; comparing that
branch with origin/main was the wrong question.
The tree needs Zig 0.16 and the system's is 0.17; the repository
carries the right one in vendor/, and the PKGBUILD honours the ZIG
override for exactly this. The Makefile exported it; the script called
makepkg directly and did not.
The backend hands the log handler to the Rust client through
`wl_log_trampoline_to_rust_client`. That symbol comes either from a
libwayland built with the Rust-client support — Arch's does not — or from
the crate's own C shim, which the `log` feature compiles.

Cargo 1.98 turns that feature on by itself, through gpui-pre-linux; 1.97
does not. On this machine, a clean release build therefore failed to
link with 'undefined symbol: wl_log_trampoline_to_rust_client', while the
same tree built in the container's cargo 1.98 linked fine.

The feature is declared now, so the build does not depend on the
resolver's mood.
The ported frontend could not be packaged. Three flags that makepkg
inherits from the build machine are wrong for a distributed package, and
each of them was measured, not assumed.

-flto=auto reaches the C shim that wayland-backend's build script
compiles. The object then carries LTO bytecode instead of code, and
rust-lld cannot read it, so the link fails with

    undefined symbol: wl_log_trampoline_to_rust_client

The Rust code carries its own LTO, in the crate's release profile; that
is the LTO that belongs to this build.

-C opt-level=3 is not merely redundant. rustc turns cfg(debug_assertions)
on only when opt-level is 0, so the flag switches the debug assertions
off — in the test profile too. gpui records the bounds of an element
only under all(debug_assertions, feature = "test-support"), so the
measurements the visual bench reads vanish and the eighteen tests that
read them fail. The release profile of the crate already asks for
opt-level 3; the test profile must keep its own.

-C target-cpu=native builds the binary for the machine that happens to
build the package. A package is downloaded by machines that are not
this one, and a binary tuned for the builder's CPU faults on an older
CPU, where the instructions are simply absent. The package now states
the architecture's baseline.

The tests also move to the debug profile, where the measurements exist.

Measured, on the same tree: with the machine's flags the link fails and
the eighteen measuring tests fail; with the package's flags the package
builds, 265 tests pass, and the binary carries no instruction that
only the builder's CPU has.
Three flags that makepkg inherits from the build machine broke the
packaging of the ported frontend. The record keeps the A/B that
separated them: the one that broke the link, the one that broke the
measuring tests, and the one that made the binary machine-specific.
The port is what surfaced it: the tree that links by hand did not link
inside makepkg, and the cause was the build machine's flags. The record
keeps the three flags, the A/B that separated them, and the limitation
that the link was proved on this machine.
The operator's decision: prove the cause, not the symptom. A new gate
step, 'build-flags', checks the flags before the build, so a flag that
would break the build — or the binary — is named where it enters,
instead of surfacing later as a linker error or as a fault on a
machine that is not the builder.

The flags enter a build from two places, and both are checked: the
environment, and the package's own declaration — asked of the PKGBUILD
itself, so the check cannot drift from what the package does.

Three flags are refused, each with its reason: -C target-cpu=native (a
distributed package is built for the architecture's baseline), -C
opt-level= (rustc enables cfg(debug_assertions) only when opt-level is
0, so this switches the measurements off), and -flto in the C flags
(the C shim that wayland-backend compiles would become LTO bytecode,
which rust-lld cannot read).

Checking the packaged binary's instructions instead would have to
carve out the aws-lc-sys and aes crates' own runtime-guarded assembly,
and a carve-out is where such a check rots.
The port's first appearance outside the bench. The package is r4874, the
binary is on gpui-pre 0.3.9, and the window is a native Wayland client
of the compositor.

The window was read passively — the compositor was asked what it had —
and no input was sent: the pointer and the focus are the operator's.
The operator found the lockfile behind — icu_* 2.3.0 -> 2.4.0, open,
tinystr, yoke, zerovec — while the build gate was green.

The currency check is deliberately not part of the build gate: a gate
that turns red because somebody else published a crate is noise, and
the weekly job is where that belongs. What was missing is the other
half: nothing ran it before a push. The author who changes the
dependencies is responsible for the lockfile they commit, and that
check was theirs to run — and it was not run.

So the pre-push hook now runs it for a push that touches the
dependencies, and only then: the same paths the scheduled job watches.
A push that touches none of them is not charged for a stranger's
publish.

The check also stops claiming what it cannot know. Offline, cargo
answers from the cached index — it succeeds, and it cannot see a crate
published since the cache was filled — so the check now refuses, with
the reason, rather than reporting the lockfile as current.

The lockfile itself is updated: scripts/dependencies --update moved it,
re-applied the libc pin, and the gate decided — 1386 package-manager
tests, 392 CLI tests, 265 UI tests.
@tension-atoi
tension-atoi merged commit cf1681f into main Oct 22, 2026
3 checks passed
@tension-atoi
tension-atoi deleted the feat/gpui-0.3-port branch October 22, 2026 11:23
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