2 extends: .base_job_template
17 # Select the "64 bit, gcc and MSVCRT" MSYS2 environment
19 # This feature doesn't (currently) work with PowerShell, it stops
20 # the echo'ing of commands being run and doesn't show any timing
22 # do not remove "--without-default-devices"!
23 # commit 9f8e6cad65a6 ("gitlab-ci: Speed up the msys2-64bit job by using --without-default-devices"
24 # changed to compile QEMU with the --without-default-devices switch
25 # for this job, because otherwise the build could not complete within
26 # the project timeout.
27 CONFIGURE_ARGS: --target-list=x86_64-softmmu --without-default-devices -Ddebug=false -Doptimization=0
28 # qTests don't run successfully with "--without-default-devices",
29 # so let's exclude the qtests from CI for now.
30 TEST_ARGS: --no-suite qtest
31 # The Windows git is a bit older so override the default
32 GIT_FETCH_EXTRA_FLAGS: --no-tags --prune --quiet
34 name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
37 - build/meson-logs/testlog.txt
39 junit: "build/meson-logs/testlog.junit.xml"
41 - Write-Output "Acquiring msys2.exe installer at $(Get-Date -Format u)"
42 - If ( !(Test-Path -Path msys64\var\cache ) ) {
43 mkdir msys64\var\cache
46 "https://repo.msys2.org/distrib/msys2-x86_64-latest.sfx.exe.sig"
47 -outfile "msys2.exe.sig"
48 - if ( Test-Path -Path msys64\var\cache\msys2.exe.sig ) {
49 Write-Output "Cached installer sig" ;
50 if ( ((Get-FileHash msys2.exe.sig).Hash -ne (Get-FileHash msys64\var\cache\msys2.exe.sig).Hash) ) {
51 Write-Output "Mis-matched installer sig, new installer download required" ;
52 Remove-Item -Path msys64\var\cache\msys2.exe.sig ;
53 if ( Test-Path -Path msys64\var\cache\msys2.exe ) {
54 Remove-Item -Path msys64\var\cache\msys2.exe
57 Write-Output "Matched installer sig, cached installer still valid"
60 Write-Output "No cached installer sig, new installer download required" ;
61 if ( Test-Path -Path msys64\var\cache\msys2.exe ) {
62 Remove-Item -Path msys64\var\cache\msys2.exe
65 - if ( !(Test-Path -Path msys64\var\cache\msys2.exe ) ) {
66 Write-Output "Fetching latest installer" ;
68 "https://repo.msys2.org/distrib/msys2-x86_64-latest.sfx.exe"
69 -outfile "msys64\var\cache\msys2.exe" ;
70 Copy-Item -Path msys2.exe.sig -Destination msys64\var\cache\msys2.exe.sig
72 Write-Output "Using cached installer"
74 - Write-Output "Invoking msys2.exe installer at $(Get-Date -Format u)"
75 - msys64\var\cache\msys2.exe -y
76 - ((Get-Content -path .\msys64\etc\\post-install\\07-pacman-key.post -Raw)
77 -replace '--refresh-keys', '--version') |
78 Set-Content -Path ${CI_PROJECT_DIR}\msys64\etc\\post-install\\07-pacman-key.post
79 - .\msys64\usr\bin\bash -lc "sed -i 's/^CheckSpace/#CheckSpace/g' /etc/pacman.conf"
80 - .\msys64\usr\bin\bash -lc 'pacman --noconfirm -Syuu' # Core update
81 - .\msys64\usr\bin\bash -lc 'pacman --noconfirm -Syuu' # Normal update
82 - taskkill /F /FI "MODULES eq msys-2.0.dll"
84 - Write-Output "Installing mingw packages at $(Get-Date -Format u)"
85 - .\msys64\usr\bin\bash -lc "pacman -Sy --noconfirm --needed
88 mingw-w64-x86_64-binutils
89 mingw-w64-x86_64-capstone
90 mingw-w64-x86_64-ccache
92 mingw-w64-x86_64-cyrus-sasl
95 mingw-w64-x86_64-glib2
96 mingw-w64-x86_64-gnutls
98 mingw-w64-x86_64-libgcrypt
99 mingw-w64-x86_64-libjpeg-turbo
100 mingw-w64-x86_64-libnfs
101 mingw-w64-x86_64-libpng
102 mingw-w64-x86_64-libssh
103 mingw-w64-x86_64-libtasn1
104 mingw-w64-x86_64-libusb
105 mingw-w64-x86_64-lzo2
106 mingw-w64-x86_64-nettle
107 mingw-w64-x86_64-ninja
108 mingw-w64-x86_64-pixman
109 mingw-w64-x86_64-pkgconf
110 mingw-w64-x86_64-python
111 mingw-w64-x86_64-SDL2
112 mingw-w64-x86_64-SDL2_image
113 mingw-w64-x86_64-snappy
114 mingw-w64-x86_64-spice
115 mingw-w64-x86_64-usbredir
116 mingw-w64-x86_64-zstd"
117 - Write-Output "Running build at $(Get-Date -Format u)"
118 - $env:CHERE_INVOKING = 'yes' # Preserve the current working directory
119 - $env:MSYS = 'winsymlinks:native' # Enable native Windows symlink
120 - $env:CCACHE_BASEDIR = "$env:CI_PROJECT_DIR"
121 - $env:CCACHE_DIR = "$env:CCACHE_BASEDIR/ccache"
122 - $env:CCACHE_MAXSIZE = "500M"
123 - $env:CCACHE_DEPEND = 1 # cache misses are too expensive with preprocessor mode
124 - $env:CC = "ccache gcc"
127 - ..\msys64\usr\bin\bash -lc "ccache --zero-stats"
128 - ..\msys64\usr\bin\bash -lc "../configure --enable-fdt=system $CONFIGURE_ARGS"
129 - ..\msys64\usr\bin\bash -lc "make"
130 - ..\msys64\usr\bin\bash -lc "make check MTESTARGS='$TEST_ARGS' || { cat meson-logs/testlog.txt; exit 1; } ;"
131 - ..\msys64\usr\bin\bash -lc "ccache --show-stats"
132 - Write-Output "Finished build at $(Get-Date -Format u)"