Skip to content

Windows No Compiler CI: measure again when only the file watcher failed - #18735

Merged
danielhanchen merged 2 commits into
mainfrom
fix/no-compiler-watcher-retry
Nov 21, 2026
Merged

danielhanchen merged 2 commits into
mainfrom
fix/no-compiler-watcher-retry

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Problem

Windows No Compiler CI failed 5 of its 21 completed runs in the last day, on main (run 44728450095) and on unrelated PRs (#16729 three times, #18727). Every failure was the same void, always in Require the desktop mode to run without a compiler (install.ps1 --tauri --local):

the file watcher on C:\Users\RUNNER~1\AppData\Local\Temp, C:\Users\runneradmin\AppData\Local\Temp raised an
error, so creations under it may have been dropped. A compile whose intermediates were deleted before the
final sweep is visible only in those events. This run cannot say whether a compiler ran.

None of them recorded a compiler. The FileSystemWatcher buffer is already at its 64 KB maximum, so a burst of temp-file creations during the install can still overflow it.

Fix

Invoke-WithCompilerWatch takes -Attempts (default 1, so every existing caller is unchanged). The two installer measurements in windows-no-compiler-ci.yml pass -Attempts 2; the positive control still measures once.

  • A run that is void only because a watcher raised an error is measured again, as a complete new measurement with its own evidence files (installer-tauri-attempt2-*.txt), and a ::warning:: names the void attempt.
  • A void run is still never scored as clean: if every attempt's watcher fails, the step fails with the same message as before.
  • A run whose temp sweep could not read a directory with no watcher on it is not retried (unchanged void).
  • A compiler that event 4688 recorded is now reported as a hit even when the watcher failed, instead of being reported as "cannot say". 4688 is the authoritative detector, so a real compile can never be retried away.

Tests

New pwsh tests in tests/studio/test_installer_av_shapes.py run the real Invoke-WithCompilerWatch with Stop-StudioTempWatch reporting a failed root on the first N measurements:

Case Result
watcher error, -Attempts 1 void, 1 measurement
watcher error once, -Attempts 2 measured clean on attempt 2, attempt-2 evidence written
watcher error on both attempts void, 2 measurements
watcher error and 4688 saw a compiler reported as 1 compiler, not retried

tests/python/test_compiler_watch_temp_scan.py lifts the verdict block out of the shipped script; its harness now supplies the inputs that block reads ($compilers, $Attempt, $Attempts, $Name) for a single compiler-free attempt.

  • tests/studio/test_installer_av_shapes.py and tests/python/test_compiler_watch_temp_scan.py: 275 passed, 1 skipped.
  • Sabotage: with the script from main, the four new tests fail.

This PR touches .github/scripts/Watch-ForCompiler.ps1, so its own Windows No Compiler CI run exercises the real Windows path.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T06:24:36.677692Z 3eef5fb Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ec075b3b93

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/scripts/Watch-ForCompiler.ps1 Outdated
Comment on lines +655 to +657
if ($incomplete.Count -gt 0 -and $compilers.Count -eq 0) {
$verdict = ($incomplete -join '; ') + ". This run cannot say whether a compiler ran."
if ($uncovered.Count -eq 0 -and $Attempt -lt $Attempts) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve positive artifact detections before retrying

When a watcher reports an error and 4688 records no compiler, this retries even if $newLibraries already contains compiler artifacts. The recursive return discards that positive detection, so a healthy second attempt with no new artifacts lets both workflow steps pass. Artifacts left by the first attempt also become part of the second attempt's baseline and are excluded from its sweep. This defeats the independent artifact detector precisely when process auditing misses a compile. Treat nonempty $newLibraries as a hit that prevents retrying, just like nonempty $compilers, and add a test covering an artifact hit alongside a watcher failure.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 3eef5fb. A non-empty $newLibraries now blocks the retry the same way a 4688 compiler does, so an artefact hit from the void attempt is returned and the step fails on it. Added test_an_artefact_seen_while_the_watcher_failed_is_a_hit_not_a_retry (it fails with the previous condition).

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 3eef5fb15f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit cb27fb7 into main Nov 21, 2026
@danielhanchen
danielhanchen deleted the fix/no-compiler-watcher-retry branch November 21, 2026 06:50
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