authorgravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2022-12-07 00:45:03-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-12-07 01:34:21-07:00
logeb4337fe8362b7faab34e974d3538d21a10a151f
tree18cfa5941937bccfde2e0320c94714ab40c98bb9
parent53a9ee699a35a3d245ab6d1dac1f0687a4dcb42c

Revert "CI: revert windows script to master branch version"

This reverts commit 106e9678937a662fec220367d5d57d04eb09b6b7.

1 files changed, 32 insertions(+), 26 deletions(-)

ci/x86_64-windows.ps1+32-26
......@@ -1,20 +1,17 @@
11$TARGET = "$($Env:ARCH)-windows-gnu"
22$ZIG_LLVM_CLANG_LLD_NAME = "zig+llvm+lld+clang-$TARGET-0.11.0-dev.448+e6e459e9e"
3$MCPU = "baseline"
34$ZIG_LLVM_CLANG_LLD_URL = "https://ziglang.org/deps/$ZIG_LLVM_CLANG_LLD_NAME.zip"
5$PREFIX_PATH = "$(Get-Location)\$ZIG_LLVM_CLANG_LLD_NAME"
6$ZIG = "$PREFIX_PATH\bin\zig.exe"
47
58Write-Output "Downloading $ZIG_LLVM_CLANG_LLD_URL"
6
79Invoke-WebRequest -Uri "$ZIG_LLVM_CLANG_LLD_URL" -OutFile "$ZIG_LLVM_CLANG_LLD_NAME.zip"
810
911Write-Output "Extracting..."
10
1112Add-Type -AssemblyName System.IO.Compression.FileSystem ;
1213[System.IO.Compression.ZipFile]::ExtractToDirectory("$PWD/$ZIG_LLVM_CLANG_LLD_NAME.zip", "$PWD")
1314
14Set-Variable -Name ZIGLIBDIR -Value "$(Get-Location)\lib"
15Set-Variable -Name ZIGINSTALLDIR -Value "$(Get-Location)\stage3-release"
16Set-Variable -Name ZIGPREFIXPATH -Value "$(Get-Location)\$ZIG_LLVM_CLANG_LLD_NAME"
17
1815function CheckLastExitCode {
1916 if (!$?) {
2017 exit 1
......@@ -31,32 +28,41 @@ if ((git rev-parse --is-shallow-repository) -eq "true") {
3128 git fetch --unshallow # `git describe` won't work on a shallow repo
3229}
3330
34Write-Output "Building Zig..."
31Write-Output "Building from source..."
32Remove-Item -Path 'build-release' -Recurse -Force -ErrorAction Ignore
33New-Item -Path 'build-release' -ItemType Directory
34Set-Location -Path 'build-release'
3535
36& "$ZIGPREFIXPATH\bin\zig.exe" build `
37 --prefix "$ZIGINSTALLDIR" `
38 --search-prefix "$ZIGPREFIXPATH" `
39 --zig-lib-dir "$ZIGLIBDIR" `
40 -Dstatic-llvm `
41 -Drelease `
42 -Duse-zig-libcxx `
43 -Dtarget="$TARGET"
36# CMake gives a syntax error when file paths with backward slashes are used.
37# Here, we use forward slashes only to work around this.
38& cmake .. `
39 -GNinja `
40 -DCMAKE_INSTALL_PREFIX="stage3-release" `
41 -DCMAKE_PREFIX_PATH="$($PREFIX_PATH -Replace "\\", "/")" `
42 -DCMAKE_BUILD_TYPE=Release `
43 -DCMAKE_C_COMPILER="$($ZIG -Replace "\\", "/");cc;-target;$TARGET;-mcpu=$MCPU" `
44 -DCMAKE_CXX_COMPILER="$($ZIG -Replace "\\", "/");c++;-target;$TARGET;-mcpu=$MCPU" `
45 -DZIG_TARGET_TRIPLE="$TARGET" `
46 -DZIG_TARGET_MCPU="$MCPU" `
47 -DZIG_STATIC=ON
4448CheckLastExitCode
4549
46Write-Output " zig build test docs..."
47
48& "$ZIGINSTALLDIR\bin\zig.exe" build test docs `
49 --search-prefix "$ZIGPREFIXPATH" `
50 -Dstatic-llvm `
51 -Dskip-non-native `
52 -Denable-symlinks-windows
50ninja install
5351CheckLastExitCode
5452
55# Produce the experimental std lib documentation.
56Write-Output "zig test std/std.zig..."
53Write-Output "Main test suite..."
54& "stage3-release\bin\zig.exe" build test docs `
55 --zig-lib-dir "..\lib" `
56 --search-prefix "../$ZIG_LLVM_CLANG_LLD_NAME" `
57 -Dstatic-llvm `
58 -Dskip-non-native `
59 -Denable-symlinks-windows
60CheckLastExitCode
5761
58& "$ZIGINSTALLDIR\bin\zig.exe" test "$ZIGLIBDIR\std\std.zig" `
59 --zig-lib-dir "$ZIGLIBDIR" `
62Write-Output "Testing Autodocs..."
63& "stage3-release\bin\zig.exe" test "..\lib\std\std.zig" `
64 --zig-lib-dir "..\lib" `
6065 -femit-docs `
6166 -fno-emit-bin
6267CheckLastExitCode
68