Merge nucleic/humble-fern-egret-60xo into dev
This commit is contained in:
@@ -1211,6 +1211,16 @@ which is what the Swift toolchain uses, so the CRT agrees and no `sqlite3.dll` h
|
||||
staged beside every test binary. CI does the same thing with explicit flags rather than
|
||||
`CPATH`, so hosted runners stay hermetic (`.github/workflows/windows.yml`).
|
||||
|
||||
The triplet is ours, not vcpkg's: `windows/vcpkg-triplets/<arch>-windows-static-md-nucleic.cmake`,
|
||||
passed with `--overlay-triplets`. It is the stock `-static-md` triplet plus
|
||||
**`SQLITE_ENABLE_SNAPSHOT`**. GRDB's system-SQLite path compiles `WALSnapshot.swift` and
|
||||
`DatabaseSnapshotPool.swift` unconditionally — it assumes the platform SQLite exposes
|
||||
`sqlite3_snapshot_*`, which holds for Apple's system SQLite and typical distro builds but not
|
||||
for a stock vcpkg port, where the API is compiled out. Without the define the library resolves
|
||||
and links, then fails with four undefined symbols (`sqlite3_snapshot_open/get/free/cmp`) out of
|
||||
GRDB — a failure that looks nothing like a missing feature flag. The `-nucleic` suffix keeps
|
||||
this tree from colliding with a stock `<arch>-windows-static-md` install in the same vcpkg root.
|
||||
|
||||
### 14.3 Tailnet on Windows: inert by construction, not stubbed
|
||||
|
||||
`NucleicTailnet` compiles on Windows and does nothing there, and that needs no Windows-specific
|
||||
|
||||
+8
-5
@@ -144,12 +144,12 @@ jobs:
|
||||
- arch: x64
|
||||
runner: ${{ vars.WINDOWS_X64_RUNNER || 'windows-2025' }}
|
||||
build_arch: amd64
|
||||
vcpkg_triplet: x64-windows-static-md
|
||||
vcpkg_triplet: x64-windows-static-md-nucleic
|
||||
experimental: false
|
||||
- arch: arm64
|
||||
runner: ${{ vars.WINDOWS_ARM64_RUNNER || 'windows-11-arm' }}
|
||||
build_arch: arm64
|
||||
vcpkg_triplet: arm64-windows-static-md
|
||||
vcpkg_triplet: arm64-windows-static-md-nucleic
|
||||
experimental: true
|
||||
runs-on: ${{ matrix.runner }}
|
||||
steps:
|
||||
@@ -169,8 +169,9 @@ jobs:
|
||||
# supplies sqlite3.h / sqlite3.lib on Windows — hence "including GRDB/SQLite linkage"
|
||||
# in the §13 M0 exit criteria. The -static-md triplet links SQLite statically against
|
||||
# the DYNAMIC CRT, matching what the Swift toolchain uses: the CRT agrees and there's
|
||||
# no DLL to stage beside the test binaries. Stock features are enough — nothing here
|
||||
# uses FTS or rtree.
|
||||
# no DLL to stage beside the test binaries. Stock vcpkg FEATURES are enough — nothing
|
||||
# here uses FTS or rtree — but the stock BUILD is not: it compiles the snapshot API out,
|
||||
# which GRDB's system-SQLite path needs, hence the overlay triplet below.
|
||||
shell: pwsh
|
||||
run: |
|
||||
# Hosted images ship vcpkg and set VCPKG_INSTALLATION_ROOT; a self-hosted box does
|
||||
@@ -188,7 +189,9 @@ jobs:
|
||||
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
||||
}
|
||||
}
|
||||
& (Join-Path $vcpkg 'vcpkg.exe') install sqlite3:${{ matrix.vcpkg_triplet }}
|
||||
# Overlay triplet = stock -static-md + SQLITE_ENABLE_SNAPSHOT, which GRDB's
|
||||
# system-SQLite path needs and the stock port compiles out (§14.2).
|
||||
& (Join-Path $vcpkg 'vcpkg.exe') install sqlite3:${{ matrix.vcpkg_triplet }} "--overlay-triplets=$env:GITHUB_WORKSPACE\windows\vcpkg-triplets"
|
||||
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
||||
$root = Join-Path $vcpkg 'installed\${{ matrix.vcpkg_triplet }}'
|
||||
# Deliberately NOT %INCLUDE%/%LIB%: clang's MSVC driver stops auto-detecting the
|
||||
|
||||
+6
-3
@@ -74,10 +74,13 @@ function Initialize-SQLite {
|
||||
if (-not $Triplet) {
|
||||
# -static-md links SQLite statically against the DYNAMIC CRT — matching what the
|
||||
# Swift toolchain uses, so the CRT agrees and there's no sqlite3.dll to place
|
||||
# beside every test binary.
|
||||
# beside every test binary. `-nucleic` is our overlay triplet (windows/vcpkg-triplets):
|
||||
# same thing plus SQLITE_ENABLE_SNAPSHOT, which GRDB's system-SQLite path requires and
|
||||
# the stock port compiles out.
|
||||
$arch = if ($env:PROCESSOR_ARCHITECTURE -eq 'ARM64') { 'arm64' } else { 'x64' }
|
||||
$script:Triplet = "$arch-windows-static-md"
|
||||
$script:Triplet = "$arch-windows-static-md-nucleic"
|
||||
}
|
||||
$overlay = Join-Path $repo 'windows\vcpkg-triplets'
|
||||
|
||||
# `%LOCALAPPDATA%\vcpkg` is NOT a candidate install root, and must never be a clone target:
|
||||
# that path is vcpkg's own per-user DATA directory (registries, downloads, and the
|
||||
@@ -121,7 +124,7 @@ function Initialize-SQLite {
|
||||
$prefix = Join-Path $root "installed\$Triplet"
|
||||
if (-not (Test-Path (Join-Path $prefix 'include\sqlite3.h'))) {
|
||||
Write-Step "Installing sqlite3:$Triplet (one time, a few minutes)"
|
||||
& (Join-Path $root 'vcpkg.exe') install "sqlite3:$Triplet" | Out-Host
|
||||
& (Join-Path $root 'vcpkg.exe') install "sqlite3:$Triplet" "--overlay-triplets=$overlay" | Out-Host
|
||||
if ($LASTEXITCODE -ne 0) { throw "vcpkg install sqlite3:$Triplet failed" }
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
# ARM64 twin of `x64-windows-static-md-nucleic.cmake` — see that file for why the define is here.
|
||||
set(VCPKG_TARGET_ARCHITECTURE arm64)
|
||||
set(VCPKG_CRT_LINKAGE dynamic)
|
||||
set(VCPKG_LIBRARY_LINKAGE static)
|
||||
set(VCPKG_C_FLAGS "/DSQLITE_ENABLE_SNAPSHOT")
|
||||
set(VCPKG_CXX_FLAGS "/DSQLITE_ENABLE_SNAPSHOT")
|
||||
@@ -0,0 +1,17 @@
|
||||
# Stock `x64-windows-static-md` (SQLite linked statically against the DYNAMIC CRT — the CRT the
|
||||
# Swift toolchain uses) PLUS `SQLITE_ENABLE_SNAPSHOT`.
|
||||
#
|
||||
# GRDB's system-SQLite path compiles `WALSnapshot.swift` and `DatabaseSnapshotPool.swift`
|
||||
# unconditionally, i.e. it assumes the platform SQLite exposes `sqlite3_snapshot_*`. That holds
|
||||
# for Apple's system SQLite and for typical Linux distro builds, but the vcpkg port ships stock
|
||||
# defaults, where the snapshot API is compiled out — so the Windows link fails with four
|
||||
# undefined symbols (`sqlite3_snapshot_open/get/free/cmp`) long after the library itself resolves.
|
||||
#
|
||||
# Used via `--overlay-triplets=windows/vcpkg-triplets` (windows/build.ps1, windows.yml). The
|
||||
# `-nucleic` suffix keeps this tree from colliding with a stock `x64-windows-static-md` install
|
||||
# in the same vcpkg root.
|
||||
set(VCPKG_TARGET_ARCHITECTURE x64)
|
||||
set(VCPKG_CRT_LINKAGE dynamic)
|
||||
set(VCPKG_LIBRARY_LINKAGE static)
|
||||
set(VCPKG_C_FLAGS "/DSQLITE_ENABLE_SNAPSHOT")
|
||||
set(VCPKG_CXX_FLAGS "/DSQLITE_ENABLE_SNAPSHOT")
|
||||
Reference in New Issue
Block a user