| ... | ... | @@ -10,7 +10,6 @@ jobs: |
| 10 | 10 | - script: ci/azure/macos_script |
| 11 | 11 | name: main |
| 12 | 12 | displayName: 'Build and test' |
| 13 | | |
| 14 | 13 | - job: BuildMacOS_arm64 |
| 15 | 14 | pool: |
| 16 | 15 | vmImage: 'macOS-10.15' |
| ... | ... | @@ -22,130 +21,30 @@ jobs: |
| 22 | 21 | - script: ci/azure/macos_arm64_script |
| 23 | 22 | name: main |
| 24 | 23 | displayName: 'Build' |
| 25 | | |
| 26 | 24 | - job: BuildWindows |
| 27 | | timeoutInMinutes: 360 |
| 28 | 25 | pool: |
| 29 | 26 | vmImage: 'windows-2019' |
| 30 | | variables: |
| 31 | | LLVM_CLANG_LLD_URL: 'https://ziglang.org/deps/llvm+clang+lld-13.0.0-x86_64-windows-msvc-release-mt.tar.xz' |
| 32 | | LLVM_CLANG_LLD_DIR: 'llvm+clang+lld-13.0.0-x86_64-windows-msvc-release-mt' |
| 27 | timeoutInMinutes: 360 |
| 33 | 28 | steps: |
| 34 | | - pwsh: | |
| 35 | | (New-Object Net.WebClient).DownloadFile("$(LLVM_CLANG_LLD_URL)", "${LLVM_CLANG_LLD_DIR}.tar.xz") |
| 36 | | & 'C:\Program Files\7-Zip\7z.exe' x "${LLVM_CLANG_LLD_DIR}.tar.xz" |
| 37 | | & 'C:\Program Files\7-Zip\7z.exe' x "${LLVM_CLANG_LLD_DIR}.tar" |
| 38 | | name: install |
| 39 | | displayName: 'Install LLVM/CLANG/LLD' |
| 40 | | |
| 41 | | - pwsh: | |
| 42 | | Set-Variable -Name ZIGBUILDDIR -Value "$(Get-Location)\build" |
| 43 | | Set-Variable -Name ZIGINSTALLDIR -Value "$ZIGBUILDDIR\dist" |
| 44 | | Set-Variable -Name ZIGPREFIXPATH -Value "$(Get-Location)\$(LLVM_CLANG_LLD_DIR)" |
| 45 | | |
| 46 | | # Make the `zig version` number consistent. |
| 47 | | # This will affect the cmake command below. |
| 48 | | git config core.abbrev 9 |
| 49 | | git fetch --tags |
| 50 | | |
| 51 | | mkdir $ZIGBUILDDIR |
| 52 | | cd $ZIGBUILDDIR |
| 53 | | & "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 |
| 54 | | cmake .. ` |
| 55 | | -Thost=x64 ` |
| 56 | | -G "Visual Studio 16 2019" ` |
| 57 | | -A x64 ` |
| 58 | | -DCMAKE_INSTALL_PREFIX="$ZIGINSTALLDIR" ` |
| 59 | | -DCMAKE_PREFIX_PATH="$ZIGPREFIXPATH" ` |
| 60 | | -DCMAKE_BUILD_TYPE=Release ` |
| 61 | | -DZIG_OMIT_STAGE2=ON 2> out-null |
| 62 | | & "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe" ` |
| 63 | | /maxcpucount /p:Configuration=Release INSTALL.vcxproj |
| 64 | | name: build |
| 65 | | displayName: 'Build' |
| 66 | | |
| 67 | | - pwsh: | |
| 68 | | Set-Variable -Name ZIGINSTALLDIR -Value "$(Get-Location)\build\dist" |
| 69 | | |
| 70 | | # Sadly, stage2 is omitted from this build to save memory on the CI server. Once self-hosted is |
| 71 | | # built with itself and does not gobble as much memory, we can enable these tests. |
| 72 | | #& "$ZIGINSTALLDIR\bin\zig.exe" test "..\test\behavior.zig" -fno-stage1 -fLLVM -I "..\test" 2>&1 |
| 73 | | |
| 74 | | & "$ZIGINSTALLDIR\bin\zig.exe" build test-toolchain -Dskip-non-native -Dskip-stage2-tests 2>&1 |
| 75 | | & "$ZIGINSTALLDIR\bin\zig.exe" build test-std -Dskip-non-native 2>&1 |
| 76 | | name: test |
| 77 | | displayName: 'Test' |
| 78 | | |
| 79 | | - pwsh: | |
| 80 | | Set-Variable -Name ZIGINSTALLDIR -Value "$(Get-Location)\build\dist" |
| 81 | | |
| 82 | | & "$ZIGINSTALLDIR\bin\zig.exe" build docs |
| 83 | | timeoutInMinutes: 60 |
| 84 | | name: doc |
| 85 | | displayName: 'Documentation' |
| 86 | | |
| 29 | - powershell: | |
| 30 | (New-Object Net.WebClient).DownloadFile("https://github.com/msys2/msys2-installer/releases/download/2022-01-28/msys2-base-x86_64-20220128.sfx.exe", "sfx.exe") |
| 31 | .\sfx.exe -y -o\ |
| 32 | displayName: Download/Extract/Install MSYS2 |
| 33 | - script: | |
| 34 | @REM install updated filesystem package first without dependency checking |
| 35 | @REM because of: https://github.com/msys2/MSYS2-packages/issues/2021 |
| 36 | %CD:~0,2%\msys64\usr\bin\bash -lc "pacman --noconfirm -Sydd filesystem" |
| 37 | displayName: Workaround filesystem dash MSYS2 dependency issue |
| 38 | - script: | |
| 39 | %CD:~0,2%\msys64\usr\bin\bash -lc "pacman --noconfirm -Syuu" |
| 40 | %CD:~0,2%\msys64\usr\bin\bash -lc "pacman --noconfirm -Syuu" |
| 41 | displayName: Update MSYS2 |
| 87 | 42 | - task: DownloadSecureFile@1 |
| 88 | 43 | inputs: |
| 89 | | name: aws_credentials |
| 90 | | secureFile: aws_credentials |
| 91 | | |
| 92 | | - pwsh: | |
| 93 | | Set-Variable -Name ZIGBUILDDIR -Value "$(Get-Location)\build" |
| 94 | | $Env:AWS_SHARED_CREDENTIALS_FILE = "$Env:DOWNLOADSECUREFILE_SECUREFILEPATH" |
| 95 | | |
| 96 | | # Workaround Azure networking issue |
| 97 | | # https://github.com/aws/aws-cli/issues/5749 |
| 98 | | $Env:AWS_EC2_METADATA_DISABLED = "true" |
| 99 | | $Env:AWS_REGION = "us-west-2" |
| 100 | | |
| 101 | | cd "$ZIGBUILDDIR" |
| 102 | | mv ../LICENSE dist/ |
| 103 | | mv ../zig-cache/langref.html dist/ |
| 104 | | mv dist/bin/zig.exe dist/ |
| 105 | | rmdir dist/bin |
| 106 | | |
| 107 | | # Remove the unnecessary zig dir in $prefix/lib/zig/std/std.zig |
| 108 | | mv dist/lib/zig dist/lib2 |
| 109 | | rmdir dist/lib |
| 110 | | mv dist/lib2 dist/lib |
| 111 | | |
| 112 | | Set-Variable -Name VERSION -Value $(./dist/zig.exe version) |
| 113 | | Set-Variable -Name DIRNAME -Value "zig-windows-x86_64-$VERSION" |
| 114 | | Set-Variable -Name TARBALL -Value "$DIRNAME.zip" |
| 115 | | mv dist "$DIRNAME" |
| 116 | | 7z a "$TARBALL" "$DIRNAME" |
| 117 | | |
| 118 | | aws s3 cp ` |
| 119 | | "$TARBALL" ` |
| 120 | | s3://ziglang.org/builds/ ` |
| 121 | | --cache-control 'public, max-age=31536000, immutable' |
| 122 | | |
| 123 | | Set-Variable -Name SHASUM -Value (Get-FileHash "$TARBALL" -Algorithm SHA256 | select-object -ExpandProperty Hash) |
| 124 | | Set-Variable -Name BYTESIZE -Value (Get-Item "$TARBALL").length |
| 125 | | |
| 126 | | Set-Variable -Name JSONFILE -Value "windows-${Env:BUILD_SOURCEBRANCHNAME}.json" |
| 127 | | echo $null > $JSONFILE |
| 128 | | echo ('{"tarball": "' + $TARBALL + '",') >> $JSONFILE |
| 129 | | echo ('"shasum": "' + $SHASUM + '",') >> $JSONFILE |
| 130 | | echo ('"size": ' + $BYTESIZE + '}' ) >> $JSONFILE |
| 131 | | |
| 132 | | aws s3 cp ` |
| 133 | | "$JSONFILE" ` |
| 134 | | s3://ziglang.org/builds/ ` |
| 135 | | --cache-control 'max-age=0, must-revalidate' |
| 136 | | |
| 137 | | aws s3 cp ` |
| 138 | | "$JSONFILE" ` |
| 139 | | "s3://ziglang.org/builds/x86_64-windows-${VERSION}.json" |
| 140 | | |
| 141 | | echo "##vso[task.setvariable variable=tarball;isOutput=true]$TARBALL" |
| 142 | | echo "##vso[task.setvariable variable=shasum;isOutput=true]$SHASUM" |
| 143 | | echo "##vso[task.setvariable variable=bytesize;isOutput=true]$BYTESIZE" |
| 144 | | |
| 145 | | name: upload |
| 146 | | condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) |
| 147 | | displayName: 'Upload' |
| 148 | | |
| 44 | secureFile: s3cfg |
| 45 | - script: ci/azure/windows_msvc_script.bat |
| 46 | name: main |
| 47 | displayName: 'Build and test' |
| 149 | 48 | - job: OnMasterSuccess |
| 150 | 49 | dependsOn: |
| 151 | 50 | - BuildMacOS |