Skip to content

Commit c35e1c5

Browse files
committed
File path error yml building dll
1 parent d9a5efe commit c35e1c5

1 file changed

Lines changed: 16 additions & 22 deletions

File tree

.github/workflows/ci.yml

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -61,34 +61,28 @@ jobs:
6161
if: matrix.os == 'windows-latest'
6262
shell: cmd
6363
run: |
64-
:: 1. Load Visual Studio Environment
64+
:: 1. Initialize 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"
70-
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
81-
)
82-
83-
echo Starting Fresh Swift Build (Swift 6.0)...
66+
67+
:: 2. Set the SDK Root precisely for 6.0.3
68+
:: Based on your log, the folder includes the version number '6.0.3'
69+
set "SDKROOT=C:\Users\runneradmin\AppData\Local\Programs\Swift\Platforms\6.0.3\Windows.platform\Developer\SDKs\Windows.sdk"
70+
71+
:: 3. Export SWIFTFLAGS so the compiler finds the libraries
72+
set "SWIFTFLAGS=-sdk %SDKROOT% -I %SDKROOT%\usr\lib\swift -L %SDKROOT%\usr\lib\swift\windows"
73+
74+
echo Verifying SDK path...
75+
if exist "%SDKROOT%" (echo SDK found!) else (echo ERROR: SDK NOT FOUND at %SDKROOT% && dir C:\Users\runneradmin\AppData\Local\Programs\Swift\Platforms /s /b && exit /b 1)
76+
77+
echo Starting Fresh Swift Build...
8478
swift build -c release -v
85-
79+
8680
if %ERRORLEVEL% NEQ 0 (
8781
echo "Swift build failed with exit code %ERRORLEVEL%"
8882
exit /b %ERRORLEVEL%
8983
)
90-
91-
echo Build finished. Searching for DLL...
84+
85+
echo Build finished.
9286
dir /s /b .build\*.dll
9387
9488
- name: Verify library was built

0 commit comments

Comments
 (0)