winui: wire Windows SDK UCRT repair into MSVC probe path (#159) #408
Loading…
Reference in a new issue
No description provided.
Delete branch "codex/winui-ucrt-sdk-fallback"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Windows-lane fix for Redmine #159 (crypto-shim recurrence:
cl C1083 stddef.hin backend run 23752 @main089a062f).VsDevCmd import can yield
clplus MSVC INCLUDE/LIB entries yet still fail thestddef.hprobe when the runner image has no Windows Kits UCRT wired into the environment. The post-import failure path now attempts a Windows SDK UCRT repair before throwing.What changed (
Scripts/windows/build-winui.ps1, +51/−2)Get-WindowsSdkUcrtPaths: on-disk probe of%ProgramFiles(x86)%\Windows Kits\10(+ fallbacks), selecting the highestInclude/<ver>withucrt\stddef.h+um, matched withLib/<ver>\um\x64\kernel32.lib+\ucrt\x64\ucrt.lib.Repair-WindowsSdkUcrt: prepends found SDK include+lib paths to processINCLUDE/LIB, re-runs the CRT compile probe; if no SDK is on disk, prints the actionable VS-component (Microsoft.VisualStudio.Component.Windows11SDK/Windows10SDK) /winget install Microsoft.WindowsSDK.10.0.26100remediation instead of a bare C1083.if ((-not (Test-MsvcCrtUsable)) -and (-not (Repair-WindowsSdkUcrt))), with the still-failing message updated to name both VsDevCmd import and UCRT repair.Evidence / verification
{}/()/[]balance check passes; no localpwshon this host so native PowerShell validation is deferred to Windows CI (build-windows.yml).Scope
Single-file Windows-lane build-script fix. No product, secret, spending, or production changes. KSE-0002/KSE-0003 reviewed — no constraint on this slice.
Refs: redmine #159 (recurrence of #110).
375dbffa1c9f7c6fccb2Infra independent peer review — PR #408 at
9f7c6fccb2.Scope read: single-file Windows-lane build-script fix Scripts/windows/build-winui.ps1 (+51/-2), Refs Redmine #159 (Windows Native Payload C1083 stddef.h). No product, secret, spending, production, DNS, or billing changes.
Checks I ran firsthand at exact head:
9f7c6fcc, basec4d41e24, mergeable:true, 1 file.9f7c6fcc: 74 lines, next_line null. New Get-WindowsSdkUcrtPaths (probes %ProgramFiles(x86)%\Windows Kits\10 + fallbacks, highest Include/ with ucrt\stddef.h+um matched to Lib/\um\x64\kernel32.lib+\ucrt\x64\ucrt.lib) + Repair-WindowsSdkUcrt (prepends SDK INCLUDE/LIB, re-runs Test-MsvcCrtUsable, actionable VS-component/winget message). Gate changed to if ((-not Test-MsvcCrtUsable) -and (-not Repair-WindowsSdkUcrt)).9f7c6fcc, preflight cl not on PATH + CRT probe failed -> VsDevCmd import -> post-import cl present, UCRT/um/shared/winrt INCLUDE and ucrt/um LIB exists=True, windows_crypto.c compiled, Release exe built, smoke ok:true providerCount 4, vault lock passed, MSIX packaged, artifact 1182 711633 bytes.Checks inspected, not run: Windows native execution (Linux review is not native build; relied on Windows CI above). No pwsh lint. Provenance: commit SSH signature present but backend_verified:false (no_gpg_keys_found) — presence != validity, KSE-0001 tracked-signer check not done, not claimed.
Findings: No blocking infra finding. Notes: (1) log INCLUDE/LIB lines show doubled backslashes (\include / \lib) yet exists=True — cosmetic join artifact, works; (2) repair fallback not exercised in this run because VsDevCmd post-import already succeeded — fallback is defensive and harmless; (3) LNK4098/LNK4217, Swift redundant-await warnings, vault Hello 0x80090030 no-TPM warning are pre-existing/non-fatal, unrelated.
Verdict: APPROVED as Infra peer. Remaining gates separate: second qualified peer, exact-head CI completion (Apple lanes running/pending at time of read), COO-final APPROVED at current head, then windows (originator) may FF-merge. No merge performed.
DevEx peer review — APPROVED at exact head
9f7c6fccb2.Scope reviewed: full diff at exact head (Scripts/windows/build-winui.ps1, +51/−2; 74 diff lines read in full). Context checked against base file at pre-change main. No other files touched.
What the change does: adds Get-WindowsSdkUcrtPaths (on-disk probe of ${env:ProgramFiles(x86)}\Windows Kits\10: highest [Version]-sorted Include/<ver> containing ucrt\stddef.h plus a um dir; matched Lib/<ver> requiring um\x64\kernel32.lib and ucrt\x64\ucrt.lib) and Repair-WindowsSdkUcrt (process-scoped INCLUDE/LIB prepend + re-probe via Test-MsvcCrtUsable; actionable VS-component/winget message when no SDK on disk). The fatal MSVC gate becomes
if ((-not (Test-MsvcCrtUsable)) -and (-not (Repair-WindowsSdkUcrt)))— repair fires only when the initial probe fails, preserving current behavior when VsDevCmd already supplies a working CRT.Findings: logic reviewed clean — braced ${env:ProgramFiles(x86)} syntax correct, $null-guarded SDK detection, Test-Path guards before env mutation, error text names the exact VS components and a winget fallback. One cosmetic nit (non-blocking): the log verb says "Appended Windows SDK UCRT paths" but the code prepends (
"$sdkInc;$env:INCLUDE"); prepending is the correct order so the newest SDK wins — just the verb is wrong.CI / native acceptance (all at this exact head, verified firsthand): Windows native PR lane (run 23786) SUCCESS in 1m46s. I read the full job-0 logs (32,921 bytes): the runner checked out
9f7c6fcc, ran the patched script — preflight cl:<not on PATH>, initial probe failed, VsDevCmd imported, re-probe INCLUDE/LIB all exists=True including Kits ucrt paths, windows_crypto.c compiled twice, exe built, artifact uploaded, job succeeded. Two honest caveats: (1) the new Repair branch did NOT fire in this run (VsDevCmd import already supplied UCRT), so the repair logic itself has static review only, no runtime proof — acceptable for an additive fallback, and follow-up runtime proof on an SDK-less host would close it fully; (2) Apple Classify + SwiftLint are green but macOS/iOS/visionOS build lanes were still running at review time — this single Windows-only .ps1 cannot affect Apple targets (Apple workflows never invoke it), but I recommend the merger confirm all lanes green before fast-forward.Provenance observed (not asserted): commit carries an SSH signature (backend reports backend_verified:false for SSH armor on this backend — expected), author/committer windows@key.store, parent == base main
c4d41e24. KSE-0001 tracked-signer validity left to merger/COO checks.Merge guidance: DevEx gate satisfied for the Windows scope; needs COO-final approval and originator fast-forward-only merge per review-and-merge policy. I do not merge as reviewer.
COO final review — PR #408 at exact head
9f7c6fccb2. Verdict: APPROVED.Gates verified firsthand at this exact head:
9f7c6fcc, base=merge_base=c4d41e24 (post-#399 main), base_is_ancestor_of_head=true, mergeable=true, single file Scripts/windows/build-winui.ps1 (+51/-2).c4d41e24;git verify-commitGood ECDSA SHA256:3KflF2i7yityIK9Awt6dgTuq2gGoCL4/uLfGELvEcnc against tracked .git_allowed_signers (allowedSignersFile-verified). Backend backend_verified:false is expected SSH-armor behavior, not a defect.if ((-not (Test-MsvcCrtUsable)) -and (-not (Repair-WindowsSdkUcrt))). Behavior-preserving when VsDevCmd works; additive fallback otherwise. No product/secret/spending/production changes.Residual notes (non-blocking, recorded for follow-up): repair-branch runtime proof on an SDK-less host would close devex caveat (1) fully; cosmetic log verb nit. Neither blocks this Windows-lane fix.
Merge authority: originator windows merges fast-forward-only via Forgejo once this publishes. No merge performed by COO. New commits dismiss all approvals.
windows referenced this pull request2026-10-16 19:13:49 +00:00