| author | |
| committer | |
| log | 45eb9554c4feec743924c0193d9ec50d9c94d0e4 |
| tree | 126fdbadea3d0802ebe92b5e2a0eb23982a6e965 |
| parent | 406353103a56dfbf7f7966191ceee5917cc582d9 |
6 files changed, 114 insertions(+), 100 deletions(-)
ci/azure/pipelines.yml+1-1| ... | ... | @@ -60,7 +60,7 @@ jobs: |
| 60 | 60 | - task: DownloadSecureFile@1 |
| 61 | 61 | inputs: |
| 62 | 62 | secureFile: s3cfg |
| 63 | - script: ci/azure/windows_msvc_script.bat | |
| 63 | - script: ci/azure/windows_script.bat | |
| 64 | 64 | name: main |
| 65 | 65 | displayName: 'Build and test' |
| 66 | 66 | - job: OnMasterSuccess |
ci/azure/windows_msvc_install deleted-11| ... | ... | @@ -1,11 +0,0 @@ |
| 1 | #!/bin/sh | |
| 2 | ||
| 3 | set -x | |
| 4 | set -e | |
| 5 | ||
| 6 | pacman -Suy --needed --noconfirm | |
| 7 | pacman -S --needed --noconfirm wget p7zip python3-pip tar xz | |
| 8 | ||
| 9 | pip install s3cmd | |
| 10 | wget -nv "https://ziglang.org/deps/llvm%2bclang%2blld-11.0.0-x86_64-windows-msvc-release-mt.tar.xz" | |
| 11 | tar xf llvm+clang+lld-11.0.0-x86_64-windows-msvc-release-mt.tar.xz |
ci/azure/windows_msvc_script.bat deleted-47| ... | ... | @@ -1,47 +0,0 @@ |
| 1 | @echo on | |
| 2 | SET "SRCROOT=%cd%" | |
| 3 | SET "PREVPATH=%PATH%" | |
| 4 | SET "PREVMSYSEM=%MSYSTEM%" | |
| 5 | ||
| 6 | set "PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem" | |
| 7 | SET "MSYSTEM=MINGW64" | |
| 8 | bash -lc "cd ${SRCROOT} && ci/azure/windows_msvc_install" || exit /b | |
| 9 | SET "PATH=%PREVPATH%" | |
| 10 | SET "MSYSTEM=%PREVMSYSTEM%" | |
| 11 | ||
| 12 | SET "ZIGBUILDDIR=%SRCROOT%\build" | |
| 13 | SET "ZIGINSTALLDIR=%ZIGBUILDDIR%\dist" | |
| 14 | SET "ZIGPREFIXPATH=%SRCROOT%\llvm+clang+lld-11.0.0-x86_64-windows-msvc-release-mt" | |
| 15 | ||
| 16 | call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 | |
| 17 | ||
| 18 | REM Make the `zig version` number consistent. | |
| 19 | REM This will affect the cmake command below. | |
| 20 | git.exe config core.abbrev 9 | |
| 21 | git.exe fetch --unshallow | |
| 22 | git.exe fetch --tags | |
| 23 | ||
| 24 | mkdir %ZIGBUILDDIR% | |
| 25 | cd %ZIGBUILDDIR% | |
| 26 | cmake.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 | |
| 27 | msbuild /maxcpucount /p:Configuration=Release INSTALL.vcxproj || exit /b | |
| 28 | ||
| 29 | "%ZIGINSTALLDIR%\bin\zig.exe" build test-behavior -Dskip-non-native || exit /b | |
| 30 | REM Disabled to prevent OOM | |
| 31 | REM "%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 | ||
| 45 | set "PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem" | |
| 46 | SET "MSYSTEM=MINGW64" | |
| 47 | bash -lc "cd ${SRCROOT} && ci/azure/windows_upload" || exit /b |
ci/azure/windows_script created+105| ... | ... | @@ -0,0 +1,105 @@ |
| 1 | #!/bin/sh | |
| 2 | ||
| 3 | set -x | |
| 4 | set -e | |
| 5 | ||
| 6 | pacman -Suy --needed --noconfirm | |
| 7 | pacman -S --needed --noconfirm cmake ninja wget p7zip python3-pip tar xz | |
| 8 | ||
| 9 | pip install s3cmd | |
| 10 | ||
| 11 | ZIGDIR="$(pwd)" | |
| 12 | CACHE_BASENAME="zig+llvm+lld+clang-x86_64-windows-gnu-0.8.0-dev.1939+5a3ea9bec" | |
| 13 | PREFIX="$HOME/$CACHE_BASENAME" | |
| 14 | ZIG="$PREFIX/bin/zig" | |
| 15 | ||
| 16 | cd "$HOME" | |
| 17 | wget -nv "https://ziglang.org/deps/$CACHE_BASENAME.tar.xz" | |
| 18 | tar xf "$CACHE_BASENAME.tar.xz" | |
| 19 | ||
| 20 | cd "$ZIGDIR" | |
| 21 | ||
| 22 | # Make the `zig version` number consistent. | |
| 23 | # This will affect the cmake command below. | |
| 24 | git config core.abbrev 9 | |
| 25 | git fetch --unshallow || true | |
| 26 | git fetch --tags | |
| 27 | ||
| 28 | export CC="$ZIG cc" | |
| 29 | export CXX="$ZIG c++" | |
| 30 | ||
| 31 | mkdir build | |
| 32 | cd build | |
| 33 | cmake .. -DCMAKE_BUILD_TYPE=Release \ | |
| 34 | "-DCMAKE_PREFIX_PATH=$PREFIX" \ | |
| 35 | "-DCMAKE_INSTALL_PREFIX=$(pwd)/dist" \ | |
| 36 | -DZIG_OMIT_STAGE2=ON \ | |
| 37 | -DZIG_STATIC=ON \ | |
| 38 | -GNinja | |
| 39 | ||
| 40 | # Now cmake will use zig as the C/C++ compiler. We reset the environment variables | |
| 41 | # so that installation and testing do not get affected by them. | |
| 42 | unset CC | |
| 43 | unset CXX | |
| 44 | ||
| 45 | ninja install | |
| 46 | ||
| 47 | # Here we rebuild zig but this time using the Zig binary we just now produced to | |
| 48 | # build zig1.o rather than relying on the one built with stage0. See | |
| 49 | # https://github.com/ziglang/zig/issues/6830 for more details. | |
| 50 | cmake .. -DZIG_EXECUTABLE="$(pwd)/dist/bin/zig.exe" | |
| 51 | ninja install | |
| 52 | ||
| 53 | ||
| 54 | dist/bin/zig build test-behavior -Dskip-non-native | |
| 55 | # Disabled to prevent OOM | |
| 56 | # dist/bin/zig build test-stage2 | |
| 57 | dist/bin/zig build test-fmt -Dskip-non-native | |
| 58 | dist/bin/zig build test-std -Dskip-non-native | |
| 59 | dist/bin/zig build test-compiler-rt -Dskip-non-native | |
| 60 | dist/bin/zig build test-compare-output -Dskip-non-native | |
| 61 | dist/bin/zig build test-standalone -Dskip-non-native | |
| 62 | dist/bin/zig build test-stack-traces -Dskip-non-native | |
| 63 | dist/bin/zig build test-cli -Dskip-non-native | |
| 64 | dist/bin/zig build test-asm-link -Dskip-non-native | |
| 65 | dist/bin/zig build test-runtime-safety -Dskip-non-native | |
| 66 | dist/bin/zig build test-translate-c -Dskip-non-native | |
| 67 | dist/bin/zig build test-run-translated-c -Dskip-non-native | |
| 68 | dist/bin/zig build docs | |
| 69 | ||
| 70 | if [ "${BUILD_REASON}" != "PullRequest" ]; then | |
| 71 | cd "$ZIGDIR/build" | |
| 72 | ||
| 73 | mv ../LICENSE dist/ | |
| 74 | mv ../zig-cache/langref.html dist/ | |
| 75 | mv dist/bin/zig.exe dist/ | |
| 76 | rmdir dist/bin | |
| 77 | ||
| 78 | VERSION=$(dist/zig.exe version) | |
| 79 | DIRNAME="zig-windows-x86_64-$VERSION" | |
| 80 | TARBALL="$DIRNAME.zip" | |
| 81 | mv dist "$DIRNAME" | |
| 82 | 7z a "$TARBALL" "$DIRNAME" | |
| 83 | ||
| 84 | # mv "$DOWNLOADSECUREFILE_SECUREFILEPATH" "$HOME/.s3cfg" | |
| 85 | s3cmd -c "$DOWNLOADSECUREFILE_SECUREFILEPATH" put -P --add-header="cache-control: public, max-age=31536000, immutable" "$TARBALL" s3://ziglang.org/builds/ | |
| 86 | ||
| 87 | SHASUM=$(sha256sum $TARBALL | cut '-d ' -f1) | |
| 88 | BYTESIZE=$(wc -c < $TARBALL) | |
| 89 | ||
| 90 | JSONFILE="windows-$GITBRANCH.json" | |
| 91 | touch $JSONFILE | |
| 92 | echo "{\"tarball\": \"$TARBALL\"," >>$JSONFILE | |
| 93 | echo "\"shasum\": \"$SHASUM\"," >>$JSONFILE | |
| 94 | echo "\"size\": \"$BYTESIZE\"}" >>$JSONFILE | |
| 95 | ||
| 96 | s3cmd -c "$DOWNLOADSECUREFILE_SECUREFILEPATH" put -P --add-header="Cache-Control: max-age=0, must-revalidate" "$JSONFILE" "s3://ziglang.org/builds/$JSONFILE" | |
| 97 | s3cmd -c "$DOWNLOADSECUREFILE_SECUREFILEPATH" put -P "$JSONFILE" "s3://ziglang.org/builds/x86_64-windows-$VERSION.json" | |
| 98 | ||
| 99 | # `set -x` causes these variables to be mangled. | |
| 100 | # See https://developercommunity.visualstudio.com/content/problem/375679/pipeline-variable-incorrectly-inserts-single-quote.html | |
| 101 | set +x | |
| 102 | echo "##vso[task.setvariable variable=tarball;isOutput=true]$TARBALL" | |
| 103 | echo "##vso[task.setvariable variable=shasum;isOutput=true]$SHASUM" | |
| 104 | echo "##vso[task.setvariable variable=bytesize;isOutput=true]$BYTESIZE" | |
| 105 | fi |
ci/azure/windows_script.bat created+8| ... | ... | @@ -0,0 +1,8 @@ |
| 1 | @echo on | |
| 2 | SET "SRCROOT=%cd%" | |
| 3 | SET "PREVPATH=%PATH%" | |
| 4 | SET "PREVMSYSEM=%MSYSTEM%" | |
| 5 | ||
| 6 | set "PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem" | |
| 7 | SET "MSYSTEM=MINGW64" | |
| 8 | bash -lc "cd ${SRCROOT} && ci/azure/windows_script" || exit /b |
ci/azure/windows_upload deleted-41| ... | ... | @@ -1,41 +0,0 @@ |
| 1 | #!/bin/sh | |
| 2 | ||
| 3 | set -x | |
| 4 | set -e | |
| 5 | ||
| 6 | if [ "${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" | |
| 41 | fi |