| 1 | msys2-64bit: |
| 2 | extends: .base_job_template |
| 3 | tags: |
| 4 | - saas-windows-medium-amd64 |
| 5 | cache: |
| 6 | key: "$CI_JOB_NAME" |
| 7 | paths: |
| 8 | - msys64/var/cache |
| 9 | - ccache |
| 10 | when: always |
| 11 | needs: [] |
| 12 | stage: build |
| 13 | timeout: 100m |
| 14 | variables: |
| 15 | # Select the "64 bit, gcc and MSVCRT" MSYS2 environment |
| 16 | MSYSTEM: MINGW64 |
| 17 | # This feature doesn't (currently) work with PowerShell, it stops |
| 18 | # the echo'ing of commands being run and doesn't show any timing |
| 19 | FF_SCRIPT_SECTIONS: 0 |
| 20 | CONFIGURE_ARGS: --disable-system --enable-tools -Ddebug=false -Doptimization=0 --enable-rust |
| 21 | # The Windows git is a bit older so override the default |
| 22 | GIT_FETCH_EXTRA_FLAGS: --no-tags --prune --quiet |
| 23 | artifacts: |
| 24 | name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" |
| 25 | expire_in: 7 days |
| 26 | paths: |
| 27 | - build/meson-logs |
| 28 | - build/cache-log.txt |
| 29 | reports: |
| 30 | junit: build/meson-logs/*.junit.xml |
| 31 | before_script: |
| 32 | - Write-Output "Acquiring msys2.exe installer at $(Get-Date -Format u)" |
| 33 | - If ( !(Test-Path -Path msys64\var\cache ) ) { |
| 34 | mkdir msys64\var\cache |
| 35 | } |
| 36 | - Invoke-WebRequest |
| 37 | "https://repo.msys2.org/distrib/msys2-x86_64-latest.sfx.exe.sig" |
| 38 | -outfile "msys2.exe.sig" |
| 39 | - if ( Test-Path -Path msys64\var\cache\msys2.exe.sig ) { |
| 40 | Write-Output "Cached installer sig" ; |
| 41 | if ( ((Get-FileHash msys2.exe.sig).Hash -ne (Get-FileHash msys64\var\cache\msys2.exe.sig).Hash) ) { |
| 42 | Write-Output "Mis-matched installer sig, new installer download required" ; |
| 43 | Remove-Item -Path msys64\var\cache\msys2.exe.sig ; |
| 44 | if ( Test-Path -Path msys64\var\cache\msys2.exe ) { |
| 45 | Remove-Item -Path msys64\var\cache\msys2.exe |
| 46 | } |
| 47 | } else { |
| 48 | Write-Output "Matched installer sig, cached installer still valid" |
| 49 | } |
| 50 | } else { |
| 51 | Write-Output "No cached installer sig, new installer download required" ; |
| 52 | if ( Test-Path -Path msys64\var\cache\msys2.exe ) { |
| 53 | Remove-Item -Path msys64\var\cache\msys2.exe |
| 54 | } |
| 55 | } |
| 56 | - if ( !(Test-Path -Path msys64\var\cache\msys2.exe ) ) { |
| 57 | Write-Output "Fetching latest installer" ; |
| 58 | Invoke-WebRequest |
| 59 | "https://repo.msys2.org/distrib/msys2-x86_64-latest.sfx.exe" |
| 60 | -outfile "msys64\var\cache\msys2.exe" ; |
| 61 | Copy-Item -Path msys2.exe.sig -Destination msys64\var\cache\msys2.exe.sig |
| 62 | } else { |
| 63 | Write-Output "Using cached installer" |
| 64 | } |
| 65 | - Write-Output "Invoking msys2.exe installer at $(Get-Date -Format u)" |
| 66 | - msys64\var\cache\msys2.exe -y |
| 67 | - ((Get-Content -path .\msys64\etc\\post-install\\07-pacman-key.post -Raw) |
| 68 | -replace '--refresh-keys', '--version') | |
| 69 | Set-Content -Path ${CI_PROJECT_DIR}\msys64\etc\\post-install\\07-pacman-key.post |
| 70 | - .\msys64\usr\bin\bash -lc "sed -i 's/^CheckSpace/#CheckSpace/g' /etc/pacman.conf" |
| 71 | - .\msys64\usr\bin\bash -lc 'pacman --noconfirm -Syuu' # Core update |
| 72 | - .\msys64\usr\bin\bash -lc 'pacman --noconfirm -Syuu' # Normal update |
| 73 | - taskkill /F /FI "MODULES eq msys-2.0.dll" |
| 74 | script: |
| 75 | - Write-Output "Installing mingw packages at $(Get-Date -Format u)" |
| 76 | - .\msys64\usr\bin\bash -lc "pacman -Sy --noconfirm --needed |
| 77 | bison diffutils flex |
| 78 | git grep make sed |
| 79 | mingw-w64-x86_64-binutils |
| 80 | mingw-w64-x86_64-ca-certificates |
| 81 | mingw-w64-x86_64-ccache |
| 82 | mingw-w64-x86_64-curl-winssl |
| 83 | mingw-w64-x86_64-gcc |
| 84 | mingw-w64-x86_64-glib2 |
| 85 | mingw-w64-x86_64-libnfs |
| 86 | mingw-w64-x86_64-libssh |
| 87 | mingw-w64-x86_64-ninja |
| 88 | mingw-w64-x86_64-pixman |
| 89 | mingw-w64-x86_64-pkgconf |
| 90 | mingw-w64-x86_64-python |
| 91 | mingw-w64-x86_64-python-certifi |
| 92 | mingw-w64-x86_64-python-setuptools |
| 93 | mingw-w64-x86_64-python-wheel |
| 94 | mingw-w64-x86_64-rust |
| 95 | mingw-w64-x86_64-rust-bindgen |
| 96 | mingw-w64-x86_64-zstd" |
| 97 | - .\msys64\usr\bin\bash -lc "pacman -Sc --noconfirm" |
| 98 | - Write-Output "Running build at $(Get-Date -Format u)" |
| 99 | - $env:JOBS = $(.\msys64\usr\bin\bash -lc nproc) |
| 100 | - $env:CHERE_INVOKING = 'yes' # Preserve the current working directory |
| 101 | - $env:MSYS = 'winsymlinks:native' # Enable native Windows symlink |
| 102 | - $env:CCACHE_BASEDIR = "$env:CI_PROJECT_DIR" |
| 103 | - $env:CCACHE_DIR = "$env:CCACHE_BASEDIR/ccache" |
| 104 | - $env:CCACHE_MAXSIZE = "180M" |
| 105 | - $env:CCACHE_DEPEND = 1 # cache misses are too expensive with preprocessor mode |
| 106 | - $env:CC = "ccache gcc" |
| 107 | - $env:LIBCLANG_PATH = Join-Path -Path $PWD.Path -ChildPath "msys64/mingw64/bin" |
| 108 | - mkdir build |
| 109 | - cd build |
| 110 | - ..\msys64\usr\bin\bash -lc "ccache --zero-stats" |
| 111 | - ..\msys64\usr\bin\bash -lc "../configure $CONFIGURE_ARGS" |
| 112 | - ..\msys64\usr\bin\bash -lc "make -j$env:JOBS" |
| 113 | - ..\msys64\usr\bin\bash -lc "make check MTESTARGS='$TEST_ARGS' || { cat meson-logs/testlog.txt; exit 1; } ;" |
| 114 | - ..\msys64\usr\bin\bash -lc "ls -lR /var/cache > cache-log.txt" |
| 115 | - ..\msys64\usr\bin\bash -lc "du -sh ." |
| 116 | - ..\msys64\usr\bin\bash -lc "ccache --show-stats" |
| 117 | - Write-Output "Finished build at $(Get-Date -Format u)" |