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
32 name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
35 - build/meson-logs/testlog.txt
37 junit: "build/meson-logs/testlog.junit.xml"
39 - Write-Output "Acquiring msys2.exe installer at $(Get-Date -Format u)"
40 - If ( !(Test-Path -Path msys64\var\cache ) ) {
41 mkdir msys64\var\cache
44 "https://repo.msys2.org/distrib/msys2-x86_64-latest.sfx.exe.sig"
45 -outfile "msys2.exe.sig"
46 - if ( Test-Path -Path msys64\var\cache\msys2.exe.sig ) {
47 Write-Output "Cached installer sig" ;
48 if ( ((Get-FileHash msys2.exe.sig).Hash -ne (Get-FileHash msys64\var\cache\msys2.exe.sig).Hash) ) {
49 Write-Output "Mis-matched installer sig, new installer download required" ;
50 Remove-Item -Path msys64\var\cache\msys2.exe.sig ;
51 if ( Test-Path -Path msys64\var\cache\msys2.exe ) {
52 Remove-Item -Path msys64\var\cache\msys2.exe
55 Write-Output "Matched installer sig, cached installer still valid"
58 Write-Output "No cached installer sig, new installer download required" ;
59 if ( Test-Path -Path msys64\var\cache\msys2.exe ) {
60 Remove-Item -Path msys64\var\cache\msys2.exe
63 - if ( !(Test-Path -Path msys64\var\cache\msys2.exe ) ) {
64 Write-Output "Fetching latest installer" ;
66 "https://repo.msys2.org/distrib/msys2-x86_64-latest.sfx.exe"
67 -outfile "msys64\var\cache\msys2.exe" ;
68 Copy-Item -Path msys2.exe.sig -Destination msys64\var\cache\msys2.exe.sig
70 Write-Output "Using cached installer"
72 - Write-Output "Invoking msys2.exe installer at $(Get-Date -Format u)"
73 - msys64\var\cache\msys2.exe -y
74 - ((Get-Content -path .\msys64\etc\\post-install\\07-pacman-key.post -Raw)
75 -replace '--refresh-keys', '--version') |
76 Set-Content -Path ${CI_PROJECT_DIR}\msys64\etc\\post-install\\07-pacman-key.post
77 - .\msys64\usr\bin\bash -lc "sed -i 's/^CheckSpace/#CheckSpace/g' /etc/pacman.conf"
78 - .\msys64\usr\bin\bash -lc 'pacman --noconfirm -Syuu' # Core update
79 - .\msys64\usr\bin\bash -lc 'pacman --noconfirm -Syuu' # Normal update
80 - taskkill /F /FI "MODULES eq msys-2.0.dll"
82 - Write-Output "Installing mingw packages at $(Get-Date -Format u)"
83 - .\msys64\usr\bin\bash -lc "pacman -Sy --noconfirm --needed
86 mingw-w64-x86_64-binutils
87 mingw-w64-x86_64-capstone
88 mingw-w64-x86_64-ccache
90 mingw-w64-x86_64-cyrus-sasl
93 mingw-w64-x86_64-glib2
94 mingw-w64-x86_64-gnutls
96 mingw-w64-x86_64-libgcrypt
97 mingw-w64-x86_64-libjpeg-turbo
98 mingw-w64-x86_64-libnfs
99 mingw-w64-x86_64-libpng
100 mingw-w64-x86_64-libssh
101 mingw-w64-x86_64-libtasn1
102 mingw-w64-x86_64-libusb
103 mingw-w64-x86_64-lzo2
104 mingw-w64-x86_64-nettle
105 mingw-w64-x86_64-ninja
106 mingw-w64-x86_64-pixman
107 mingw-w64-x86_64-pkgconf
108 mingw-w64-x86_64-python
109 mingw-w64-x86_64-SDL2
110 mingw-w64-x86_64-SDL2_image
111 mingw-w64-x86_64-snappy
112 mingw-w64-x86_64-spice
113 mingw-w64-x86_64-usbredir
114 mingw-w64-x86_64-zstd"
115 - Write-Output "Running build at $(Get-Date -Format u)"
116 - $env:CHERE_INVOKING = 'yes' # Preserve the current working directory
117 - $env:MSYS = 'winsymlinks:native' # Enable native Windows symlink
118 - $env:CCACHE_BASEDIR = "$env:CI_PROJECT_DIR"
119 - $env:CCACHE_DIR = "$env:CCACHE_BASEDIR/ccache"
120 - $env:CCACHE_MAXSIZE = "500M"
121 - $env:CCACHE_DEPEND = 1 # cache misses are too expensive with preprocessor mode
122 - $env:CC = "ccache gcc"
125 - ..\msys64\usr\bin\bash -lc "ccache --zero-stats"
126 - ..\msys64\usr\bin\bash -lc "../configure --enable-fdt=system $CONFIGURE_ARGS"
127 - ..\msys64\usr\bin\bash -lc "make"
128 - ..\msys64\usr\bin\bash -lc "make check MTESTARGS='$TEST_ARGS' || { cat meson-logs/testlog.txt; exit 1; } ;"
129 - ..\msys64\usr\bin\bash -lc "ccache --show-stats"
130 - Write-Output "Finished build at $(Get-Date -Format u)"