gitlab-ci: Use LLVM 3.4 from Debian jessie for scons-llvm job
[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 #
16 # The format of the tag is "%Y-%m-%d-${counter}" where ${counter} stays
17 # at "01" unless you have multiple updates on the same day :)
18 variables:
19 UPSTREAM_REPO: mesa/mesa
20 DEBIAN_TAG: "2019-04-16"
21 DEBIAN_VERSION: stretch-slim
22 DEBIAN_IMAGE: "$CI_REGISTRY_IMAGE/debian/$DEBIAN_VERSION:$DEBIAN_TAG"
23
24 include:
25 - project: 'wayland/ci-templates'
26 ref: c73dae8b84697ef18e2dbbf4fed7386d9652b0cd
27 file: '/templates/debian.yml'
28
29 stages:
30 - containers-build
31 - build+test
32
33
34 # When to automatically run the CI
35 .ci-run-policy: &ci-run-policy
36 only:
37 - branches@mesa/mesa
38 - merge_requests
39 - /^ci([-/].*)?$/
40 retry:
41 max: 2
42 when:
43 - runner_system_failure
44
45
46 # CONTAINERS
47
48 debian:
49 extends: .debian@container-ifnot-exists
50 stage: containers-build
51 <<: *ci-run-policy
52 variables:
53 GIT_STRATEGY: none # no need to pull the whole tree for rebuilding the image
54 DEBIAN_EXEC: 'bash .gitlab-ci/debian-install.sh'
55
56
57 # BUILD
58
59 .build:
60 <<: *ci-run-policy
61 image: $DEBIAN_IMAGE
62 stage: build+test
63 cache:
64 paths:
65 - ccache
66 artifacts:
67 when: on_failure
68 untracked: true
69 variables:
70 CCACHE_COMPILERCHECK: "content"
71 # Use ccache transparently, and print stats before/after
72 before_script:
73 - export PATH="/usr/lib/ccache:$PATH"
74 - export CCACHE_BASEDIR="$PWD"
75 - export CCACHE_DIR="$PWD/ccache"
76 - ccache --zero-stats || true
77 - ccache --show-stats || true
78 after_script:
79 - export CCACHE_DIR="$PWD/ccache"
80 - ccache --show-stats
81
82 .meson-build:
83 extends: .build
84 script:
85 # We need to control the version of llvm-config we're using, so we'll
86 # generate a native file to do so. This requires meson >=0.49
87 - if test -n "$LLVM_VERSION"; then
88 LLVM_CONFIG="llvm-config-${LLVM_VERSION}";
89 echo -e "[binaries]\nllvm-config = '`which $LLVM_CONFIG`'" > native.file;
90 $LLVM_CONFIG --version;
91 else
92 touch native.file;
93 fi
94 - meson --version
95 - meson _build
96 --native-file=native.file
97 -D build-tests=true
98 -D libunwind=${UNWIND}
99 ${DRI_LOADERS}
100 -D dri-drivers=${DRI_DRIVERS:-[]}
101 ${GALLIUM_ST}
102 -D gallium-drivers=${GALLIUM_DRIVERS:-[]}
103 -D vulkan-drivers=${VULKAN_DRIVERS:-[]}
104 -D I-love-half-baked-turnips=true
105 - cd _build
106 - meson configure
107 - ninja -j4
108 - LC_ALL=C.UTF-8 ninja test
109
110 .scons-build:
111 extends: .build
112 variables:
113 SCONSFLAGS: "-j4"
114 script:
115 - if test -n "$LLVM_VERSION"; then
116 export LLVM_CONFIG="llvm-config-${LLVM_VERSION}";
117 fi
118 - scons $SCONS_TARGET
119 - eval $SCONS_CHECK_COMMAND
120
121 # NOTE: Building SWR is 2x (yes two) times slower than all the other
122 # gallium drivers combined.
123 # Start this early so that it doesn't limit the total run time.
124 meson-gallium-swr:
125 extends: .meson-build
126 variables:
127 UNWIND: "true"
128 DRI_LOADERS: >
129 -D glx=disabled
130 -D egl=false
131 -D gbm=false
132 GALLIUM_ST: >
133 -D dri3=false
134 -D gallium-vdpau=false
135 -D gallium-xvmc=false
136 -D gallium-omx=disabled
137 -D gallium-va=false
138 -D gallium-xa=false
139 -D gallium-nine=false
140 -D gallium-opencl=disabled
141 GALLIUM_DRIVERS: "swr"
142 LLVM_VERSION: "6.0"
143
144 meson-clang:
145 extends: .meson-build
146 variables:
147 UNWIND: "true"
148 DRI_DRIVERS: "auto"
149 GALLIUM_DRIVERS: "auto"
150 CC: "ccache clang-8"
151 CXX: "ccache clang++-8"
152 before_script:
153 - export CCACHE_BASEDIR="$PWD" CCACHE_DIR="$PWD/ccache"
154 - ccache --zero-stats --show-stats || true
155 # clang++ breaks if it picks up the GCC 8 directory without libstdc++.so
156 - apt-get remove -y libgcc-8-dev
157
158 meson-vulkan:
159 extends: .meson-build
160 variables:
161 UNWIND: "false"
162 DRI_LOADERS: >
163 -D glx=disabled
164 -D gbm=false
165 -D egl=false
166 -D platforms=x11,wayland,drm
167 -D osmesa=none
168 GALLIUM_ST: >
169 -D dri3=true
170 -D gallium-vdpau=false
171 -D gallium-xvmc=false
172 -D gallium-omx=disabled
173 -D gallium-va=false
174 -D gallium-xa=false
175 -D gallium-nine=false
176 -D gallium-opencl=disabled
177 VULKAN_DRIVERS: intel,amd,freedreno
178 LLVM_VERSION: "7"
179
180 meson-loader-classic-dri:
181 extends: .meson-build
182 variables:
183 UNWIND: "false"
184 DRI_LOADERS: >
185 -D glx=dri
186 -D gbm=true
187 -D egl=true
188 -D platforms=x11,wayland,drm,surfaceless
189 -D osmesa=classic
190 DRI_DRIVERS: "i915,i965,r100,r200,swrast,nouveau"
191 GALLIUM_ST: >
192 -D dri3=true
193 -D gallium-vdpau=false
194 -D gallium-xvmc=false
195 -D gallium-omx=disabled
196 -D gallium-va=false
197 -D gallium-xa=false
198 -D gallium-nine=false
199 -D gallium-opencl=disabled
200
201 meson-glvnd:
202 extends: .meson-build
203 variables:
204 UNWIND: "true"
205 DRI_LOADERS: >
206 -D glvnd=true
207 -D egl=true
208 -D gbm=true
209 -D glx=dri
210 DRI_DRIVERS: "i965"
211 GALLIUM_ST: >
212 -D gallium-vdpau=false
213 -D gallium-xvmc=false
214 -D gallium-omx=disabled
215 -D gallium-va=false
216 -D gallium-xa=false
217 -D gallium-nine=false
218 -D gallium-opencl=disabled
219
220 meson-gallium-radeonsi:
221 extends: .meson-build
222 variables:
223 UNWIND: "true"
224 DRI_LOADERS: >
225 -D glx=disabled
226 -D egl=false
227 -D gbm=false
228 GALLIUM_ST: >
229 -D dri3=false
230 -D gallium-vdpau=false
231 -D gallium-xvmc=false
232 -D gallium-omx=disabled
233 -D gallium-va=false
234 -D gallium-xa=false
235 -D gallium-nine=false
236 -D gallium-opencl=disabled
237 GALLIUM_DRIVERS: "radeonsi"
238 LLVM_VERSION: "7"
239
240 meson-gallium-drivers-other:
241 extends: .meson-build
242 variables:
243 UNWIND: "true"
244 DRI_LOADERS: >
245 -D glx=disabled
246 -D egl=false
247 -D gbm=false
248 GALLIUM_ST: >
249 -D dri3=false
250 -D gallium-vdpau=false
251 -D gallium-xvmc=false
252 -D gallium-omx=disabled
253 -D gallium-va=false
254 -D gallium-xa=false
255 -D gallium-nine=false
256 -D gallium-opencl=disabled
257 GALLIUM_DRIVERS: "i915,iris,nouveau,kmsro,r300,r600,freedreno,svga,swrast,v3d,vc4,virgl,etnaviv,panfrost,lima"
258 LLVM_VERSION: "5.0"
259
260 meson-gallium-clover-llvm:
261 extends: .meson-build
262 variables:
263 UNWIND: "true"
264 DRI_LOADERS: >
265 -D glx=disabled
266 -D egl=false
267 -D gbm=false
268 GALLIUM_ST: >
269 -D dri3=false
270 -D gallium-vdpau=false
271 -D gallium-xvmc=false
272 -D gallium-omx=disabled
273 -D gallium-va=false
274 -D gallium-xa=false
275 -D gallium-nine=false
276 -D gallium-opencl=icd
277 GALLIUM_DRIVERS: "r600,radeonsi"
278
279 meson-gallium-clover-llvm39:
280 extends: meson-gallium-clover-llvm
281 variables:
282 GALLIUM_DRIVERS: "r600"
283 LLVM_VERSION: "3.9"
284
285 meson-gallium-st-other:
286 extends: .meson-build
287 variables:
288 UNWIND: "true"
289 DRI_LOADERS: >
290 -D glx=disabled
291 -D egl=false
292 -D gbm=false
293 GALLIUM_ST: >
294 -D dri3=true
295 -D gallium-extra-hud=true
296 -D gallium-vdpau=true
297 -D gallium-xvmc=true
298 -D gallium-omx=bellagio
299 -D gallium-va=true
300 -D gallium-xa=true
301 -D gallium-nine=true
302 -D gallium-opencl=disabled
303 -D osmesa=gallium
304 GALLIUM_DRIVERS: "nouveau,swrast"
305 LLVM_VERSION: "5.0"
306
307 scons-nollvm:
308 extends: .scons-build
309 variables:
310 SCONS_TARGET: "llvm=0"
311 SCONS_CHECK_COMMAND: "scons llvm=0 check"
312
313 scons-llvm:
314 extends: .scons-build
315 variables:
316 SCONS_TARGET: "llvm=1"
317 SCONS_CHECK_COMMAND: "scons llvm=1 check"
318 LLVM_VERSION: "3.4"
319 # LLVM 3.4 packages were built with an old libstdc++ ABI
320 CXX: "g++ -D_GLIBCXX_USE_CXX11_ABI=0"
321
322 scons-swr:
323 extends: .scons-build
324 variables:
325 SCONS_TARGET: "swr=1"
326 SCONS_CHECK_COMMAND: "true"
327 LLVM_VERSION: "6.0"