authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-04-15 12:40:22-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-04-15 12:40:22-07:00
logc795e82cbccaa4c68272c7891841526c00f0db90
treec20b046db94ab60db8367f50d11c010a1b2a095b
parentc49fe52cb1778d6398a588889711848817ce64ec

ci: windows: update to llvm 12 msvc tarball


6 files changed, 100 insertions(+), 97 deletions(-)

ci/azure/pipelines.yml+1-1
...@@ -60,7 +60,7 @@ jobs:...@@ -60,7 +60,7 @@ jobs:
60 - task: DownloadSecureFile@160 - task: DownloadSecureFile@1
61 inputs:61 inputs:
62 secureFile: s3cfg62 secureFile: s3cfg
63 - script: ci/azure/windows_script.bat63 - script: ci/azure/windows_msvc_script.bat
64 name: main64 name: main
65 displayName: 'Build and test'65 displayName: 'Build and test'
66- job: OnMasterSuccess66- job: OnMasterSuccess
ci/azure/windows_msvc_install created+11
...@@ -0,0 +1,11 @@
1#!/bin/sh
2
3set -x
4set -e
5
6pacman -Suy --needed --noconfirm
7pacman -S --needed --noconfirm wget p7zip python3-pip tar xz
8
9pip install s3cmd
10wget -nv "https://ziglang.org/deps/llvm%2bclang%2blld-12.0.0-x86_64-windows-msvc-release-mt.tar.xz"
11tar xf llvm+clang+lld-12.0.0-x86_64-windows-msvc-release-mt.tar.xz
ci/azure/windows_msvc_script.bat created+47
...@@ -0,0 +1,47 @@
1@echo on
2SET "SRCROOT=%cd%"
3SET "PREVPATH=%PATH%"
4SET "PREVMSYSEM=%MSYSTEM%"
5
6set "PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem"
7SET "MSYSTEM=MINGW64"
8bash -lc "cd ${SRCROOT} && ci/azure/windows_msvc_install" || exit /b
9SET "PATH=%PREVPATH%"
10SET "MSYSTEM=%PREVMSYSTEM%"
11
12SET "ZIGBUILDDIR=%SRCROOT%\build"
13SET "ZIGINSTALLDIR=%ZIGBUILDDIR%\dist"
14SET "ZIGPREFIXPATH=%SRCROOT%\llvm+clang+lld-12.0.0-x86_64-windows-msvc-release-mt"
15
16call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
17
18REM Make the `zig version` number consistent.
19REM This will affect the cmake command below.
20git.exe config core.abbrev 9
21git.exe fetch --unshallow
22git.exe fetch --tags
23
24mkdir %ZIGBUILDDIR%
25cd %ZIGBUILDDIR%
26cmake.exe .. -Thost=x64 -G"Visual Studio 16 2019" -A x64 "-DCMAKE_INSTALL_PREFIX=%ZIGINSTALLDIR%" "-DCMAKE_PREFIX_PATH=%ZIGPREFIXPATH%" -DCMAKE_BUILD_TYPE=Release -DZIG_OMIT_STAGE2=ON || exit /b
27msbuild /maxcpucount /p:Configuration=Release INSTALL.vcxproj || exit /b
28
29"%ZIGINSTALLDIR%\bin\zig.exe" build test-behavior -Dskip-non-native || exit /b
30REM Disabled to prevent OOM
31REM "%ZIGINSTALLDIR%\bin\zig.exe" build test-stage2 -Dskip-non-native || exit /b
32"%ZIGINSTALLDIR%\bin\zig.exe" build test-fmt -Dskip-non-native || exit /b
33"%ZIGINSTALLDIR%\bin\zig.exe" build test-std -Dskip-non-native || exit /b
34"%ZIGINSTALLDIR%\bin\zig.exe" build test-compiler-rt -Dskip-non-native || exit /b
35"%ZIGINSTALLDIR%\bin\zig.exe" build test-compare-output -Dskip-non-native || exit /b
36"%ZIGINSTALLDIR%\bin\zig.exe" build test-standalone -Dskip-non-native || exit /b
37"%ZIGINSTALLDIR%\bin\zig.exe" build test-stack-traces -Dskip-non-native || exit /b
38"%ZIGINSTALLDIR%\bin\zig.exe" build test-cli -Dskip-non-native || exit /b
39"%ZIGINSTALLDIR%\bin\zig.exe" build test-asm-link -Dskip-non-native || exit /b
40"%ZIGINSTALLDIR%\bin\zig.exe" build test-runtime-safety -Dskip-non-native || exit /b
41"%ZIGINSTALLDIR%\bin\zig.exe" build test-translate-c -Dskip-non-native || exit /b
42"%ZIGINSTALLDIR%\bin\zig.exe" build test-run-translated-c -Dskip-non-native || exit /b
43"%ZIGINSTALLDIR%\bin\zig.exe" build docs || exit /b
44
45set "PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem"
46SET "MSYSTEM=MINGW64"
47bash -lc "cd ${SRCROOT} && ci/azure/windows_upload" || exit /b
ci/azure/windows_script deleted-88
...@@ -1,88 +0,0 @@
1#!/bin/sh
2
3set -x
4set -e
5
6pacman -Suy --needed --noconfirm
7pacman -S --needed --noconfirm cmake git ninja wget p7zip python3-pip tar xz
8
9pip install s3cmd
10
11ZIGDIR="$(pwd)"
12CACHE_BASENAME="zig+llvm+lld+clang-x86_64-windows-gnu-0.8.0-dev.1951+c59241bda"
13PREFIX="$HOME/$CACHE_BASENAME"
14ZIG="$PREFIX/bin/zig.exe"
15
16cd "$HOME"
17wget -nv "https://ziglang.org/deps/$CACHE_BASENAME.tar.xz"
18tar xf "$CACHE_BASENAME.tar.xz"
19
20cd "$ZIGDIR"
21
22# Make the `zig version` number consistent.
23# This will affect the cmake command below.
24git config core.abbrev 9
25git fetch --unshallow || true
26git fetch --tags
27
28mkdir build
29cd build
30"$ZIG" build -Dstage1 -Domit-stage2 -Drelease \
31 -Dtarget=x86_64-windows-gnu \
32 -Dcpu=x86_64_v2 \
33 --search-prefix "$PREFIX" \
34 --override-lib-dir "$ZIGDIR/lib" \
35 --prefix "$(pwd)/dist"
36
37dist/bin/zig.exe build test-behavior -Dskip-non-native
38# Disabled to prevent OOM
39# dist/bin/zig build test-stage2
40dist/bin/zig.exe build test-fmt -Dskip-non-native
41dist/bin/zig.exe build test-std -Dskip-non-native
42dist/bin/zig.exe build test-compiler-rt -Dskip-non-native
43dist/bin/zig.exe build test-compare-output -Dskip-non-native
44dist/bin/zig.exe build test-standalone -Dskip-non-native
45dist/bin/zig.exe build test-stack-traces -Dskip-non-native
46dist/bin/zig.exe build test-cli -Dskip-non-native
47dist/bin/zig.exe build test-asm-link -Dskip-non-native
48dist/bin/zig.exe build test-runtime-safety -Dskip-non-native
49dist/bin/zig.exe build test-translate-c -Dskip-non-native
50dist/bin/zig.exe build test-run-translated-c -Dskip-non-native
51dist/bin/zig.exe build docs
52
53if [ "${BUILD_REASON}" != "PullRequest" ]; then
54 cd "$ZIGDIR/build"
55
56 mv ../LICENSE dist/
57 mv ../zig-cache/langref.html dist/
58 mv dist/bin/zig.exe dist/
59 rmdir dist/bin
60
61 VERSION=$(dist/zig.exe version)
62 DIRNAME="zig-windows-x86_64-$VERSION"
63 TARBALL="$DIRNAME.zip"
64 mv dist "$DIRNAME"
65 7z a "$TARBALL" "$DIRNAME"
66
67 # mv "$DOWNLOADSECUREFILE_SECUREFILEPATH" "$HOME/.s3cfg"
68 s3cmd -c "$DOWNLOADSECUREFILE_SECUREFILEPATH" put -P --add-header="cache-control: public, max-age=31536000, immutable" "$TARBALL" s3://ziglang.org/builds/
69
70 SHASUM=$(sha256sum $TARBALL | cut '-d ' -f1)
71 BYTESIZE=$(wc -c < $TARBALL)
72
73 JSONFILE="windows-$GITBRANCH.json"
74 touch $JSONFILE
75 echo "{\"tarball\": \"$TARBALL\"," >>$JSONFILE
76 echo "\"shasum\": \"$SHASUM\"," >>$JSONFILE
77 echo "\"size\": \"$BYTESIZE\"}" >>$JSONFILE
78
79 s3cmd -c "$DOWNLOADSECUREFILE_SECUREFILEPATH" put -P --add-header="Cache-Control: max-age=0, must-revalidate" "$JSONFILE" "s3://ziglang.org/builds/$JSONFILE"
80 s3cmd -c "$DOWNLOADSECUREFILE_SECUREFILEPATH" put -P "$JSONFILE" "s3://ziglang.org/builds/x86_64-windows-$VERSION.json"
81
82 # `set -x` causes these variables to be mangled.
83 # See https://developercommunity.visualstudio.com/content/problem/375679/pipeline-variable-incorrectly-inserts-single-quote.html
84 set +x
85 echo "##vso[task.setvariable variable=tarball;isOutput=true]$TARBALL"
86 echo "##vso[task.setvariable variable=shasum;isOutput=true]$SHASUM"
87 echo "##vso[task.setvariable variable=bytesize;isOutput=true]$BYTESIZE"
88fi
ci/azure/windows_script.bat deleted-8
...@@ -1,8 +0,0 @@
1@echo on
2SET "SRCROOT=%cd%"
3SET "PREVPATH=%PATH%"
4SET "PREVMSYSEM=%MSYSTEM%"
5
6set "PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem"
7SET "MSYSTEM=MINGW64"
8bash -lc "cd ${SRCROOT} && ci/azure/windows_script" || exit /b
ci/azure/windows_upload created+41
...@@ -0,0 +1,41 @@
1#!/bin/sh
2
3set -x
4set -e
5
6if [ "${BUILD_REASON}" != "PullRequest" ]; then
7 cd "$ZIGBUILDDIR"
8
9 mv ../LICENSE dist/
10 mv ../zig-cache/langref.html dist/
11 mv dist/bin/zig.exe dist/
12 rmdir dist/bin
13
14 VERSION=$(dist/zig.exe version)
15 DIRNAME="zig-windows-x86_64-$VERSION"
16 TARBALL="$DIRNAME.zip"
17 mv dist "$DIRNAME"
18 7z a "$TARBALL" "$DIRNAME"
19
20 # mv "$DOWNLOADSECUREFILE_SECUREFILEPATH" "$HOME/.s3cfg"
21 s3cmd -c "$DOWNLOADSECUREFILE_SECUREFILEPATH" put -P --add-header="cache-control: public, max-age=31536000, immutable" "$TARBALL" s3://ziglang.org/builds/
22
23 SHASUM=$(sha256sum $TARBALL | cut '-d ' -f1)
24 BYTESIZE=$(wc -c < $TARBALL)
25
26 JSONFILE="windows-$GITBRANCH.json"
27 touch $JSONFILE
28 echo "{\"tarball\": \"$TARBALL\"," >>$JSONFILE
29 echo "\"shasum\": \"$SHASUM\"," >>$JSONFILE
30 echo "\"size\": \"$BYTESIZE\"}" >>$JSONFILE
31
32 s3cmd -c "$DOWNLOADSECUREFILE_SECUREFILEPATH" put -P --add-header="Cache-Control: max-age=0, must-revalidate" "$JSONFILE" "s3://ziglang.org/builds/$JSONFILE"
33 s3cmd -c "$DOWNLOADSECUREFILE_SECUREFILEPATH" put -P "$JSONFILE" "s3://ziglang.org/builds/x86_64-windows-$VERSION.json"
34
35 # `set -x` causes these variables to be mangled.
36 # See https://developercommunity.visualstudio.com/content/problem/375679/pipeline-variable-incorrectly-inserts-single-quote.html
37 set +x
38 echo "##vso[task.setvariable variable=tarball;isOutput=true]$TARBALL"
39 echo "##vso[task.setvariable variable=shasum;isOutput=true]$SHASUM"
40 echo "##vso[task.setvariable variable=bytesize;isOutput=true]$BYTESIZE"
41fi