diff --git a/build.ps1 b/build.ps1 index 9a8f5dd..df4917a 100644 --- a/build.ps1 +++ b/build.ps1 @@ -170,11 +170,6 @@ function Invoke-Swift([string[]]$SwiftArgs, [hashtable]$Sql) { # carries the prefix — it is global, so it also downgrades any FUTURE duplicate to a # warning. Read the warnings. $full = @($SwiftArgs) + @( - # Index-while-building costs real per-file work (`-index-store-path` + - # `-index-system-modules` on every frontend job) and nothing consumes the store from a - # command-line build — it exists for editors. Off here; CI leaves it at the default, - # where a cold index nothing reads costs nothing either way. - '--disable-index-store', '-Xcc', "-I$($Sql.Include)", # `/LIBPATH:`, NOT `-LIBPATH:`. A leading `-L` is claimed by the driver's GNU-style # library-path flag, so `-LIBPATH:C:\…\lib` is read as `-L` + `IBPATH:C:\…\lib` and @@ -196,7 +191,13 @@ function Build-Protocol([hashtable]$sql) { try { Write-Step 'protocol: building NucleicProtocol' $code = if ($Test) { - Invoke-Swift @('test', '--filter', 'NucleicProtocolTests') $sql + # SwiftPM 6.3.3 on Windows still schedules index units for test discovery even with + # `--disable-index-store`, then a clean build dies opening units it never emitted. + # With indexing enabled, parallel frontends contend for shared SDK/module unit files + # and Windows reports sharing violations as "permission denied". Serialize test + # builds until SwiftPM fixes that pair of index-store bugs; ordinary builds stay + # parallel. + Invoke-Swift @('test', '-j', '1', '--filter', 'NucleicProtocolTests') $sql } else { Invoke-Swift @('build', '--target', 'NucleicProtocol') $sql } @@ -222,7 +223,10 @@ function Build-Core([hashtable]$sql) { Remove-Item Env:\NUCLEIC_WINDOWS_PROTOCOL_ONLY } try { - if ($Test) { return Invoke-Swift @('test', '--filter', 'NucleicCarbonTests') $sql } + if ($Test) { + # See Build-Protocol: clean Windows test builds require indexing + one frontend job. + return Invoke-Swift @('test', '-j', '1', '--filter', 'NucleicCarbonTests') $sql + } return Invoke-Swift @('build', '--target', 'NucleicCore') $sql } finally { if ($inherited) { $env:NUCLEIC_WINDOWS_PROTOCOL_ONLY = $inherited }