Thomas Huth | 7876cba | 2021-11-15 15:06:23 +0100 | [diff] [blame] | 1 | .shared_msys2_builder: |
Daniel P. Berrangé | e312d1f | 2022-05-27 16:36:01 +0100 | [diff] [blame] | 2 | extends: .base_job_template |
Thomas Huth | 7876cba | 2021-11-15 15:06:23 +0100 | [diff] [blame] | 3 | tags: |
| 4 | - shared-windows |
| 5 | - windows |
| 6 | - windows-1809 |
| 7 | cache: |
Daniel P. Berrangé | 2f7350c | 2023-08-29 17:15:17 +0100 | [diff] [blame] | 8 | key: "$CI_JOB_NAME" |
Thomas Huth | 7876cba | 2021-11-15 15:06:23 +0100 | [diff] [blame] | 9 | paths: |
Daniel P. Berrangé | 5ef56e3 | 2023-08-01 14:03:59 +0100 | [diff] [blame] | 10 | - msys64/var/cache |
Daniel P. Berrangé | 2f7350c | 2023-08-29 17:15:17 +0100 | [diff] [blame] | 11 | - ccache |
Daniel P. Berrangé | ef4fe31 | 2023-08-01 14:04:00 +0100 | [diff] [blame] | 12 | when: always |
Thomas Huth | 7876cba | 2021-11-15 15:06:23 +0100 | [diff] [blame] | 13 | needs: [] |
| 14 | stage: build |
Daniel P. Berrangé | 2f7350c | 2023-08-29 17:15:17 +0100 | [diff] [blame] | 15 | timeout: 100m |
Daniel P. Berrangé | f54ba56 | 2023-08-01 14:04:03 +0100 | [diff] [blame] | 16 | variables: |
| 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 |
Marc-André Lureau | a3fcbb4 | 2023-06-20 17:37:19 +0200 | [diff] [blame] | 20 | artifacts: |
| 21 | name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" |
| 22 | expire_in: 7 days |
| 23 | paths: |
| 24 | - build/meson-logs/testlog.txt |
Marc-André Lureau | 81a1231 | 2023-06-20 17:37:20 +0200 | [diff] [blame] | 25 | reports: |
| 26 | junit: "build/meson-logs/testlog.junit.xml" |
Thomas Huth | 7876cba | 2021-11-15 15:06:23 +0100 | [diff] [blame] | 27 | before_script: |
Daniel P. Berrangé | b64052c | 2023-08-01 14:03:57 +0100 | [diff] [blame] | 28 | - Write-Output "Acquiring msys2.exe installer at $(Get-Date -Format u)" |
Thomas Huth | 7876cba | 2021-11-15 15:06:23 +0100 | [diff] [blame] | 29 | - If ( !(Test-Path -Path msys64\var\cache ) ) { |
| 30 | mkdir msys64\var\cache |
| 31 | } |
Daniel P. Berrangé | 46aedd3 | 2023-08-01 14:03:58 +0100 | [diff] [blame] | 32 | - Invoke-WebRequest |
| 33 | "https://repo.msys2.org/distrib/msys2-x86_64-latest.sfx.exe.sig" |
| 34 | -outfile "msys2.exe.sig" |
| 35 | - if ( Test-Path -Path msys64\var\cache\msys2.exe.sig ) { |
| 36 | Write-Output "Cached installer sig" ; |
| 37 | if ( ((Get-FileHash msys2.exe.sig).Hash -ne (Get-FileHash msys64\var\cache\msys2.exe.sig).Hash) ) { |
| 38 | Write-Output "Mis-matched installer sig, new installer download required" ; |
| 39 | Remove-Item -Path msys64\var\cache\msys2.exe.sig ; |
| 40 | if ( Test-Path -Path msys64\var\cache\msys2.exe ) { |
| 41 | Remove-Item -Path msys64\var\cache\msys2.exe |
| 42 | } |
| 43 | } else { |
| 44 | Write-Output "Matched installer sig, cached installer still valid" |
| 45 | } |
| 46 | } else { |
| 47 | Write-Output "No cached installer sig, new installer download required" ; |
| 48 | if ( Test-Path -Path msys64\var\cache\msys2.exe ) { |
| 49 | Remove-Item -Path msys64\var\cache\msys2.exe |
| 50 | } |
| 51 | } |
| 52 | - if ( !(Test-Path -Path msys64\var\cache\msys2.exe ) ) { |
| 53 | Write-Output "Fetching latest installer" ; |
Thomas Huth | 7876cba | 2021-11-15 15:06:23 +0100 | [diff] [blame] | 54 | Invoke-WebRequest |
Daniel P. Berrangé | 46aedd3 | 2023-08-01 14:03:58 +0100 | [diff] [blame] | 55 | "https://repo.msys2.org/distrib/msys2-x86_64-latest.sfx.exe" |
| 56 | -outfile "msys64\var\cache\msys2.exe" ; |
| 57 | Copy-Item -Path msys2.exe.sig -Destination msys64\var\cache\msys2.exe.sig |
| 58 | } else { |
| 59 | Write-Output "Using cached installer" |
Thomas Huth | 7876cba | 2021-11-15 15:06:23 +0100 | [diff] [blame] | 60 | } |
Daniel P. Berrangé | b64052c | 2023-08-01 14:03:57 +0100 | [diff] [blame] | 61 | - Write-Output "Invoking msys2.exe installer at $(Get-Date -Format u)" |
Thomas Huth | 7876cba | 2021-11-15 15:06:23 +0100 | [diff] [blame] | 62 | - msys64\var\cache\msys2.exe -y |
| 63 | - ((Get-Content -path .\msys64\etc\\post-install\\07-pacman-key.post -Raw) |
| 64 | -replace '--refresh-keys', '--version') | |
| 65 | Set-Content -Path ${CI_PROJECT_DIR}\msys64\etc\\post-install\\07-pacman-key.post |
| 66 | - .\msys64\usr\bin\bash -lc "sed -i 's/^CheckSpace/#CheckSpace/g' /etc/pacman.conf" |
| 67 | - .\msys64\usr\bin\bash -lc 'pacman --noconfirm -Syuu' # Core update |
| 68 | - .\msys64\usr\bin\bash -lc 'pacman --noconfirm -Syuu' # Normal update |
| 69 | - taskkill /F /FI "MODULES eq msys-2.0.dll" |
Daniel P. Berrangé | 11961d0 | 2023-08-01 14:03:56 +0100 | [diff] [blame] | 70 | script: |
Daniel P. Berrangé | b64052c | 2023-08-01 14:03:57 +0100 | [diff] [blame] | 71 | - Write-Output "Installing mingw packages at $(Get-Date -Format u)" |
Daniel P. Berrangé | 11961d0 | 2023-08-01 14:03:56 +0100 | [diff] [blame] | 72 | - .\msys64\usr\bin\bash -lc "pacman -Sy --noconfirm --needed |
| 73 | bison diffutils flex |
| 74 | git grep make sed |
| 75 | $MINGW_TARGET-capstone |
Daniel P. Berrangé | 2f7350c | 2023-08-29 17:15:17 +0100 | [diff] [blame] | 76 | $MINGW_TARGET-ccache |
Daniel P. Berrangé | 11961d0 | 2023-08-01 14:03:56 +0100 | [diff] [blame] | 77 | $MINGW_TARGET-curl |
| 78 | $MINGW_TARGET-cyrus-sasl |
| 79 | $MINGW_TARGET-dtc |
| 80 | $MINGW_TARGET-gcc |
| 81 | $MINGW_TARGET-glib2 |
| 82 | $MINGW_TARGET-gnutls |
| 83 | $MINGW_TARGET-gtk3 |
| 84 | $MINGW_TARGET-libgcrypt |
| 85 | $MINGW_TARGET-libjpeg-turbo |
| 86 | $MINGW_TARGET-libnfs |
| 87 | $MINGW_TARGET-libpng |
| 88 | $MINGW_TARGET-libssh |
| 89 | $MINGW_TARGET-libtasn1 |
| 90 | $MINGW_TARGET-libusb |
| 91 | $MINGW_TARGET-lzo2 |
| 92 | $MINGW_TARGET-nettle |
| 93 | $MINGW_TARGET-ninja |
| 94 | $MINGW_TARGET-pixman |
| 95 | $MINGW_TARGET-pkgconf |
| 96 | $MINGW_TARGET-python |
| 97 | $MINGW_TARGET-SDL2 |
| 98 | $MINGW_TARGET-SDL2_image |
| 99 | $MINGW_TARGET-snappy |
| 100 | $MINGW_TARGET-spice |
| 101 | $MINGW_TARGET-usbredir |
| 102 | $MINGW_TARGET-zstd " |
Daniel P. Berrangé | b64052c | 2023-08-01 14:03:57 +0100 | [diff] [blame] | 103 | - Write-Output "Running build at $(Get-Date -Format u)" |
Daniel P. Berrangé | 11961d0 | 2023-08-01 14:03:56 +0100 | [diff] [blame] | 104 | - $env:CHERE_INVOKING = 'yes' # Preserve the current working directory |
| 105 | - $env:MSYS = 'winsymlinks:native' # Enable native Windows symlink |
Daniel P. Berrangé | 2f7350c | 2023-08-29 17:15:17 +0100 | [diff] [blame] | 106 | - $env:CCACHE_BASEDIR = "$env:CI_PROJECT_DIR" |
| 107 | - $env:CCACHE_DIR = "$env:CCACHE_BASEDIR/ccache" |
| 108 | - $env:CCACHE_MAXSIZE = "500M" |
| 109 | - $env:CCACHE_DEPEND = 1 # cache misses are too expensive with preprocessor mode |
| 110 | - $env:CC = "ccache gcc" |
Daniel P. Berrangé | 11961d0 | 2023-08-01 14:03:56 +0100 | [diff] [blame] | 111 | - mkdir build |
| 112 | - cd build |
Daniel P. Berrangé | 2f7350c | 2023-08-29 17:15:17 +0100 | [diff] [blame] | 113 | - ..\msys64\usr\bin\bash -lc "ccache --zero-stats" |
Daniel P. Berrangé | 11961d0 | 2023-08-01 14:03:56 +0100 | [diff] [blame] | 114 | - ..\msys64\usr\bin\bash -lc "../configure --enable-fdt=system $CONFIGURE_ARGS" |
| 115 | - ..\msys64\usr\bin\bash -lc "make" |
| 116 | - ..\msys64\usr\bin\bash -lc "make check MTESTARGS='$TEST_ARGS' || { cat meson-logs/testlog.txt; exit 1; } ;" |
Daniel P. Berrangé | 2f7350c | 2023-08-29 17:15:17 +0100 | [diff] [blame] | 117 | - ..\msys64\usr\bin\bash -lc "ccache --show-stats" |
Daniel P. Berrangé | b64052c | 2023-08-01 14:03:57 +0100 | [diff] [blame] | 118 | - Write-Output "Finished build at $(Get-Date -Format u)" |
Thomas Huth | 7876cba | 2021-11-15 15:06:23 +0100 | [diff] [blame] | 119 | |
| 120 | msys2-64bit: |
| 121 | extends: .shared_msys2_builder |
Daniel P. Berrangé | 11961d0 | 2023-08-01 14:03:56 +0100 | [diff] [blame] | 122 | variables: |
| 123 | MINGW_TARGET: mingw-w64-x86_64 |
| 124 | MSYSTEM: MINGW64 |
| 125 | # do not remove "--without-default-devices"! |
| 126 | # commit 9f8e6cad65a6 ("gitlab-ci: Speed up the msys2-64bit job by using --without-default-devices" |
| 127 | # changed to compile QEMU with the --without-default-devices switch |
| 128 | # for the msys2 64-bit job, due to the build could not complete within |
Daniel P. Berrangé | 63f5365 | 2023-08-01 14:04:02 +0100 | [diff] [blame] | 129 | CONFIGURE_ARGS: --target-list=x86_64-softmmu --without-default-devices -Ddebug=false -Doptimization=0 |
Daniel P. Berrangé | 11961d0 | 2023-08-01 14:03:56 +0100 | [diff] [blame] | 130 | # qTests don't run successfully with "--without-default-devices", |
| 131 | # so let's exclude the qtests from CI for now. |
| 132 | TEST_ARGS: --no-suite qtest |
Thomas Huth | 7876cba | 2021-11-15 15:06:23 +0100 | [diff] [blame] | 133 | |
| 134 | msys2-32bit: |
| 135 | extends: .shared_msys2_builder |
Daniel P. Berrangé | 11961d0 | 2023-08-01 14:03:56 +0100 | [diff] [blame] | 136 | variables: |
| 137 | MINGW_TARGET: mingw-w64-i686 |
| 138 | MSYSTEM: MINGW32 |
Daniel P. Berrangé | 63f5365 | 2023-08-01 14:04:02 +0100 | [diff] [blame] | 139 | CONFIGURE_ARGS: --target-list=ppc64-softmmu -Ddebug=false -Doptimization=0 |
Daniel P. Berrangé | 11961d0 | 2023-08-01 14:03:56 +0100 | [diff] [blame] | 140 | TEST_ARGS: --no-suite qtest |