Skip to content

Commit d9a5efe

Browse files
committed
Fix windows build
1 parent 2f6d221 commit d9a5efe

2 files changed

Lines changed: 21 additions & 17 deletions

File tree

.github/workflows/ci.yml

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
if: matrix.os == 'windows-latest'
4343
uses: SwiftyLab/setup-swift@latest
4444
with:
45-
swift-version: "5.10"
45+
swift-version: "6.0"
4646

4747
- name: Install dependencies
4848
shell: bash
@@ -61,29 +61,33 @@ jobs:
6161
if: matrix.os == 'windows-latest'
6262
shell: cmd
6363
run: |
64-
:: 1. Initialize Visual Studio Environment
64+
:: 1. Load Visual Studio Environment
6565
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
66+
67+
:: 2. Dynamically find the Swift SDK Root
68+
:: This looks for where swift.exe is and goes up to the SDK folder
69+
for /f "delims=" %%i in ('where swift.exe') do set "SWIFT_BIN_PATH=%%~dpi"
6670

67-
:: 2. Set the SDK Root
68-
set "SDKROOT=C:\Users\runneradmin\AppData\Local\Programs\Swift\Platforms\5.10.1\Windows.platform\Developer\SDKs\Windows.sdk"
69-
70-
:: 3. Verify Swift location and run build
71-
echo Searching for swift.exe...
72-
where swift.exe
73-
if %ERRORLEVEL% NEQ 0 (
74-
echo "ERROR: swift.exe not found in PATH. Checking manual locations..."
75-
dir /s /b C:\Users\runneradmin\AppData\Local\Programs\Swift\swift.exe
71+
:: Logic: If Swift is in ...\Toolchains\6.0.0\usr\bin\,
72+
:: the SDK is usually in ...\Platforms\6.0.0\Windows.platform\Developer\SDKs\Windows.sdk
73+
:: SwiftyLab usually organizes them under a common 'Swift' root.
74+
set "SDKROOT=%SWIFT_BIN_PATH%..\..\..\..\Platforms\Windows.platform\Developer\SDKs\Windows.sdk"
75+
76+
:: 3. Verify the path exists (Debugging)
77+
echo Resolved SDKROOT to: %SDKROOT%
78+
if not exist "%SDKROOT%" (
79+
echo WARNING: SDKROOT path not found. Falling back to manual check.
80+
dir C:\Users\runneradmin\AppData\Local\Programs\Swift\Platforms /s /b
7681
)
77-
78-
echo Starting Fresh Swift Build...
82+
83+
echo Starting Fresh Swift Build (Swift 6.0)...
7984
swift build -c release -v
80-
85+
8186
if %ERRORLEVEL% NEQ 0 (
8287
echo "Swift build failed with exit code %ERRORLEVEL%"
8388
exit /b %ERRORLEVEL%
8489
)
85-
86-
:: 4. Show the results
90+
8791
echo Build finished. Searching for DLL...
8892
dir /s /b .build\*.dll
8993

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version: 5.10
1+
// swift-tools-version: 6.0
22
import PackageDescription
33

44
let packagePlatforms: [SupportedPlatform]

0 commit comments

Comments
 (0)