Skip to content

Drop the nondeterministic type-check timing flags from the engine build - #388

Merged
alexkroman merged 1 commit into
mainfrom
fix/drop-typecheck-timing-flags
Nov 25, 2026
Merged

alexkroman merged 1 commit into
mainfrom
fix/drop-typecheck-timing-flags

Conversation

@alexkroman

Copy link
Copy Markdown
Collaborator

Why main shows a ❌

One of #384's merge-queue compile runs failed with:

VoiceCommandSupportTests.swift:98: error: instance method 'prefersApps()' took 729ms to type-check (limit: 500ms)

The other merge-group run on the same commit passed.

#384 added -warn-long-function-bodies=500 and -warn-long-expression-type-checking=500. With .treatAllWarnings(as: .error) on, any function that took longer than 500 ms to type-check failed the build. That time depends on how loaded the CI runner is, so the build was nondeterministic: the same code passes on one runner and fails on another. That's the wall-clock flakiness #380 is removing from the tests. The flags shouldn't have gone in alongside warnings-as-errors.

Fix

Remove both timing flags from Package.swift and the matching list in scripts/ios-typecheck.sh, and explain in Package.swift why they're excluded. Everything else from #384 stays:

  • ExistentialAny, MemberImportVisibility, InternalImportsByDefault, InferIsolatedConformances, ImmutableWeakCaptures
  • strict memory safety
  • warnings as errors
  • -require-explicit-sendable

All of these give the same answer on every machine.

Verified: the strict swift build --build-tests is clean, scripts/ios-typecheck.sh passes, and shellcheck and shfmt are clean.

🤖 Generated with Claude Code

-warn-long-function-bodies / -warn-long-expression-type-checking measure
how long the compiler took, which varies with a CI runner's load; with
every warning an error they made the build nondeterministic. They failed
#384's merge-queue compile on a test that took 729 ms against the 500 ms
limit, while the run beside it passed. Every remaining strict setting gives
the same answer on every machine.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@alexkroman
alexkroman enabled auto-merge November 25, 2026 03:03
@alexkroman
alexkroman added this pull request to the merge queue Nov 25, 2026
@alexkroman
alexkroman removed this pull request from the merge queue due to a manual request Nov 25, 2026
@alexkroman
alexkroman added this pull request to the merge queue Nov 25, 2026
Merged via the queue into main with commit 834de7c Nov 25, 2026
13 checks passed
@alexkroman
alexkroman deleted the fix/drop-typecheck-timing-flags branch November 25, 2026 04:16
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.

2 participants