meson: replace libmesa_util with idep_mesautil
[mesa.git] / .gitlab-ci.yml
1 # This is the tag of the docker image used for the build jobs. If the
2 # image doesn't exist yet, the containers-build stage generates it.
3 #
4 # In order to generate a new image, one should generally change the tag.
5 # While removing the image from the registry would also work, that's not
6 # recommended except for ephemeral images during development: Replacing
7 # an image after a significant amount of time might pull in newer
8 # versions of gcc/clang or other packages, which might break the build
9 # with older commits using the same tag.
10 #
11 # After merging a change resulting in generating a new image to the
12 # main repository, it's recommended to remove the image from the source
13 # repository's container registry, so that the image from the main
14 # repository's registry will be used there as well.
15 variables:
16 UPSTREAM_REPO: mesa/mesa
17 DEBIAN_TAG: "2019-07-23"
18 DEBIAN_VERSION: stretch-slim
19 DEBIAN_IMAGE: "$CI_REGISTRY_IMAGE/debian/$DEBIAN_VERSION:$DEBIAN_TAG"
20
21 include:
22 - project: 'wayland/ci-templates'
23 ref: c73dae8b84697ef18e2dbbf4fed7386d9652b0cd
24 file: '/templates/debian.yml'
25
26 stages:
27 - containers-build
28 - build+test
29
30
31 # When to automatically run the CI
32 .ci-run-policy: &ci-run-policy
33 only:
34 - branches@mesa/mesa
35 - merge_requests
36 - /^ci([-/].*)?$/
37 retry:
38 max: 2
39 when:
40 - runner_system_failure
41
42
43 # CONTAINERS
44
45 debian:
46 extends: .debian@container-ifnot-exists
47 stage: containers-build
48 <<: *ci-run-policy
49 variables:
50 GIT_STRATEGY: none # no need to pull the whole tree for rebuilding the image
51 DEBIAN_EXEC: 'bash .gitlab-ci/debian-install.sh'
52
53
54 # BUILD
55
56 .build:
57 <<: *ci-run-policy
58 image: $DEBIAN_IMAGE
59 stage: build+test
60 cache:
61 paths:
62 - ccache
63 artifacts:
64 when: always
65 paths:
66 - _build/meson-logs/*.txt
67 # scons:
68 - build/*/config.log
69 - shader-db
70 variables:
71 CCACHE_COMPILERCHECK: "content"
72 # Use ccache transparently, and print stats before/after
73 before_script:
74 - export PATH="/usr/lib/ccache:$PATH"
75 - export CCACHE_BASEDIR="$PWD"
76 - export CCACHE_DIR="$PWD/ccache"
77 - ccache --zero-stats || true
78 - ccache --show-stats || true
79 after_script:
80 - export CCACHE_DIR="$PWD/ccache"
81 - ccache --show-stats
82
83 .meson-build:
84 extends: .build
85 script:
86 - .gitlab-ci/meson-build.sh
87
88 .scons-build:
89 extends: .build
90 variables:
91 SCONSFLAGS: "-j4"
92 script:
93 - if test -n "$LLVM_VERSION"; then
94 export LLVM_CONFIG="llvm-config-${LLVM_VERSION}";
95 fi
96 - scons $SCONS_TARGET
97 - eval $SCONS_CHECK_COMMAND
98
99 # NOTE: Building SWR is 2x (yes two) times slower than all the other
100 # gallium drivers combined.
101 # Start this early so that it doesn't limit the total run time.
102 #
103 # We also put softpipe (and therefore gallium nine, which requires
104 # it) here, since softpipe/llvmpipe can't be built alongside classic
105 # swrast.
106 #
107 # Putting glvnd here is arbitrary, but we want it in one of the builds
108 # for coverage.
109 meson-swr-glvnd:
110 extends: .meson-build
111 variables:
112 UNWIND: "true"
113 DRI_LOADERS: >
114 -D glvnd=true
115 -D egl=true
116 GALLIUM_ST: >
117 -D dri3=true
118 -D gallium-vdpau=false
119 -D gallium-xvmc=false
120 -D gallium-omx=disabled
121 -D gallium-va=false
122 -D gallium-xa=false
123 -D gallium-nine=true
124 -D gallium-opencl=disabled
125 -D osmesa=gallium
126 GALLIUM_DRIVERS: "swr,swrast,iris"
127 LLVM_VERSION: "6.0"
128
129 meson-clang:
130 extends: .meson-build
131 variables:
132 UNWIND: "true"
133 DRI_DRIVERS: "auto"
134 GALLIUM_DRIVERS: "auto"
135 VULKAN_DRIVERS: intel,amd,freedreno
136 CC: "ccache clang-8"
137 CXX: "ccache clang++-8"
138 before_script:
139 - export CCACHE_BASEDIR="$PWD" CCACHE_DIR="$PWD/ccache"
140 - ccache --zero-stats --show-stats || true
141 # clang++ breaks if it picks up the GCC 8 directory without libstdc++.so
142 - apt-get remove -y libgcc-8-dev
143
144 scons-swr:
145 extends: .scons-build
146 variables:
147 SCONS_TARGET: "swr=1"
148 SCONS_CHECK_COMMAND: "true"
149 LLVM_VERSION: "6.0"
150
151 scons-win64:
152 extends: .scons-build
153 variables:
154 SCONS_TARGET: platform=windows machine=x86_64
155 SCONS_CHECK_COMMAND: "true"
156
157 meson-main:
158 extends: .meson-build
159 variables:
160 UNWIND: "true"
161 DRI_LOADERS: >
162 -D glx=dri
163 -D gbm=true
164 -D egl=true
165 -D platforms=x11,wayland,drm,surfaceless
166 -D osmesa=classic
167 DRI_DRIVERS: "i915,i965,r100,r200,swrast,nouveau"
168 GALLIUM_ST: >
169 -D dri3=true
170 -D gallium-extra-hud=true
171 -D gallium-vdpau=true
172 -D gallium-xvmc=true
173 -D gallium-omx=bellagio
174 -D gallium-va=true
175 -D gallium-xa=true
176 -D gallium-nine=false
177 -D gallium-opencl=disabled
178 GALLIUM_DRIVERS: "iris,nouveau,kmsro,r300,r600,freedreno,svga,v3d,vc4,virgl,etnaviv,panfrost,lima"
179 LLVM_VERSION: "7"
180 EXTRA_OPTION: >
181 -D tools=all
182 MESON_SHADERDB: "true"
183
184 meson-clover:
185 extends: .meson-build
186 variables:
187 UNWIND: "true"
188 DRI_LOADERS: >
189 -D glx=disabled
190 -D egl=false
191 -D gbm=false
192 GALLIUM_ST: >
193 -D dri3=false
194 -D gallium-vdpau=false
195 -D gallium-xvmc=false
196 -D gallium-omx=disabled
197 -D gallium-va=false
198 -D gallium-xa=false
199 -D gallium-nine=false
200 -D gallium-opencl=icd
201 script:
202 - export GALLIUM_DRIVERS="r600,radeonsi"
203 - .gitlab-ci/meson-build.sh
204 - LLVM_VERSION=7 .gitlab-ci/meson-build.sh
205 - export GALLIUM_DRIVERS="i915,r600"
206 - LLVM_VERSION=3.9 .gitlab-ci/meson-build.sh
207 - LLVM_VERSION=4.0 .gitlab-ci/meson-build.sh
208 - LLVM_VERSION=5.0 .gitlab-ci/meson-build.sh
209 - LLVM_VERSION=6.0 .gitlab-ci/meson-build.sh
210
211 meson-vulkan:
212 extends: .meson-build
213 variables:
214 UNWIND: "false"
215 DRI_LOADERS: >
216 -D glx=disabled
217 -D gbm=false
218 -D egl=false
219 -D platforms=x11,wayland,drm
220 -D osmesa=none
221 GALLIUM_ST: >
222 -D dri3=true
223 -D gallium-vdpau=false
224 -D gallium-xvmc=false
225 -D gallium-omx=disabled
226 -D gallium-va=false
227 -D gallium-xa=false
228 -D gallium-nine=false
229 -D gallium-opencl=disabled
230 VULKAN_DRIVERS: intel,amd,freedreno
231 LLVM_VERSION: "7"
232 EXTRA_OPTION: >
233 -D vulkan-overlay-layer=true
234
235 .meson-cross:
236 extends: .meson-build
237 variables:
238 UNWIND: "false"
239 DRI_LOADERS: >
240 -D glx=disabled
241 -D gbm=false
242 -D egl=false
243 -D platforms=surfaceless
244 -D osmesa=none
245 GALLIUM_ST: >
246 -D dri3=false
247 -D gallium-vdpau=false
248 -D gallium-xvmc=false
249 -D gallium-omx=disabled
250 -D gallium-va=false
251 -D gallium-xa=false
252 -D gallium-nine=false
253 -D llvm=false
254 CROSS: >
255 --cross /tmp/cross_file.txt
256
257 script:
258 - /usr/share/meson/debcrossgen --arch ${ARCH} -o /tmp/cross_file.txt
259 # Work around a bug in debcrossgen that should be fixed in the next release
260 - sed -i "s|cpu_family = 'i686'|cpu_family = 'x86'|g" /tmp/cross_file.txt
261 - .gitlab-ci/meson-build.sh
262
263 meson-armhf:
264 extends: .meson-cross
265 variables:
266 ARCH: armhf
267 VULKAN_DRIVERS: freedreno
268 GALLIUM_DRIVERS: "etnaviv,freedreno,kmsro,lima,nouveau,panfrost,tegra,v3d,vc4"
269 # Disable the tests since we're cross compiling.
270 EXTRA_OPTION: >
271 -D build-tests=false
272 -D I-love-half-baked-turnips=true
273 -D vulkan-overlay-layer=true
274
275 meson-arm64:
276 extends: .meson-cross
277 variables:
278 ARCH: arm64
279 VULKAN_DRIVERS: freedreno
280 GALLIUM_DRIVERS: "etnaviv,freedreno,kmsro,lima,nouveau,panfrost,tegra,v3d,vc4"
281 # Disable the tests since we're cross compiling.
282 EXTRA_OPTION: >
283 -D build-tests=false
284 -D I-love-half-baked-turnips=true
285 -D vulkan-overlay-layer=true
286
287 meson-i386:
288 extends: .meson-cross
289 variables:
290 ARCH: i386
291 VULKAN_DRIVERS: intel
292 GALLIUM_DRIVERS: "swrast"
293 # Disable i386 tests, because u_format_tests gets precision
294 # failures in dxtn unpacking
295 EXTRA_OPTION: >
296 -D build-tests=false
297 -D vulkan-overlay-layer=true
298
299 scons-nollvm:
300 extends: .scons-build
301 variables:
302 SCONS_TARGET: "llvm=0"
303 SCONS_CHECK_COMMAND: "scons llvm=0 check"
304
305 scons-llvm:
306 extends: .scons-build
307 variables:
308 SCONS_TARGET: "llvm=1"
309 SCONS_CHECK_COMMAND: "scons llvm=1 check"
310 LLVM_VERSION: "3.4"
311 # LLVM 3.4 packages were built with an old libstdc++ ABI
312 CXX: "g++ -D_GLIBCXX_USE_CXX11_ABI=0"