OSDN Git Service

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