loader: include limits.h for PATH_MAX
[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-08-09"
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 - test
30
31
32 # When to automatically run the CI
33 .ci-run-policy: &ci-run-policy
34 only:
35 - branches@mesa/mesa
36 - merge_requests
37 - /^ci([-/].*)?$/
38 retry:
39 max: 2
40 when:
41 - runner_system_failure
42
43 .ci-deqp-artifacts: &ci-deqp-artifacts
44 artifacts:
45 when: always
46 untracked: false
47 paths:
48 # Watch out! Artifacts are relative to the build dir.
49 # https://gitlab.com/gitlab-org/gitlab-ce/commit/8788fb925706cad594adf6917a6c5f6587dd1521
50 - artifacts
51
52 # CONTAINERS
53
54 debian:
55 extends: .debian@container-ifnot-exists
56 stage: containers-build
57 <<: *ci-run-policy
58 variables:
59 GIT_STRATEGY: none # no need to pull the whole tree for rebuilding the image
60 DEBIAN_EXEC: 'bash .gitlab-ci/debian-install.sh'
61
62
63 # BUILD
64
65 .build:
66 <<: *ci-run-policy
67 image: $DEBIAN_IMAGE
68 stage: build+test
69 cache:
70 paths:
71 - ccache
72 artifacts:
73 when: always
74 paths:
75 - _build/meson-logs/*.txt
76 # scons:
77 - build/*/config.log
78 - shader-db
79 variables:
80 CCACHE_COMPILERCHECK: "content"
81 # Use ccache transparently, and print stats before/after
82 before_script:
83 - export PATH="/usr/lib/ccache:$PATH"
84 - export CCACHE_BASEDIR="$PWD"
85 - export CCACHE_DIR="$PWD/ccache"
86 - ccache --zero-stats || true
87 - ccache --show-stats || true
88 after_script:
89 # In case the install dir is being saved as artifacts, tar it up
90 # so that symlinks and hardlinks aren't each packed separately in
91 # the zip file.
92 - if [ -d install ]; then
93 tar -cf artifacts/install.tar install;
94 fi
95 - export CCACHE_DIR="$PWD/ccache"
96 - ccache --show-stats
97
98 .meson-build:
99 extends: .build
100 script:
101 - .gitlab-ci/meson-build.sh
102
103 .scons-build:
104 extends: .build
105 variables:
106 SCONSFLAGS: "-j4"
107 script:
108 - if test -n "$LLVM_VERSION"; then
109 export LLVM_CONFIG="llvm-config-${LLVM_VERSION}";
110 fi
111 - scons $SCONS_TARGET
112 - eval $SCONS_CHECK_COMMAND
113
114 meson-main:
115 extends: .meson-build
116 variables:
117 UNWIND: "true"
118 DRI_LOADERS: >
119 -D glx=dri
120 -D gbm=true
121 -D egl=true
122 -D platforms=x11,wayland,drm,surfaceless
123 DRI_DRIVERS: "i915,i965,r100,r200,nouveau"
124 GALLIUM_ST: >
125 -D dri3=true
126 -D gallium-extra-hud=true
127 -D gallium-vdpau=true
128 -D gallium-xvmc=true
129 -D gallium-omx=bellagio
130 -D gallium-va=true
131 -D gallium-xa=true
132 -D gallium-nine=true
133 -D gallium-opencl=disabled
134 GALLIUM_DRIVERS: "iris,nouveau,kmsro,r300,r600,freedreno,swrast,svga,v3d,vc4,virgl,etnaviv,panfrost,lima"
135 LLVM_VERSION: "7"
136 EXTRA_OPTION: >
137 -D osmesa=gallium
138 -D tools=all
139 MESON_SHADERDB: "true"
140 BUILDTYPE: "debugoptimized"
141 <<: *ci-deqp-artifacts
142
143 # NOTE: Building SWR is 2x (yes two) times slower than all the other
144 # gallium drivers combined.
145 # Start this early so that it doesn't limit the total run time.
146 #
147 # We also stick the glvnd build here, since we want non-glvnd in
148 # meson-main for actual driver CI.
149 meson-swr-glvnd:
150 extends: .meson-build
151 variables:
152 UNWIND: "true"
153 DRI_LOADERS: >
154 -D glvnd=true
155 -D egl=true
156 GALLIUM_ST: >
157 -D dri3=true
158 -D gallium-vdpau=false
159 -D gallium-xvmc=false
160 -D gallium-omx=disabled
161 -D gallium-va=false
162 -D gallium-xa=false
163 -D gallium-nine=false
164 -D gallium-opencl=disabled
165 GALLIUM_DRIVERS: "swr,iris"
166 LLVM_VERSION: "6.0"
167
168 meson-clang:
169 extends: .meson-build
170 variables:
171 UNWIND: "true"
172 DRI_DRIVERS: "auto"
173 GALLIUM_DRIVERS: "auto"
174 VULKAN_DRIVERS: intel,amd,freedreno
175 CC: "ccache clang-8"
176 CXX: "ccache clang++-8"
177 before_script:
178 - export CCACHE_BASEDIR="$PWD" CCACHE_DIR="$PWD/ccache"
179 - ccache --zero-stats --show-stats || true
180 # clang++ breaks if it picks up the GCC 8 directory without libstdc++.so
181 - apt-get remove -y libgcc-8-dev
182
183 scons-swr:
184 extends: .scons-build
185 variables:
186 SCONS_TARGET: "swr=1"
187 SCONS_CHECK_COMMAND: "true"
188 LLVM_VERSION: "6.0"
189
190 scons-win64:
191 extends: .scons-build
192 variables:
193 SCONS_TARGET: platform=windows machine=x86_64
194 SCONS_CHECK_COMMAND: "true"
195
196 meson-clover:
197 extends: .meson-build
198 variables:
199 UNWIND: "true"
200 DRI_LOADERS: >
201 -D glx=disabled
202 -D egl=false
203 -D gbm=false
204 GALLIUM_ST: >
205 -D dri3=false
206 -D gallium-vdpau=false
207 -D gallium-xvmc=false
208 -D gallium-omx=disabled
209 -D gallium-va=false
210 -D gallium-xa=false
211 -D gallium-nine=false
212 -D gallium-opencl=icd
213 script:
214 - export GALLIUM_DRIVERS="r600,radeonsi"
215 - .gitlab-ci/meson-build.sh
216 - LLVM_VERSION=8 .gitlab-ci/meson-build.sh
217 - export GALLIUM_DRIVERS="i915,r600"
218 - LLVM_VERSION=3.9 .gitlab-ci/meson-build.sh
219 - LLVM_VERSION=4.0 .gitlab-ci/meson-build.sh
220 - LLVM_VERSION=5.0 .gitlab-ci/meson-build.sh
221 - LLVM_VERSION=6.0 .gitlab-ci/meson-build.sh
222 - LLVM_VERSION=7 .gitlab-ci/meson-build.sh
223
224 meson-vulkan:
225 extends: .meson-build
226 variables:
227 UNWIND: "false"
228 DRI_LOADERS: >
229 -D glx=disabled
230 -D gbm=false
231 -D egl=false
232 -D platforms=x11,wayland,drm
233 -D osmesa=none
234 GALLIUM_ST: >
235 -D dri3=true
236 -D gallium-vdpau=false
237 -D gallium-xvmc=false
238 -D gallium-omx=disabled
239 -D gallium-va=false
240 -D gallium-xa=false
241 -D gallium-nine=false
242 -D gallium-opencl=disabled
243 VULKAN_DRIVERS: intel,amd,freedreno
244 LLVM_VERSION: "8"
245 EXTRA_OPTION: >
246 -D vulkan-overlay-layer=true
247
248 .meson-cross:
249 extends: .meson-build
250 variables:
251 UNWIND: "false"
252 DRI_LOADERS: >
253 -D glx=disabled
254 -D gbm=false
255 -D egl=false
256 -D platforms=surfaceless
257 -D osmesa=none
258 GALLIUM_ST: >
259 -D dri3=false
260 -D gallium-vdpau=false
261 -D gallium-xvmc=false
262 -D gallium-omx=disabled
263 -D gallium-va=false
264 -D gallium-xa=false
265 -D gallium-nine=false
266 -D llvm=false
267 <<: *ci-deqp-artifacts
268 script:
269 - .gitlab-ci/meson-build.sh
270
271 meson-armhf:
272 extends: .meson-cross
273 variables:
274 CROSS: armhf
275 VULKAN_DRIVERS: freedreno
276 GALLIUM_DRIVERS: "etnaviv,freedreno,kmsro,lima,nouveau,panfrost,tegra,v3d,vc4"
277 # Disable the tests since we're cross compiling.
278 EXTRA_OPTION: >
279 -D build-tests=false
280 -D I-love-half-baked-turnips=true
281 -D vulkan-overlay-layer=true
282
283 meson-arm64:
284 extends: .meson-cross
285 variables:
286 CROSS: arm64
287 VULKAN_DRIVERS: freedreno
288 GALLIUM_DRIVERS: "etnaviv,freedreno,kmsro,lima,nouveau,panfrost,tegra,v3d,vc4"
289 # Disable the tests since we're cross compiling.
290 EXTRA_OPTION: >
291 -D build-tests=false
292 -D I-love-half-baked-turnips=true
293 -D vulkan-overlay-layer=true
294
295 # While the main point of this build is testing the i386 cross build,
296 # we also use this one to test some other options that are exclusive
297 # with meson-main's choices (classic swrast and osmesa)
298 meson-i386:
299 extends: .meson-cross
300 variables:
301 CROSS: i386
302 VULKAN_DRIVERS: intel
303 DRI_DRIVERS: "swrast"
304 GALLIUM_DRIVERS: "iris"
305 # Disable i386 tests, because u_format_tests gets precision
306 # failures in dxtn unpacking
307 EXTRA_OPTION: >
308 -D build-tests=false
309 -D vulkan-overlay-layer=true
310 -D llvm=false
311 -D osmesa=classic
312
313 scons-nollvm:
314 extends: .scons-build
315 variables:
316 SCONS_TARGET: "llvm=0"
317 SCONS_CHECK_COMMAND: "scons llvm=0 check"
318
319 scons-llvm:
320 extends: .scons-build
321 variables:
322 SCONS_TARGET: "llvm=1"
323 SCONS_CHECK_COMMAND: "scons llvm=1 check"
324 LLVM_VERSION: "3.4"
325 # LLVM 3.4 packages were built with an old libstdc++ ABI
326 CXX: "g++ -D_GLIBCXX_USE_CXX11_ABI=0"
327
328 .deqp-test:
329 <<: *ci-run-policy
330 stage: test
331 image: $DEBIAN_IMAGE
332 variables:
333 GIT_STRATEGY: none # testing doesn't build anything from source
334 DEQP_SKIPS: deqp-default-skips.txt
335 script:
336 # Note: Build dir (and thus install) may be dirty due to GIT_STRATEGY
337 - rm -rf install
338 - tar -xf artifacts/install.tar
339 - ./artifacts/deqp-runner.sh
340 artifacts:
341 when: on_failure
342 name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
343 paths:
344 - results/
345
346 test-llvmpipe-gles2:
347 parallel: 4
348 variables:
349 DEQP_VER: gles2
350 DEQP_EXPECTED_FAILS: deqp-llvmpipe-fails.txt
351 LIBGL_ALWAYS_SOFTWARE: "true"
352 DEQP_RENDERER_MATCH: "llvmpipe"
353 extends: .deqp-test
354 dependencies:
355 - meson-main
356 needs: [meson-main]
357
358 test-softpipe-gles2:
359 parallel: 4
360 variables:
361 DEQP_VER: gles2
362 DEQP_EXPECTED_FAILS: deqp-softpipe-fails.txt
363 LIBGL_ALWAYS_SOFTWARE: "true"
364 DEQP_RENDERER_MATCH: "softpipe"
365 GALLIUM_DRIVER: "softpipe"
366 extends: .deqp-test
367 dependencies:
368 - meson-main
369 needs: [meson-main]
370
371 # The GLES2 CTS run takes about 8 minutes of CPU time, while GLES3 is
372 # 25 minutes. Until we can get its runtime down, just do a partial
373 # (every 10 tests) run.
374 test-softpipe-gles3-limited:
375 variables:
376 DEQP_VER: gles3
377 DEQP_EXPECTED_FAILS: deqp-softpipe-fails.txt
378 LIBGL_ALWAYS_SOFTWARE: "true"
379 DEQP_RENDERER_MATCH: "softpipe"
380 GALLIUM_DRIVER: "softpipe"
381 CI_NODE_INDEX: 1
382 CI_NODE_TOTAL: 10
383 extends: .deqp-test
384 dependencies:
385 - meson-main
386 needs: [meson-main]