Skip to content

build: the portable-names test runs every time, since a reused pass can't see a name added since - #2311

Merged
ashhart merged 2 commits into
mainfrom
lead/portable-names-always
Nov 6, 2026
Merged

ashhart merged 2 commits into
mainfrom
lead/portable-names-always

Conversation

@ashhart

@ashhart ashhart commented Nov 6, 2026

Copy link
Copy Markdown
Owner

zig/tests/portable_names.zig walks zig, docs, tools and .github and fails on any name Windows can't check out. Since #2274, a pull request reuses main's pass for a test whose binary and declared inputs didn't change. A directory listing isn't an input the build knows of, so a pull request that adds such a name would reuse the pass and stay green. Only main's own run, which builds from nothing, would catch it, after landing.

This makes that run always repeat (has_side_effects). It takes milliseconds.

How it was found

The review of #2095 asked for a trace of what its new steps read while they run. I ran zig build test-host from a cold cache under strace on a hosted Linux runner (run 42166246710), with every test binary named after its root file. A check against the build summary confirmed the trace saw every one of the 618 runs (273 binaries).

Of the runs the build can skip:

  • Declared already: core/root, server/root, lfm2 and exlr8_oracle_test read tracked files, and zig/build/test_reads.zig declares each one.
  • Not declared: portable_names opens 388 tracked directories.

Every other run that reads tracked files always repeats anyway: the goldens, kernel_symbols, the q35 launch arguments, the picture tests and the Python and shell checks. So #2095's new steps need no new declarations.

The trace covered opens and launches on Linux, not existence checks (stat, access) or the Windows and macOS graphs.

Test plan

  • CI passes, and zig build test still runs portable_names on each platform

…an't see a name added since

It walks zig, docs, tools and .github for names Windows can't check out. Those directory listings aren't inputs the
build knows of, so since pull requests reuse main's test passes (#2274), a pull request that adds such a name would
reuse the pass and stay green until main's own run. Found by tracing what every run in test-host opens (the review of
#2095): of the runs the build can skip, this is the only one that reads tracked paths it doesn't declare; the others
declare theirs in zig/build/test_reads.zig.
@ashhart
ashhart force-pushed the lead/portable-names-always branch from 57bf941 to 4d1f1ef Compare November 6, 2026 14:19
@ashhart
ashhart merged commit 0d71529 into main Nov 6, 2026
9 of 11 checks passed
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