From cba12554622b82fc214d84e63398b6141a8cf7c6 Mon Sep 17 00:00:00 2001 From: Nucleic Date: Tue, 28 Jul 2026 03:04:00 -0700 Subject: [PATCH] Merge nucleic/keen-maple-heron-yzg3 into dev --- build.ps1 | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/build.ps1 b/build.ps1 index 6fc0459..f793e9f 100644 --- a/build.ps1 +++ b/build.ps1 @@ -119,10 +119,15 @@ function Initialize-SQLite { # ---------------------------------------------------------------- legs -function Invoke-Swift([string[]]$SwiftArgs, [string]$LibPath) { - # -Xlinker only matters when something actually links (tests, executables); a library - # build resolves purely through CPATH. - $full = @($SwiftArgs) + @('-Xlinker', "-LIBPATH:$LibPath") +function Invoke-Swift([string[]]$SwiftArgs, [hashtable]$Sql) { + # Both mechanisms, deliberately redundant. CPATH (set by Initialize-SQLite) is what makes + # a *bare* `swift build` work later, but passing -Xcc -I here means this script never + # depends on clang honouring CPATH — if it didn't, the failure would be an inscrutable + # "'sqlite3.h' file not found" from inside GRDB's module build. -Xlinker only matters + # when something actually links (tests, executables); a library build needs just the -I. + $full = @($SwiftArgs) + @( + '-Xcc', "-I$($Sql.Include)", + '-Xlinker', "-LIBPATH:$($Sql.Lib)") Write-Note "swift $($full -join ' ')" # Out-Host, not the pipeline: a native command's stdout would otherwise become this # function's return value, and the caller's exit-code check would see an array. @@ -137,9 +142,9 @@ function Build-Protocol([hashtable]$sql) { try { Write-Step 'protocol: building NucleicProtocol' $code = if ($Test) { - Invoke-Swift @('test', '--filter', 'NucleicProtocolTests') $sql.Lib + Invoke-Swift @('test', '--filter', 'NucleicProtocolTests') $sql } else { - Invoke-Swift @('build', '--target', 'NucleicProtocol') $sql.Lib + Invoke-Swift @('build', '--target', 'NucleicProtocol') $sql } } finally { Remove-Item Env:\NUCLEIC_WINDOWS_PROTOCOL_ONLY -ErrorAction SilentlyContinue @@ -150,8 +155,8 @@ function Build-Protocol([hashtable]$sql) { function Build-Core([hashtable]$sql) { Write-Step 'core: building NucleicCore (full Windows manifest)' Write-Note 'Expected to fail until the §12 item 7-9 shims land — the errors ARE the M0 gap list.' - if ($Test) { return Invoke-Swift @('test', '--filter', 'NucleicCarbonTests') $sql.Lib } - return Invoke-Swift @('build', '--target', 'NucleicCore') $sql.Lib + if ($Test) { return Invoke-Swift @('test', '--filter', 'NucleicCarbonTests') $sql } + return Invoke-Swift @('build', '--target', 'NucleicCore') $sql } function Build-Broker {