| ... | @@ -10,7 +10,6 @@ jobs: | ... | @@ -10,7 +10,6 @@ jobs: |
| 10 | - script: ci/azure/macos_script | 10 | - script: ci/azure/macos_script |
| 11 | name: main | 11 | name: main |
| 12 | displayName: 'Build and test' | 12 | displayName: 'Build and test' |
| 13 | | | |
| 14 | - job: BuildMacOS_arm64 | 13 | - job: BuildMacOS_arm64 |
| 15 | pool: | 14 | pool: |
| 16 | vmImage: 'macOS-10.15' | 15 | vmImage: 'macOS-10.15' |
| ... | @@ -22,130 +21,30 @@ jobs: | ... | @@ -22,130 +21,30 @@ jobs: |
| 22 | - script: ci/azure/macos_arm64_script | 21 | - script: ci/azure/macos_arm64_script |
| 23 | name: main | 22 | name: main |
| 24 | displayName: 'Build' | 23 | displayName: 'Build' |
| 25 | | | |
| 26 | - job: BuildWindows | 24 | - job: BuildWindows |
| 27 | timeoutInMinutes: 360 | | |
| 28 | pool: | 25 | pool: |
| 29 | vmImage: 'windows-2019' | 26 | vmImage: 'windows-2019' |
| 30 | variables: | 27 | timeoutInMinutes: 360 |
| 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' | | |
| 33 | steps: | 28 | steps: |
| 34 | - pwsh: | | 29 | - powershell: | |
| 35 | (New-Object Net.WebClient).DownloadFile("$(LLVM_CLANG_LLD_URL)", "${LLVM_CLANG_LLD_DIR}.tar.xz") | 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") |
| 36 | & 'C:\Program Files\7-Zip\7z.exe' x "${LLVM_CLANG_LLD_DIR}.tar.xz" | 31 | .\sfx.exe -y -o\ |
| 37 | & 'C:\Program Files\7-Zip\7z.exe' x "${LLVM_CLANG_LLD_DIR}.tar" | 32 | displayName: Download/Extract/Install MSYS2 |
| 38 | name: install | 33 | - script: | |
| 39 | displayName: 'Install LLVM/CLANG/LLD' | 34 | @REM install updated filesystem package first without dependency checking |
| 40 | | 35 | @REM because of: https://github.com/msys2/MSYS2-packages/issues/2021 |
| 41 | - pwsh: | | 36 | %CD:~0,2%\msys64\usr\bin\bash -lc "pacman --noconfirm -Sydd filesystem" |
| 42 | Set-Variable -Name ZIGBUILDDIR -Value "$(Get-Location)\build" | 37 | displayName: Workaround filesystem dash MSYS2 dependency issue |
| 43 | Set-Variable -Name ZIGINSTALLDIR -Value "$ZIGBUILDDIR\dist" | 38 | - script: | |
| 44 | Set-Variable -Name ZIGPREFIXPATH -Value "$(Get-Location)\$(LLVM_CLANG_LLD_DIR)" | 39 | %CD:~0,2%\msys64\usr\bin\bash -lc "pacman --noconfirm -Syuu" |
| 45 | | 40 | %CD:~0,2%\msys64\usr\bin\bash -lc "pacman --noconfirm -Syuu" |
| 46 | # Make the `zig version` number consistent. | 41 | displayName: Update MSYS2 |
| 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 | | | |
| 87 | - task: DownloadSecureFile@1 | 42 | - task: DownloadSecureFile@1 |
| 88 | inputs: | 43 | inputs: |
| 89 | name: aws_credentials | 44 | secureFile: s3cfg |
| 90 | secureFile: aws_credentials | 45 | - script: ci/azure/windows_msvc_script.bat |
| 91 | | 46 | name: main |
| 92 | - pwsh: | | 47 | displayName: 'Build and test' |
| 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 | | | |
| 149 | - job: OnMasterSuccess | 48 | - job: OnMasterSuccess |
| 150 | dependsOn: | 49 | dependsOn: |
| 151 | - BuildMacOS | 50 | - BuildMacOS |