authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-12-06 12:19:24-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-12-06 12:27:28-07:00
log106e9678937a662fec220367d5d57d04eb09b6b7
treedc5009970f3a96f49636d461e8e6cc9ae2fbc516
parenta0a2e757730cdf8fa8fe3df6f155d0aae1303438

CI: revert windows script to master branch version

This commit chickens out and reverts 02456a32ad6fa672ea383b57a2b9f592b9e2b9ed, leaving it for a future enhancement.

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

ci/x86_64-windows.ps1+26-32
...@@ -1,17 +1,20 @@...@@ -1,17 +1,20 @@
1$TARGET = "$($Env:ARCH)-windows-gnu"1$TARGET = "$($Env:ARCH)-windows-gnu"
2$ZIG_LLVM_CLANG_LLD_NAME = "zig+llvm+lld+clang-$TARGET-0.11.0-dev.448+e6e459e9e"2$ZIG_LLVM_CLANG_LLD_NAME = "zig+llvm+lld+clang-$TARGET-0.11.0-dev.448+e6e459e9e"
3$MCPU = "baseline"
4$ZIG_LLVM_CLANG_LLD_URL = "https://ziglang.org/deps/$ZIG_LLVM_CLANG_LLD_NAME.zip"3$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"
74
8Write-Output "Downloading $ZIG_LLVM_CLANG_LLD_URL"5Write-Output "Downloading $ZIG_LLVM_CLANG_LLD_URL"
6
9Invoke-WebRequest -Uri "$ZIG_LLVM_CLANG_LLD_URL" -OutFile "$ZIG_LLVM_CLANG_LLD_NAME.zip"7Invoke-WebRequest -Uri "$ZIG_LLVM_CLANG_LLD_URL" -OutFile "$ZIG_LLVM_CLANG_LLD_NAME.zip"
108
11Write-Output "Extracting..."9Write-Output "Extracting..."
10
12Add-Type -AssemblyName System.IO.Compression.FileSystem ;11Add-Type -AssemblyName System.IO.Compression.FileSystem ;
13[System.IO.Compression.ZipFile]::ExtractToDirectory("$PWD/$ZIG_LLVM_CLANG_LLD_NAME.zip", "$PWD")12[System.IO.Compression.ZipFile]::ExtractToDirectory("$PWD/$ZIG_LLVM_CLANG_LLD_NAME.zip", "$PWD")
1413
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
15function CheckLastExitCode {18function CheckLastExitCode {
16 if (!$?) {19 if (!$?) {
17 exit 120 exit 1
...@@ -28,41 +31,32 @@ if ((git rev-parse --is-shallow-repository) -eq "true") {...@@ -28,41 +31,32 @@ if ((git rev-parse --is-shallow-repository) -eq "true") {
28 git fetch --unshallow # `git describe` won't work on a shallow repo31 git fetch --unshallow # `git describe` won't work on a shallow repo
29}32}
3033
31Write-Output "Building from source..."34Write-Output "Building Zig..."
32Remove-Item -Path 'build-release' -Recurse -Force -ErrorAction Ignore
33New-Item -Path 'build-release' -ItemType Directory
34Set-Location -Path 'build-release'
3535
36# CMake gives a syntax error when file paths with backward slashes are used.36& "$ZIGPREFIXPATH\bin\zig.exe" build `
37# Here, we use forward slashes only to work around this.37 --prefix "$ZIGINSTALLDIR" `
38& cmake .. `38 --search-prefix "$ZIGPREFIXPATH" `
39 -GNinja `39 --zig-lib-dir "$ZIGLIBDIR" `
40 -DCMAKE_INSTALL_PREFIX="stage3-release" `40 -Dstatic-llvm `
41 -DCMAKE_PREFIX_PATH="$($PREFIX_PATH -Replace "\\", "/")" `41 -Drelease `
42 -DCMAKE_BUILD_TYPE=Release `42 -Duse-zig-libcxx `
43 -DCMAKE_C_COMPILER="$($ZIG -Replace "\\", "/");cc;-target;$TARGET;-mcpu=$MCPU" `43 -Dtarget="$TARGET"
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
48CheckLastExitCode44CheckLastExitCode
4945
50ninja install46Write-Output " zig build test docs..."
51CheckLastExitCode
5247
53Write-Output "Main test suite..."48& "$ZIGINSTALLDIR\bin\zig.exe" build test docs `
54& "stage3-release\bin\zig.exe" build test docs `49 --search-prefix "$ZIGPREFIXPATH" `
55 --zig-lib-dir "..\lib" `50 -Dstatic-llvm `
56 --search-prefix "../$ZIG_LLVM_CLANG_LLD_NAME" `51 -Dskip-non-native `
57 -Dstatic-llvm `52 -Denable-symlinks-windows
58 -Dskip-non-native `
59 -Denable-symlinks-windows
60CheckLastExitCode53CheckLastExitCode
6154
62Write-Output "Testing Autodocs..."55# Produce the experimental std lib documentation.
63& "stage3-release\bin\zig.exe" test "..\lib\std\std.zig" `56Write-Output "zig test std/std.zig..."
64 --zig-lib-dir "..\lib" `57
58& "$ZIGINSTALLDIR\bin\zig.exe" test "$ZIGLIBDIR\std\std.zig" `
59 --zig-lib-dir "$ZIGLIBDIR" `
65 -femit-docs `60 -femit-docs `
66 -fno-emit-bin61 -fno-emit-bin
67CheckLastExitCode62CheckLastExitCode
68