std.crypto: make ff.ct_unprotected.limbsCmpLt compile (#19741)
[zig.git] / ci / aarch64-windows.ps1
blob72da7c3a89d648d47f58cd142bfe1a3bb8efc4de
1 $TARGET = "$($Env:ARCH)-windows-gnu"
2 $ZIG_LLVM_CLANG_LLD_NAME = "zig+llvm+lld+clang-$TARGET-0.12.0-dev.2087+e9a18010b"
3 $MCPU = "baseline"
4 $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"
7 $ZIG_LIB_DIR = "$(Get-Location)\lib"
9 if (!(Test-Path "..\$ZIG_LLVM_CLANG_LLD_NAME.zip")) {
10 Write-Output "Downloading $ZIG_LLVM_CLANG_LLD_URL"
11 Invoke-WebRequest -Uri "$ZIG_LLVM_CLANG_LLD_URL" -OutFile "..\$ZIG_LLVM_CLANG_LLD_NAME.zip"
13 Write-Output "Extracting..."
14 Add-Type -AssemblyName System.IO.Compression.FileSystem ;
15 [System.IO.Compression.ZipFile]::ExtractToDirectory("$PWD\..\$ZIG_LLVM_CLANG_LLD_NAME.zip", "$PWD\..")
18 function CheckLastExitCode {
19 if (!$?) {
20 exit 1
22 return 0
25 # Make the `zig version` number consistent.
26 # This will affect the `zig build` command below which uses `git describe`.
27 git fetch --tags
29 if ((git rev-parse --is-shallow-repository) -eq "true") {
30 git fetch --unshallow # `git describe` won't work on a shallow repo
33 Write-Output "Building from source..."
34 Remove-Item -Path 'build-release' -Recurse -Force -ErrorAction Ignore
35 New-Item -Path 'build-release' -ItemType Directory
36 Set-Location -Path 'build-release'
38 # Override the cache directories because they won't actually help other CI runs
39 # which will be testing alternate versions of zig, and ultimately would just
40 # fill up space on the hard drive for no reason.
41 $Env:ZIG_GLOBAL_CACHE_DIR="$(Get-Location)\zig-global-cache"
42 $Env:ZIG_LOCAL_CACHE_DIR="$(Get-Location)\zig-local-cache"
44 # CMake gives a syntax error when file paths with backward slashes are used.
45 # Here, we use forward slashes only to work around this.
46 & cmake .. `
47 -GNinja `
48 -DCMAKE_INSTALL_PREFIX="stage3-release" `
49 -DCMAKE_PREFIX_PATH="$($PREFIX_PATH -Replace "\\", "/")" `
50 -DCMAKE_BUILD_TYPE=Release `
51 -DCMAKE_C_COMPILER="$($ZIG -Replace "\\", "/");cc;-target;$TARGET;-mcpu=$MCPU" `
52 -DCMAKE_CXX_COMPILER="$($ZIG -Replace "\\", "/");c++;-target;$TARGET;-mcpu=$MCPU" `
53 -DCMAKE_AR="$ZIG" `
54 -DZIG_AR_WORKAROUND=ON `
55 -DZIG_TARGET_TRIPLE="$TARGET" `
56 -DZIG_TARGET_MCPU="$MCPU" `
57 -DZIG_STATIC=ON `
58 -DZIG_NO_LIB=ON
59 CheckLastExitCode
61 ninja install
62 CheckLastExitCode
64 Write-Output "Main test suite..."
65 & "stage3-release\bin\zig.exe" build test docs `
66 --zig-lib-dir "$ZIG_LIB_DIR" `
67 --search-prefix "$PREFIX_PATH" `
68 -Dstatic-llvm `
69 -Dskip-non-native `
70 -Denable-symlinks-windows
71 CheckLastExitCode