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 @@
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"
43$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
85Write-Output "Downloading $ZIG_LLVM_CLANG_LLD_URL"
6
97Invoke-WebRequest -Uri "$ZIG_LLVM_CLANG_LLD_URL" -OutFile "$ZIG_LLVM_CLANG_LLD_NAME.zip"
108
119Write-Output "Extracting..."
10
1211Add-Type -AssemblyName System.IO.Compression.FileSystem ;
1312[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
1518function CheckLastExitCode {
1619 if (!$?) {
1720 exit 1
......@@ -28,41 +31,32 @@ if ((git rev-parse --is-shallow-repository) -eq "true") {
2831 git fetch --unshallow # `git describe` won't work on a shallow repo
2932}
3033
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'
34Write-Output "Building Zig..."
3535
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
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"
4844CheckLastExitCode
4945
50ninja install
51CheckLastExitCode
46Write-Output " zig build test docs..."
5247
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
48& "$ZIGINSTALLDIR\bin\zig.exe" build test docs `
49 --search-prefix "$ZIGPREFIXPATH" `
50 -Dstatic-llvm `
51 -Dskip-non-native `
52 -Denable-symlinks-windows
6053CheckLastExitCode
6154
62Write-Output "Testing Autodocs..."
63& "stage3-release\bin\zig.exe" test "..\lib\std\std.zig" `
64 --zig-lib-dir "..\lib" `
55# Produce the experimental std lib documentation.
56Write-Output "zig test std/std.zig..."
57
58& "$ZIGINSTALLDIR\bin\zig.exe" test "$ZIGLIBDIR\std\std.zig" `
59 --zig-lib-dir "$ZIGLIBDIR" `
6560 -femit-docs `
6661 -fno-emit-bin
6762CheckLastExitCode
68