gitlab-ci: add make loaders/classic DRI build
[mesa.git] / .travis.yml
1 language: c
2
3 dist: xenial
4
5 cache:
6 apt: true
7 ccache: true
8
9 env:
10 global:
11 - XORG_RELEASES=https://xorg.freedesktop.org/releases/individual
12 - XCB_RELEASES=https://xcb.freedesktop.org/dist
13 - WAYLAND_RELEASES=https://wayland.freedesktop.org/releases
14 - XORGMACROS_VERSION=util-macros-1.19.0
15 - GLPROTO_VERSION=glproto-1.4.17
16 - DRI2PROTO_VERSION=dri2proto-2.8
17 - LIBPCIACCESS_VERSION=libpciaccess-0.13.4
18 - LIBDRM_VERSION=libdrm-2.4.97
19 - XCBPROTO_VERSION=xcb-proto-1.13
20 - RANDRPROTO_VERSION=randrproto-1.3.0
21 - LIBXRANDR_VERSION=libXrandr-1.3.0
22 - LIBXCB_VERSION=libxcb-1.13
23 - LIBXSHMFENCE_VERSION=libxshmfence-1.2
24 - LIBVDPAU_VERSION=libvdpau-1.1
25 - LIBVA_VERSION=libva-1.7.0
26 - LIBWAYLAND_VERSION=wayland-1.15.0
27 - WAYLAND_PROTOCOLS_VERSION=wayland-protocols-1.8
28 - PKG_CONFIG_PATH=$HOME/prefix/lib/pkgconfig:$HOME/prefix/share/pkgconfig
29 - LD_LIBRARY_PATH="$HOME/prefix/lib:$LD_LIBRARY_PATH"
30 - PATH="$HOME/prefix/bin:$PATH"
31
32 matrix:
33 include:
34 - env:
35 # NOTE: Building SWR is 2x (yes two) times slower than all the other
36 # gallium drivers combined.
37 # Start this early so that it doesn't hunder the run time.
38 - LABEL="make Gallium Drivers SWR"
39 - BUILD=make
40 - MAKEFLAGS="-j4"
41 - MAKE_CHECK_COMMAND="true"
42 - LLVM_VERSION=6.0
43 - LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
44 - DRI_LOADERS="--disable-glx --disable-gbm --disable-egl"
45 - DRI_DRIVERS=""
46 - GALLIUM_ST="--enable-dri --disable-opencl --disable-xa --disable-nine --disable-xvmc --disable-vdpau --disable-va --disable-omx-bellagio --disable-gallium-osmesa"
47 - GALLIUM_DRIVERS="swr"
48 - VULKAN_DRIVERS=""
49 - LIBUNWIND_FLAGS="--enable-libunwind"
50 addons:
51 apt:
52 packages:
53 - llvm-6.0-dev
54 # Common
55 - xz-utils
56 - libexpat1-dev
57 - libx11-xcb-dev
58 - libelf-dev
59 - libunwind8-dev
60 - python3-pip
61 - python3-setuptools
62 - env:
63 - LABEL="make Gallium Drivers RadeonSI"
64 - BUILD=make
65 - MAKEFLAGS="-j4"
66 - MAKE_CHECK_COMMAND="true"
67 - LLVM_VERSION=7
68 - LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
69 - DRI_LOADERS="--disable-glx --disable-gbm --disable-egl"
70 - DRI_DRIVERS=""
71 - GALLIUM_ST="--enable-dri --disable-opencl --disable-xa --disable-nine --disable-xvmc --disable-vdpau --disable-va --disable-omx-bellagio --disable-gallium-osmesa"
72 - GALLIUM_DRIVERS="radeonsi"
73 - VULKAN_DRIVERS=""
74 - LIBUNWIND_FLAGS="--enable-libunwind"
75 addons:
76 apt:
77 sources:
78 - sourceline: 'deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-7 main'
79 key_url: https://apt.llvm.org/llvm-snapshot.gpg.key
80 packages:
81 # From sources above
82 - llvm-7-dev
83 # Common
84 - xz-utils
85 - libexpat1-dev
86 - libx11-xcb-dev
87 - libelf-dev
88 - libunwind8-dev
89 - python3-pip
90 - python3-setuptools
91 - env:
92 - LABEL="make Gallium Drivers Other"
93 - BUILD=make
94 - MAKEFLAGS="-j4"
95 - MAKE_CHECK_COMMAND="true"
96 - LLVM_VERSION=3.9
97 - LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
98 - DRI_LOADERS="--disable-glx --disable-gbm --disable-egl"
99 - DRI_DRIVERS=""
100 - GALLIUM_ST="--enable-dri --disable-opencl --disable-xa --disable-nine --disable-xvmc --disable-vdpau --disable-va --disable-omx-bellagio --disable-gallium-osmesa"
101 - GALLIUM_DRIVERS="i915,nouveau,kmsro,r300,r600,freedreno,svga,swrast,v3d,vc4,virgl,etnaviv"
102 - VULKAN_DRIVERS=""
103 - LIBUNWIND_FLAGS="--enable-libunwind"
104 addons:
105 apt:
106 packages:
107 # LLVM packaging is broken and misses these dependencies
108 - libedit-dev
109 - llvm-3.9-dev
110 # Common
111 - xz-utils
112 - libexpat1-dev
113 - libx11-xcb-dev
114 - libelf-dev
115 - libunwind8-dev
116 - python3-pip
117 - python3-setuptools
118 - env:
119 - LABEL="make Gallium ST Clover LLVM-3.9"
120 - BUILD=make
121 - MAKEFLAGS="-j4"
122 - MAKE_CHECK_COMMAND="true"
123 - LLVM_VERSION=3.9
124 - LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
125 - DRI_LOADERS="--disable-glx --disable-gbm --disable-egl"
126 - DRI_DRIVERS=""
127 - GALLIUM_ST="--disable-dri --enable-opencl --enable-opencl-icd --enable-llvm --disable-xa --disable-nine --disable-xvmc --disable-vdpau --disable-va --disable-omx-bellagio --disable-gallium-osmesa"
128 - GALLIUM_DRIVERS="r600"
129 - VULKAN_DRIVERS=""
130 - LIBUNWIND_FLAGS="--enable-libunwind"
131 addons:
132 apt:
133 packages:
134 - libclc-dev
135 # LLVM packaging is broken and misses these dependencies
136 - libedit-dev
137 - llvm-3.9-dev
138 - clang-3.9
139 - libclang-3.9-dev
140 # Common
141 - xz-utils
142 - libexpat1-dev
143 - libx11-xcb-dev
144 - libelf-dev
145 - libunwind8-dev
146 - python3-pip
147 - python3-setuptools
148 - env:
149 - LABEL="make Gallium ST Clover LLVM-4.0"
150 - BUILD=make
151 - MAKEFLAGS="-j4"
152 - MAKE_CHECK_COMMAND="true"
153 - LLVM_VERSION=4.0
154 - LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
155 - DRI_LOADERS="--disable-glx --disable-gbm --disable-egl"
156 - DRI_DRIVERS=""
157 - GALLIUM_ST="--disable-dri --enable-opencl --enable-opencl-icd --enable-llvm --disable-xa --disable-nine --disable-xvmc --disable-vdpau --disable-va --disable-omx-bellagio --disable-gallium-osmesa"
158 - GALLIUM_DRIVERS="r600"
159 - VULKAN_DRIVERS=""
160 - LIBUNWIND_FLAGS="--enable-libunwind"
161 addons:
162 apt:
163 packages:
164 - libclc-dev
165 # LLVM packaging is broken and misses these dependencies
166 - libedit-dev
167 - llvm-4.0-dev
168 - clang-4.0
169 - libclang-4.0-dev
170 # Common
171 - xz-utils
172 - libexpat1-dev
173 - libx11-xcb-dev
174 - libelf-dev
175 - libunwind8-dev
176 - python3-pip
177 - python3-setuptools
178 - env:
179 - LABEL="make Gallium ST Clover LLVM-5.0"
180 - BUILD=make
181 - MAKEFLAGS="-j4"
182 - MAKE_CHECK_COMMAND="true"
183 - LLVM_VERSION=5.0
184 - LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
185 - DRI_LOADERS="--disable-glx --disable-gbm --disable-egl"
186 - DRI_DRIVERS=""
187 - GALLIUM_ST="--disable-dri --enable-opencl --enable-opencl-icd --enable-llvm --disable-xa --disable-nine --disable-xvmc --disable-vdpau --disable-va --disable-omx-bellagio --disable-gallium-osmesa"
188 - GALLIUM_DRIVERS="r600"
189 - VULKAN_DRIVERS=""
190 - LIBUNWIND_FLAGS="--enable-libunwind"
191 addons:
192 apt:
193 packages:
194 - libclc-dev
195 # LLVM packaging is broken and misses these dependencies
196 - libedit-dev
197 - llvm-5.0-dev
198 - clang-5.0
199 - libclang-5.0-dev
200 # Common
201 - xz-utils
202 - libexpat1-dev
203 - libx11-xcb-dev
204 - libelf-dev
205 - libunwind8-dev
206 - python3-pip
207 - python3-setuptools
208 - env:
209 - LABEL="make Gallium ST Clover LLVM-6.0"
210 - BUILD=make
211 - MAKEFLAGS="-j4"
212 - MAKE_CHECK_COMMAND="true"
213 - LLVM_VERSION=6.0
214 - LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
215 - DRI_LOADERS="--disable-glx --disable-gbm --disable-egl"
216 - DRI_DRIVERS=""
217 - GALLIUM_ST="--disable-dri --enable-opencl --enable-opencl-icd --enable-llvm --disable-xa --disable-nine --disable-xvmc --disable-vdpau --disable-va --disable-omx-bellagio --disable-gallium-osmesa"
218 - GALLIUM_DRIVERS="r600"
219 - VULKAN_DRIVERS=""
220 - LIBUNWIND_FLAGS="--enable-libunwind"
221 addons:
222 apt:
223 packages:
224 - libclc-dev
225 - llvm-6.0-dev
226 - clang-6.0
227 - libclang-6.0-dev
228 # Common
229 - xz-utils
230 - libexpat1-dev
231 - libx11-xcb-dev
232 - libelf-dev
233 - libunwind8-dev
234 - python3-pip
235 - python3-setuptools
236 - env:
237 - LABEL="make Gallium ST Clover LLVM-7"
238 - BUILD=make
239 - MAKEFLAGS="-j4"
240 - MAKE_CHECK_COMMAND="true"
241 - LLVM_VERSION=7
242 - LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
243 - DRI_LOADERS="--disable-glx --disable-gbm --disable-egl"
244 - DRI_DRIVERS=""
245 - GALLIUM_ST="--disable-dri --enable-opencl --enable-opencl-icd --enable-llvm --disable-xa --disable-nine --disable-xvmc --disable-vdpau --disable-va --disable-omx-bellagio --disable-gallium-osmesa"
246 - GALLIUM_DRIVERS="r600,radeonsi"
247 - VULKAN_DRIVERS=""
248 - LIBUNWIND_FLAGS="--enable-libunwind"
249 addons:
250 apt:
251 sources:
252 - sourceline: 'deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-7 main'
253 key_url: https://apt.llvm.org/llvm-snapshot.gpg.key
254 packages:
255 - libclc-dev
256 # From sources above
257 - llvm-7-dev
258 - clang-7
259 - libclang-7-dev
260 # Common
261 - xz-utils
262 - libexpat1-dev
263 - libx11-xcb-dev
264 - libelf-dev
265 - libunwind8-dev
266 - env:
267 - LABEL="make Gallium ST Other"
268 - BUILD=make
269 - MAKEFLAGS="-j4"
270 - MAKE_CHECK_COMMAND="true"
271 - LLVM_VERSION=3.5
272 - LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
273 - DRI_LOADERS="--disable-glx --disable-gbm --disable-egl"
274 - DRI_DRIVERS=""
275 - GALLIUM_ST="--enable-dri --disable-opencl --enable-xa --enable-nine --enable-xvmc --enable-vdpau --enable-va --enable-omx-bellagio --enable-gallium-osmesa"
276 # We need swrast for osmesa and nine.
277 # i915 most likely doesn't work with most ST.
278 # Regardless - we're doing a quick build test here.
279 - GALLIUM_DRIVERS="i915,swrast"
280 - VULKAN_DRIVERS=""
281 - LIBUNWIND_FLAGS="--enable-libunwind"
282 addons:
283 apt:
284 packages:
285 # We actually want to test against llvm-3.3, yet 3.5 is available
286 - llvm-3.5-dev
287 # Nine requires gcc 4.6... which is the one we have right ?
288 - libxvmc-dev
289 # Build locally, for now.
290 #- libvdpau-dev
291 #- libva-dev
292 - libomxil-bellagio-dev
293 # LLVM packaging is broken and misses these dependencies
294 - libedit-dev
295 # Common
296 - xz-utils
297 - libexpat1-dev
298 - libx11-xcb-dev
299 - libelf-dev
300 - libunwind8-dev
301 - python3-pip
302 - python3-setuptools
303 - env:
304 - LABEL="macOS make"
305 - BUILD=make
306 - MAKEFLAGS="-j4"
307 - MAKE_CHECK_COMMAND="make check"
308 - DRI_LOADERS="--with-platforms=x11 --disable-egl"
309 os: osx
310 - env:
311 - LABEL="macOS meson"
312 - BUILD=meson
313 - UNWIND="false"
314 - DRI_LOADERS="-Dglx=dri -Dgbm=false -Degl=false -Dplatforms=x11 -Dosmesa=none"
315 - GALLIUM_ST="-Ddri3=true -Dgallium-vdpau=false -Dgallium-xvmc=false -Dgallium-omx=disabled -Dgallium-va=false -Dgallium-xa=false -Dgallium-nine=false -Dgallium-opencl=disabled"
316 os: osx
317
318 before_install:
319 - |
320 if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
321 HOMEBREW_NO_AUTO_UPDATE=1 brew install python3 ninja expat gettext
322 # Set PATH for homebrew pip3 installs
323 PATH="$HOME/Library/Python/3.6/bin:${PATH}"
324 # Set PKG_CONFIG_PATH for keg-only expat
325 PKG_CONFIG_PATH="/usr/local/opt/expat/lib/pkgconfig:${PKG_CONFIG_PATH}"
326 # Set PATH for keg-only gettext
327 PATH="/usr/local/opt/gettext/bin:${PATH}"
328
329 # Install xquartz for prereqs ...
330 XQUARTZ_VERSION="2.7.11"
331 wget -nv https://dl.bintray.com/xquartz/downloads/XQuartz-${XQUARTZ_VERSION}.dmg
332 hdiutil attach XQuartz-${XQUARTZ_VERSION}.dmg
333 sudo installer -pkg /Volumes/XQuartz-${XQUARTZ_VERSION}/XQuartz.pkg -target /
334 hdiutil detach /Volumes/XQuartz-${XQUARTZ_VERSION}
335 # ... and set paths
336 PATH="/opt/X11/bin:${PATH}"
337 PKG_CONFIG_PATH="/opt/X11/share/pkgconfig:/opt/X11/lib/pkgconfig:${PKG_CONFIG_PATH}"
338 ACLOCAL="aclocal -I /opt/X11/share/aclocal -I /usr/local/share/aclocal"
339 fi
340
341 install:
342 # Install a more modern meson from pip, since the version in the
343 # ubuntu repos is often quite old.
344 - if test "x$BUILD" = xmeson; then
345 pip3 install --user meson;
346 pip3 install --user mako;
347 fi
348
349 # Install autotools build dependencies
350 - if test "x$BUILD" = xmake; then
351 pip2 install --user mako;
352 fi
353
354 # Install a more modern scons from pip.
355 - if test "x$BUILD" = xscons; then
356 pip2 install --user "scons>=2.4";
357 pip2 install --user mako;
358 fi
359
360 # Install dependencies where we require specific versions (or where
361 # disallowed by Travis CI's package whitelisting).
362
363 - |
364 if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
365 wget $XORG_RELEASES/util/$XORGMACROS_VERSION.tar.bz2
366 tar -jxvf $XORGMACROS_VERSION.tar.bz2
367 (cd $XORGMACROS_VERSION && ./configure --prefix=$HOME/prefix && make install)
368
369 wget $XORG_RELEASES/proto/$GLPROTO_VERSION.tar.bz2
370 tar -jxvf $GLPROTO_VERSION.tar.bz2
371 (cd $GLPROTO_VERSION && ./configure --prefix=$HOME/prefix && make install)
372
373 wget $XORG_RELEASES/proto/$DRI2PROTO_VERSION.tar.bz2
374 tar -jxvf $DRI2PROTO_VERSION.tar.bz2
375 (cd $DRI2PROTO_VERSION && ./configure --prefix=$HOME/prefix && make install)
376
377 wget $XCB_RELEASES/$XCBPROTO_VERSION.tar.bz2
378 tar -jxvf $XCBPROTO_VERSION.tar.bz2
379 (cd $XCBPROTO_VERSION && ./configure --prefix=$HOME/prefix && make install)
380
381 wget $XCB_RELEASES/$LIBXCB_VERSION.tar.bz2
382 tar -jxvf $LIBXCB_VERSION.tar.bz2
383 (cd $LIBXCB_VERSION && ./configure --prefix=$HOME/prefix && make install)
384
385 wget $XORG_RELEASES/lib/$LIBPCIACCESS_VERSION.tar.bz2
386 tar -jxvf $LIBPCIACCESS_VERSION.tar.bz2
387 (cd $LIBPCIACCESS_VERSION && ./configure --prefix=$HOME/prefix && make install)
388
389 wget https://dri.freedesktop.org/libdrm/$LIBDRM_VERSION.tar.bz2
390 tar -jxvf $LIBDRM_VERSION.tar.bz2
391 (cd $LIBDRM_VERSION && ./configure --prefix=$HOME/prefix --enable-vc4 --enable-freedreno --enable-etnaviv-experimental-api && make install)
392
393 wget $XORG_RELEASES/proto/$RANDRPROTO_VERSION.tar.bz2
394 tar -jxvf $RANDRPROTO_VERSION.tar.bz2
395 (cd $RANDRPROTO_VERSION && ./configure --prefix=$HOME/prefix && make install)
396
397 wget $XORG_RELEASES/lib/$LIBXRANDR_VERSION.tar.bz2
398 tar -jxvf $LIBXRANDR_VERSION.tar.bz2
399 (cd $LIBXRANDR_VERSION && ./configure --prefix=$HOME/prefix && make install)
400
401 wget $XORG_RELEASES/lib/$LIBXSHMFENCE_VERSION.tar.bz2
402 tar -jxvf $LIBXSHMFENCE_VERSION.tar.bz2
403 (cd $LIBXSHMFENCE_VERSION && ./configure --prefix=$HOME/prefix && make install)
404
405 wget https://people.freedesktop.org/~aplattner/vdpau/$LIBVDPAU_VERSION.tar.bz2
406 tar -jxvf $LIBVDPAU_VERSION.tar.bz2
407 (cd $LIBVDPAU_VERSION && ./configure --prefix=$HOME/prefix && make install)
408
409 wget https://www.freedesktop.org/software/vaapi/releases/libva/$LIBVA_VERSION.tar.bz2
410 tar -jxvf $LIBVA_VERSION.tar.bz2
411 (cd $LIBVA_VERSION && ./configure --prefix=$HOME/prefix --disable-wayland --disable-dummy-driver && make install)
412
413 wget $WAYLAND_RELEASES/$LIBWAYLAND_VERSION.tar.xz
414 tar -axvf $LIBWAYLAND_VERSION.tar.xz
415 (cd $LIBWAYLAND_VERSION && ./configure --prefix=$HOME/prefix --enable-libraries --without-host-scanner --disable-documentation --disable-dtd-validation && make install)
416
417 wget $WAYLAND_RELEASES/$WAYLAND_PROTOCOLS_VERSION.tar.xz
418 tar -axvf $WAYLAND_PROTOCOLS_VERSION.tar.xz
419 (cd $WAYLAND_PROTOCOLS_VERSION && ./configure --prefix=$HOME/prefix && make install)
420
421 # Meson requires ninja >= 1.6, but xenial has 1.3.x
422 wget https://github.com/ninja-build/ninja/releases/download/v1.6.0/ninja-linux.zip
423 unzip ninja-linux.zip
424 mv ninja $HOME/prefix/bin/
425
426 # Generate this header since one is missing on the Travis instance
427 mkdir -p linux
428 printf "%s\n" \
429 "#ifndef _LINUX_MEMFD_H" \
430 "#define _LINUX_MEMFD_H" \
431 "" \
432 "#define MFD_CLOEXEC 0x0001U" \
433 "#define MFD_ALLOW_SEALING 0x0002U" \
434 "" \
435 "#endif /* _LINUX_MEMFD_H */" > linux/memfd.h
436
437 # Generate this header, including the missing SYS_memfd_create
438 # macro, which is not provided by the header in the Travis
439 # instance
440 mkdir -p sys
441 printf "%s\n" \
442 "#ifndef _SYSCALL_H" \
443 "#define _SYSCALL_H 1" \
444 "" \
445 "#include <asm/unistd.h>" \
446 "" \
447 "#ifndef _LIBC" \
448 "# include <bits/syscall.h>" \
449 "#endif" \
450 "" \
451 "#ifndef __NR_memfd_create" \
452 "# define __NR_memfd_create 319 /* Taken from <asm/unistd_64.h> */" \
453 "#endif" \
454 "" \
455 "#ifndef SYS_memfd_create" \
456 "# define SYS_memfd_create __NR_memfd_create" \
457 "#endif" \
458 "" \
459 "#endif" > sys/syscall.h
460 fi
461
462 script:
463 - if test "x$BUILD" = xmake; then
464 export CFLAGS="$CFLAGS -isystem`pwd`";
465
466 mkdir build &&
467 cd build &&
468 ../autogen.sh
469 --enable-autotools
470 --enable-debug
471 $LIBUNWIND_FLAGS
472 $DRI_LOADERS
473 --with-dri-drivers=$DRI_DRIVERS
474 $GALLIUM_ST
475 --with-gallium-drivers=$GALLIUM_DRIVERS
476 --with-vulkan-drivers=$VULKAN_DRIVERS
477 --disable-llvm-shared-libs
478 &&
479 make && eval $MAKE_CHECK_COMMAND;
480 fi
481
482 - if test "x$BUILD" = xscons; then
483 scons $SCONS_TARGET && eval $SCONS_CHECK_COMMAND;
484 fi
485
486 - |
487 if test "x$BUILD" = xmeson; then
488 if test -n "$LLVM_CONFIG"; then
489 # We need to control the version of llvm-config we're using, so we'll
490 # generate a native file to do so. This requires meson >=0.49
491 #
492 echo -e "[binaries]\nllvm-config = '`which $LLVM_CONFIG`'" > native.file
493
494 $LLVM_CONFIG --version
495 else
496 : > native.file
497 fi
498
499 export CFLAGS="$CFLAGS -isystem`pwd`"
500 meson _build \
501 --native-file=native.file \
502 -Dbuild-tests=true \
503 -Dlibunwind=${UNWIND} \
504 ${DRI_LOADERS} \
505 -Ddri-drivers=${DRI_DRIVERS:-[]} \
506 ${GALLIUM_ST} \
507 -Dgallium-drivers=${GALLIUM_DRIVERS:-[]} \
508 -Dvulkan-drivers=${VULKAN_DRIVERS:-[]}
509 meson configure _build
510 ninja -C _build
511 ninja -C _build test
512 fi