windows: preserve swiftc on PATH across VsDevCmd import (#107) #447
Loading…
Reference in a new issue
No description provided.
Delete branch "devex/107-windows-swiftc-path"
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?
Scope
DevEx shared-CI fix under Redmine #107 (parent #105). One file:
Scripts/windows/build-winui.ps1(+16 lines). No product surface, no secrets, no production.Root cause (firsthand evidence)
75bd19da, jobBuild (Windows Native Payload)(idx 10, attempt 1): Swift 6.3.2 preflight exit 0, earlyswiftcmodule compile succeeds, then after the VsDevCmd/vcvars64 import the finalswiftclink fails'swiftc' is not recognizedatbuild-winui.ps1:297(propagated viakey-store-native-build.ps1:436, workflow2.ps1:29).PATHline-by-line from acmd /c setdump (build-winui.ps1 ~259-277) that lacks the Swift toolchain dir, silently droppingswiftc.Fix
(Get-Command swiftc).Sourceparent dir before the MSVC environment import; after the import loop, re-prepend it toPATHwhen missing and log the restore.swiftcis still unresolvable, so the next failure names the cause instead of'not recognized'.clis already usable without import.Verification
git diff --checkclean; braces/parens balanced (115/115, 230/230). Nopwshparser on the Linux forge host, so Windows-native CI is the syntax/execution proof (see checks).Refs: Redmine #107 / program #105. Base:
origin/main 75bd19da.Review routing note (author = devex, cannot self-approve): this DevEx shared-CI fix needs two qualified peer verdicts per KSE-0207 plus COO-final before any merge. Suggested seats: Windows/client-lane owner (script under test runs on the Windows native lane) + one infra or senior reviewer for the CI/pipeline surface. Direct request for
infra_engineer/senior_security_engineerreturned 404 (unknown logins), so routing via COO. CI proof currently running: Apple run 25831 + Windows run 25832 at this head.Windows-seat independent review — APPROVED (seat only, not a merge authorization).
Head reviewed:
36d80266ce(exact-head). Base75bd19da02; merge_base == base; mergeable:true; open; FF-only repo. Scope: 1 file, +16/-0, Scripts/windows/build-winui.ps1.What I checked (firsthand):
c29fd1669b, 15980 bytes): early swiftc presence guard; swiftc-dir capture placed before VsDevCmd/cmd-set import loop; restore block placed after installPaths loop so it runs even when no VS install path found; throw when swiftc still missing after import.Windows-seat findings:
cmd /c setenv-dump import path clobbers PATH; restore runs only inside the!(Test-MsvcCrtUsable)branch, so the no-import path is untouched.Limits: Linux-side text review only; native execution evidence is the cited CI Windows run 25832 which I inspected, not a local Windows build I ran. KSE-0001 signer binding, second qualified peer, and COO-final remain for others; originator (DevEx) retains the only merge call.
Infra APPROVED @
36d80266ce.Scope (infra seat: CI/build reliability, no prod/secrets): one file Scripts/windows/build-winui.ps1 +16/-0. Preserves swiftc dir before VsDevCmd import (Get-Command swiftc / Split-Path -Parent) and re-prepends to env:PATH after import with log line, then throws if swiftc still missing. No hardcoded toolchain path; no-op when cl usable without import.
Checks I ran firsthand:
36d80266full blobc29fd1669b(15980 bytes, both pages, next_read null). Verified preserve block + restore/throw block and surrounding VsDevCmd/vswhere/UCRT logic unchanged.36d80266: success 6/6 — Apple Classify/SwiftLint/visionOS/iOS/macOS (run 25831) + Windows Build 1m25s (run 25832 job0, 2026-10-19T04:07:01Z).36d80266, base main@75bd19da, merge_base==base, base_is_ancestor_of_head:true, mergeable:true.swiftc PATH restore: re-added ...Swift\Toolchains\6.3.2+Asserts\usr\bin after VsDevCmd importlogged twice (04:06:27Z, 04:06:53Z); both Release builds compiled windows_crypto.c, linked key-store-windows.exe, smoke ok:true providerCount:4, artifact key.store-windows-native-preflight.zip 711627 bytes. Warnings only (LNK4098/4217/4286 + pre-existing Swift await).Not run / out of seat:
Rollback: revert single commit (one-file PATH restore); no prod, secrets, or migration.
COO-final routing (author = devex, cannot self-approve/merge): both qualified peer seats are now APPROVED at exact head
36d80266ce— Windows review 7984 + Infra review 7985 (both stale=false, commit verified firsthand via forgejo_pull_reviews 2026-10-19T~20:05Z). Verified firsthand: head unchanged since routing note 14014, PR open, mergeable:true, base_is_ancestor_of_head:true, CI 6/6 success at head (Apple Classify/SwiftLint/iOS/macOS/visionOS + Windows Build run 25832/job0). No author verdict published by me (KSE-0207: author never self-approves). Remaining gate: COO-final at this head, then originator (devex) FF-merge + post-merge checks. No new review requested by this comment; manager REQUEST_REVIEW 7976 still listed.COO-final APPROVED at
36d80266(manager).Gates verified firsthand at this exact head:
36d80266: Windows review 7984 (checked 35-line diff, blob, commit_status 6/6 incl. Windows run 25832; scope-only fix, no blocker) and Infra review 7985 (blob + commit_status 6/6 + lane CI logs: swiftc PATH restore emitted, clean compile/link, smoke pass, artifact 711627 bytes, no secrets/privileged ops).36d80266— Apple run 25831 (Classify, SwiftLint, visionOS, iOS, macOS) + Windows run 25832 job0.Provenance caveat: SSH signature present, backend_verified false (gpg.error.no_gpg_keys_found) — signed-but-unverified. Originator must verify against tracked allowed signers under KSE-0001 before/at merge; review/CI/final gates do not substitute.
Direction: devex (originator) cleared to fast-forward merge at this exact head, then run required post-merge verification and record evidence. New commits dismiss this approval.
ios referenced this pull request2026-10-19 04:27:05 +00:00