authorgravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2024-04-13 23:12:52-04:00
committergravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2024-04-14 21:26:09-04:00
log71ccdb5a66da500f8447018553ff0ac32e55face
treeb1f883c456f4fc38b59cb2bea188ea5dad777030
parent425e38b6e0601e12329f93b2e94c76c1da300b8e

ci: add self-hosted x86_64 windows


10 files changed, 48 insertions(+), 62 deletions(-)

.github/workflows/ci.yaml+2-2
......@@ -69,7 +69,7 @@ jobs:
6969 - name: Build and Test
7070 run: ci/aarch64-macos-release.sh
7171 x86_64-windows-debug:
72 runs-on: windows-latest
72 runs-on: [self-hosted, Windows, x86_64]
7373 env:
7474 ARCH: "x86_64"
7575 steps:
......@@ -78,7 +78,7 @@ jobs:
7878 - name: Build and Test
7979 run: ci/x86_64-windows-debug.ps1
8080 x86_64-windows-release:
81 runs-on: windows-latest
81 runs-on: [self-hosted, Windows, x86_64]
8282 env:
8383 ARCH: "x86_64"
8484 steps:
ci/aarch64-linux-debug.sh+6-6
......@@ -29,8 +29,8 @@ cd build-debug
2929# Override the cache directories because they won't actually help other CI runs
3030# which will be testing alternate versions of zig, and ultimately would just
3131# fill up space on the hard drive for no reason.
32export ZIG_GLOBAL_CACHE_DIR="$(pwd)/zig-global-cache"
33export ZIG_LOCAL_CACHE_DIR="$(pwd)/zig-local-cache"
32export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
33export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
3434
3535cmake .. \
3636 -DCMAKE_INSTALL_PREFIX="stage3-debug" \
......@@ -67,7 +67,7 @@ stage3-debug/bin/zig build test docs \
6767 -Dstatic-llvm \
6868 -Dtarget=native-native-musl \
6969 --search-prefix "$PREFIX" \
70 --zig-lib-dir "$(pwd)/../lib"
70 --zig-lib-dir "$PWD/../lib"
7171
7272# Look for HTML errors.
7373# TODO: move this to a build.zig flag (-Denable-tidy)
......@@ -80,8 +80,8 @@ rm -rf ../build-new
8080mkdir ../build-new
8181cd ../build-new
8282
83export ZIG_GLOBAL_CACHE_DIR="$(pwd)/zig-global-cache"
84export ZIG_LOCAL_CACHE_DIR="$(pwd)/zig-local-cache"
83export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
84export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
8585export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
8686export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
8787
......@@ -105,5 +105,5 @@ stage3/bin/zig build -p stage4 \
105105 -Dtarget=native-native-musl \
106106 -Dno-lib \
107107 --search-prefix "$PREFIX" \
108 --zig-lib-dir "$(pwd)/../lib"
108 --zig-lib-dir "$PWD/../lib"
109109stage4/bin/zig test ../test/behavior.zig
ci/aarch64-linux-release.sh+6-6
......@@ -29,8 +29,8 @@ cd build-release
2929# Override the cache directories because they won't actually help other CI runs
3030# which will be testing alternate versions of zig, and ultimately would just
3131# fill up space on the hard drive for no reason.
32export ZIG_GLOBAL_CACHE_DIR="$(pwd)/zig-global-cache"
33export ZIG_LOCAL_CACHE_DIR="$(pwd)/zig-local-cache"
32export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
33export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
3434
3535cmake .. \
3636 -DCMAKE_INSTALL_PREFIX="stage3-release" \
......@@ -67,7 +67,7 @@ stage3-release/bin/zig build test docs \
6767 -Dstatic-llvm \
6868 -Dtarget=native-native-musl \
6969 --search-prefix "$PREFIX" \
70 --zig-lib-dir "$(pwd)/../lib"
70 --zig-lib-dir "$PWD/../lib"
7171
7272# Look for HTML errors.
7373# TODO: move this to a build.zig flag (-Denable-tidy)
......@@ -80,8 +80,8 @@ rm -rf ../build-new
8080mkdir ../build-new
8181cd ../build-new
8282
83export ZIG_GLOBAL_CACHE_DIR="$(pwd)/zig-global-cache"
84export ZIG_LOCAL_CACHE_DIR="$(pwd)/zig-local-cache"
83export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
84export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
8585export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
8686export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
8787
......@@ -105,5 +105,5 @@ stage3/bin/zig build -p stage4 \
105105 -Dtarget=native-native-musl \
106106 -Dno-lib \
107107 --search-prefix "$PREFIX" \
108 --zig-lib-dir "$(pwd)/../lib"
108 --zig-lib-dir "$PWD/../lib"
109109stage4/bin/zig test ../test/behavior.zig
ci/aarch64-macos-debug.sh+4-4
......@@ -6,7 +6,7 @@ set -e
66# Script assumes the presence of the following:
77# s3cmd
88
9ZIGDIR="$(pwd)"
9ZIGDIR="$PWD"
1010TARGET="$ARCH-macos-none"
1111MCPU="baseline"
1212CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.12.0-dev.467+0345d7866"
......@@ -26,8 +26,8 @@ cd build
2626# Override the cache directories because they won't actually help other CI runs
2727# which will be testing alternate versions of zig, and ultimately would just
2828# fill up space on the hard drive for no reason.
29export ZIG_GLOBAL_CACHE_DIR="$(pwd)/zig-global-cache"
30export ZIG_LOCAL_CACHE_DIR="$(pwd)/zig-local-cache"
29export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
30export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
3131
3232PATH="$HOME/local/bin:$PATH" cmake .. \
3333 -DCMAKE_INSTALL_PREFIX="stage3-debug" \
......@@ -44,7 +44,7 @@ PATH="$HOME/local/bin:$PATH" cmake .. \
4444$HOME/local/bin/ninja install
4545
4646stage3-debug/bin/zig build test docs \
47 --zig-lib-dir "$(pwd)/../lib" \
47 --zig-lib-dir "$PWD/../lib" \
4848 -Denable-macos-sdk \
4949 -Dstatic-llvm \
5050 -Dskip-non-native \
ci/aarch64-macos-release.sh+4-4
......@@ -6,7 +6,7 @@ set -e
66# Script assumes the presence of the following:
77# s3cmd
88
9ZIGDIR="$(pwd)"
9ZIGDIR="$PWD"
1010TARGET="$ARCH-macos-none"
1111MCPU="baseline"
1212CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.12.0-dev.467+0345d7866"
......@@ -26,8 +26,8 @@ cd build
2626# Override the cache directories because they won't actually help other CI runs
2727# which will be testing alternate versions of zig, and ultimately would just
2828# fill up space on the hard drive for no reason.
29export ZIG_GLOBAL_CACHE_DIR="$(pwd)/zig-global-cache"
30export ZIG_LOCAL_CACHE_DIR="$(pwd)/zig-local-cache"
29export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
30export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
3131
3232PATH="$HOME/local/bin:$PATH" cmake .. \
3333 -DCMAKE_INSTALL_PREFIX="stage3-release" \
......@@ -44,7 +44,7 @@ PATH="$HOME/local/bin:$PATH" cmake .. \
4444$HOME/local/bin/ninja install
4545
4646stage3-release/bin/zig build test docs \
47 --zig-lib-dir "$(pwd)/../lib" \
47 --zig-lib-dir "$PWD/../lib" \
4848 -Denable-macos-sdk \
4949 -Dstatic-llvm \
5050 -Dskip-non-native \
ci/x86_64-linux-debug.sh+6-6
......@@ -37,8 +37,8 @@ cd build-debug
3737# Override the cache directories because they won't actually help other CI runs
3838# which will be testing alternate versions of zig, and ultimately would just
3939# fill up space on the hard drive for no reason.
40export ZIG_GLOBAL_CACHE_DIR="$(pwd)/zig-global-cache"
41export ZIG_LOCAL_CACHE_DIR="$(pwd)/zig-local-cache"
40export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
41export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
4242
4343cmake .. \
4444 -DCMAKE_INSTALL_PREFIX="stage3-debug" \
......@@ -75,7 +75,7 @@ stage3-debug/bin/zig build test docs \
7575 -Dstatic-llvm \
7676 -Dtarget=native-native-musl \
7777 --search-prefix "$PREFIX" \
78 --zig-lib-dir "$(pwd)/../lib"
78 --zig-lib-dir "$PWD/../lib"
7979
8080# Look for HTML errors.
8181# TODO: move this to a build.zig flag (-Denable-tidy)
......@@ -88,8 +88,8 @@ rm -rf ../build-new
8888mkdir ../build-new
8989cd ../build-new
9090
91export ZIG_GLOBAL_CACHE_DIR="$(pwd)/zig-global-cache"
92export ZIG_LOCAL_CACHE_DIR="$(pwd)/zig-local-cache"
91export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
92export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
9393export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
9494export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
9595
......@@ -113,5 +113,5 @@ stage3/bin/zig build -p stage4 \
113113 -Dtarget=native-native-musl \
114114 -Dno-lib \
115115 --search-prefix "$PREFIX" \
116 --zig-lib-dir "$(pwd)/../lib"
116 --zig-lib-dir "$PWD/../lib"
117117stage4/bin/zig test ../test/behavior.zig
ci/x86_64-linux-release.sh+6-6
......@@ -37,8 +37,8 @@ cd build-release
3737# Override the cache directories because they won't actually help other CI runs
3838# which will be testing alternate versions of zig, and ultimately would just
3939# fill up space on the hard drive for no reason.
40export ZIG_GLOBAL_CACHE_DIR="$(pwd)/zig-global-cache"
41export ZIG_LOCAL_CACHE_DIR="$(pwd)/zig-local-cache"
40export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
41export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
4242
4343cmake .. \
4444 -DCMAKE_INSTALL_PREFIX="stage3-release" \
......@@ -76,7 +76,7 @@ stage3-release/bin/zig build test docs \
7676 -Dstatic-llvm \
7777 -Dtarget=native-native-musl \
7878 --search-prefix "$PREFIX" \
79 --zig-lib-dir "$(pwd)/../lib"
79 --zig-lib-dir "$PWD/../lib"
8080
8181# Look for HTML errors.
8282# TODO: move this to a build.zig flag (-Denable-tidy)
......@@ -105,8 +105,8 @@ rm -rf ../build-new
105105mkdir ../build-new
106106cd ../build-new
107107
108export ZIG_GLOBAL_CACHE_DIR="$(pwd)/zig-global-cache"
109export ZIG_LOCAL_CACHE_DIR="$(pwd)/zig-local-cache"
108export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
109export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
110110export CC="$ZIG cc -target $TARGET -mcpu=$MCPU"
111111export CXX="$ZIG c++ -target $TARGET -mcpu=$MCPU"
112112
......@@ -130,5 +130,5 @@ stage3/bin/zig build -p stage4 \
130130 -Dtarget=native-native-musl \
131131 -Dno-lib \
132132 --search-prefix "$PREFIX" \
133 --zig-lib-dir "$(pwd)/../lib"
133 --zig-lib-dir "$PWD/../lib"
134134stage4/bin/zig test ../test/behavior.zig
ci/x86_64-macos-release.sh+4-4
......@@ -3,7 +3,7 @@
33set -x
44set -e
55
6ZIGDIR="$(pwd)"
6ZIGDIR="$PWD"
77TARGET="$ARCH-macos-none"
88MCPU="baseline"
99CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.12.0-dev.467+0345d7866"
......@@ -40,8 +40,8 @@ cd build
4040# Override the cache directories because they won't actually help other CI runs
4141# which will be testing alternate versions of zig, and ultimately would just
4242# fill up space on the hard drive for no reason.
43export ZIG_GLOBAL_CACHE_DIR="$(pwd)/zig-global-cache"
44export ZIG_LOCAL_CACHE_DIR="$(pwd)/zig-local-cache"
43export ZIG_GLOBAL_CACHE_DIR="$PWD/zig-global-cache"
44export ZIG_LOCAL_CACHE_DIR="$PWD/zig-local-cache"
4545
4646cmake .. \
4747 -DCMAKE_PREFIX_PATH="$PREFIX" \
......@@ -56,7 +56,7 @@ cmake .. \
5656make $JOBS install
5757
5858stage3/bin/zig build test docs \
59 --zig-lib-dir "$(pwd)/../lib" \
59 --zig-lib-dir "$PWD/../lib" \
6060 -Denable-macos-sdk \
6161 -Dstatic-llvm \
6262 -Dskip-non-native \
ci/x86_64-windows-debug.ps1+5-12
......@@ -1,19 +1,10 @@
11$TARGET = "$($Env:ARCH)-windows-gnu"
22$ZIG_LLVM_CLANG_LLD_NAME = "zig+llvm+lld+clang-$TARGET-0.12.0-dev.2073+402fe565a"
33$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"
4$PREFIX_PATH = "$($Env:USERPROFILE)\$ZIG_LLVM_CLANG_LLD_NAME"
65$ZIG = "$PREFIX_PATH\bin\zig.exe"
76$ZIG_LIB_DIR = "$(Get-Location)\lib"
87
9choco install ninja
10Write-Output "Downloading $ZIG_LLVM_CLANG_LLD_URL"
11Invoke-WebRequest -Uri "$ZIG_LLVM_CLANG_LLD_URL" -OutFile "$ZIG_LLVM_CLANG_LLD_NAME.zip"
12
13Write-Output "Extracting..."
14Add-Type -AssemblyName System.IO.Compression.FileSystem ;
15[System.IO.Compression.ZipFile]::ExtractToDirectory("$PWD/$ZIG_LLVM_CLANG_LLD_NAME.zip", "$PWD")
16
178function CheckLastExitCode {
189 if (!$?) {
1910 exit 1
......@@ -43,6 +34,8 @@ Set-Location -Path 'build-debug'
4334 -DCMAKE_BUILD_TYPE=Debug `
4435 -DCMAKE_C_COMPILER="$($ZIG -Replace "\\", "/");cc;-target;$TARGET;-mcpu=$MCPU" `
4536 -DCMAKE_CXX_COMPILER="$($ZIG -Replace "\\", "/");c++;-target;$TARGET;-mcpu=$MCPU" `
37 -DCMAKE_AR="$($ZIG -Replace "\\", "/")" `
38 -DZIG_AR_WORKAROUND=ON `
4639 -DZIG_TARGET_TRIPLE="$TARGET" `
4740 -DZIG_TARGET_MCPU="$MCPU" `
4841 -DZIG_STATIC=ON `
......@@ -85,10 +78,10 @@ CheckLastExitCode
8578 --mod build_options config.zig
8679CheckLastExitCode
8780
88Import-Module "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
81Import-Module "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
8982CheckLastExitCode
9083
91Enter-VsDevShell -VsInstallPath "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" `
84Enter-VsDevShell -VsInstallPath "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools" `
9285 -DevCmdArguments '-arch=x64 -no_logo' `
9386 -StartInPath $(Get-Location)
9487CheckLastExitCode
ci/x86_64-windows-release.ps1+5-12
......@@ -1,19 +1,10 @@
11$TARGET = "$($Env:ARCH)-windows-gnu"
22$ZIG_LLVM_CLANG_LLD_NAME = "zig+llvm+lld+clang-$TARGET-0.12.0-dev.2073+402fe565a"
33$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"
4$PREFIX_PATH = "$($Env:USERPROFILE)\$ZIG_LLVM_CLANG_LLD_NAME"
65$ZIG = "$PREFIX_PATH\bin\zig.exe"
76$ZIG_LIB_DIR = "$(Get-Location)\lib"
87
9choco install ninja
10Write-Output "Downloading $ZIG_LLVM_CLANG_LLD_URL"
11Invoke-WebRequest -Uri "$ZIG_LLVM_CLANG_LLD_URL" -OutFile "$ZIG_LLVM_CLANG_LLD_NAME.zip"
12
13Write-Output "Extracting..."
14Add-Type -AssemblyName System.IO.Compression.FileSystem ;
15[System.IO.Compression.ZipFile]::ExtractToDirectory("$PWD/$ZIG_LLVM_CLANG_LLD_NAME.zip", "$PWD")
16
178function CheckLastExitCode {
189 if (!$?) {
1910 exit 1
......@@ -43,6 +34,8 @@ Set-Location -Path 'build-release'
4334 -DCMAKE_BUILD_TYPE=Release `
4435 -DCMAKE_C_COMPILER="$($ZIG -Replace "\\", "/");cc;-target;$TARGET;-mcpu=$MCPU" `
4536 -DCMAKE_CXX_COMPILER="$($ZIG -Replace "\\", "/");c++;-target;$TARGET;-mcpu=$MCPU" `
37 -DCMAKE_AR="$($ZIG -Replace "\\", "/")" `
38 -DZIG_AR_WORKAROUND=ON `
4639 -DZIG_TARGET_TRIPLE="$TARGET" `
4740 -DZIG_TARGET_MCPU="$MCPU" `
4841 -DZIG_STATIC=ON `
......@@ -84,10 +77,10 @@ CheckLastExitCode
8477 --mod build_options config.zig
8578CheckLastExitCode
8679
87Import-Module "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
80Import-Module "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
8881CheckLastExitCode
8982
90Enter-VsDevShell -VsInstallPath "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" `
83Enter-VsDevShell -VsInstallPath "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools" `
9184 -DevCmdArguments '-arch=x64 -no_logo' `
9285 -StartInPath $(Get-Location)
9386CheckLastExitCode