ac: fix the return value in cull_bbox when bbox culling is disabled
[mesa.git] / .gitlab-ci / container / lava_arm.sh
1 #!/bin/bash
2
3 set -e
4 set -o xtrace
5
6 ############### Install packages for building
7 dpkg --add-architecture ${DEBIAN_ARCH}
8 echo 'deb-src https://deb.debian.org/debian testing main' > /etc/apt/sources.list.d/deb-src.list
9 apt-get update
10 apt-get -y install ca-certificates
11 apt-get -y install --no-install-recommends \
12 crossbuild-essential-${DEBIAN_ARCH} \
13 meson \
14 g++ \
15 git \
16 ccache \
17 pkg-config \
18 python3-setuptools \
19 python-mako \
20 python3-mako \
21 bison \
22 flex \
23 gettext \
24 cmake \
25 bc \
26 libssl-dev \
27 lavacli \
28 csvkit \
29 curl \
30 unzip \
31 wget \
32 debootstrap \
33 procps \
34 qemu-user-static \
35 cpio \
36 clang-8 \
37 llvm-8 \
38 libclang-8-dev \
39 llvm-8-dev \
40 gdc-9 \
41 lld-8 \
42 nasm \
43 libegl1-mesa-dev \
44 \
45 libdrm-dev:${DEBIAN_ARCH} \
46 libx11-dev:${DEBIAN_ARCH} \
47 libxxf86vm-dev:${DEBIAN_ARCH} \
48 libexpat1-dev:${DEBIAN_ARCH} \
49 libsensors-dev:${DEBIAN_ARCH} \
50 libxfixes-dev:${DEBIAN_ARCH} \
51 libxdamage-dev:${DEBIAN_ARCH} \
52 libxext-dev:${DEBIAN_ARCH} \
53 x11proto-dev:${DEBIAN_ARCH} \
54 libx11-xcb-dev:${DEBIAN_ARCH} \
55 libxcb-dri2-0-dev:${DEBIAN_ARCH} \
56 libxcb-glx0-dev:${DEBIAN_ARCH} \
57 libxcb-xfixes0-dev:${DEBIAN_ARCH} \
58 libxcb-dri3-dev:${DEBIAN_ARCH} \
59 libxcb-present-dev:${DEBIAN_ARCH} \
60 libxcb-randr0-dev:${DEBIAN_ARCH} \
61 libxcb-sync-dev:${DEBIAN_ARCH} \
62 libxrandr-dev:${DEBIAN_ARCH} \
63 libxshmfence-dev:${DEBIAN_ARCH} \
64 libelf-dev:${DEBIAN_ARCH} \
65 zlib1g-dev:${DEBIAN_ARCH} \
66 libglvnd-core-dev:${DEBIAN_ARCH} \
67 libgles2-mesa-dev:${DEBIAN_ARCH} \
68 libegl1-mesa-dev:${DEBIAN_ARCH} \
69 libpng-dev:${DEBIAN_ARCH}
70
71 ############### Cross-build dEQP
72 mkdir -p /artifacts/rootfs/deqp
73
74 git config --global user.email "mesa@example.com"
75 git config --global user.name "Mesa CI"
76 # XXX: Use --depth 1 once we can drop the cherry-picks.
77 git clone \
78 https://github.com/KhronosGroup/VK-GL-CTS.git \
79 -b opengl-es-cts-3.2.5.1 \
80 /VK-GL-CTS
81 cd /VK-GL-CTS
82 # Fix surfaceless build
83 git cherry-pick -x 22f41e5e321c6dcd8569c4dad91bce89f06b3670
84 git cherry-pick -x 1daa8dff73161ea60ead965bd6c9f2a0a2165648
85
86 # surfaceless links against libkms and such despite not using it.
87 sed -i '/gbm/d' targets/surfaceless/surfaceless.cmake
88 sed -i '/libkms/d' targets/surfaceless/surfaceless.cmake
89 sed -i '/libgbm/d' targets/surfaceless/surfaceless.cmake
90
91 python3 external/fetch_sources.py
92
93 cd /artifacts/rootfs/deqp
94 cmake -G Ninja \
95 -DDEQP_TARGET=surfaceless \
96 -DCMAKE_BUILD_TYPE=Release \
97 -DCMAKE_C_COMPILER=${GCC_ARCH}-gcc \
98 -DCMAKE_CXX_COMPILER=${GCC_ARCH}-g++ \
99 /VK-GL-CTS
100 ninja
101 rm -rf /artifacts/rootfs/deqp/external
102 rm -rf /artifacts/rootfs/deqp/modules/gles31
103 rm -rf /artifacts/rootfs/deqp/modules/internal
104 rm -rf /artifacts/rootfs/deqp/executor
105 rm -rf /artifacts/rootfs/deqp/execserver
106 rm -rf /artifacts/rootfs/deqp/modules/egl
107 rm -rf /artifacts/rootfs/deqp/framework
108 find . -name CMakeFiles | xargs rm -rf
109 find . -name lib\*.a | xargs rm -rf
110 du -sh *
111 rm -rf /VK-GL-CTS
112
113
114 ############### Cross-build Volt dEQP runner
115 mkdir -p /battery
116 cd /battery
117 wget https://github.com/VoltLang/Battery/releases/download/v0.1.23/battery-0.1.23-x86_64-linux.tar.gz
118 tar xzvf battery-0.1.23-x86_64-linux.tar.gz
119 rm battery-0.1.23-x86_64-linux.tar.gz
120 mv battery /usr/local/bin
121 rm -rf /battery
122
123 mkdir -p /volt
124 cd /volt
125 mkdir -p Watt Volta dEQP
126 wget -qO- https://github.com/VoltLang/Watt/archive/v0.1.3.tar.gz | tar -xz --strip-components=1 -C ./Watt
127 wget -qO- https://github.com/VoltLang/Volta/archive/v0.1.3.tar.gz | tar -xz --strip-components=1 -C ./Volta
128 wget -qO- https://github.com/Wallbraker/dEQP/archive/v0.1.4.tar.gz | tar -xz --strip-components=1 -C ./dEQP
129 battery config --release --lto Volta Watt
130 battery build
131 battery config --arch ${VOLT_ARCH} --cmd-volta Volta/volta Volta/rt Watt dEQP
132 battery build
133 rm /usr/local/bin/battery
134 cp dEQP/deqp /artifacts/rootfs/deqp/deqp-volt
135 rm -rf /volt
136
137
138 ############### Remove LLVM now, so the container image is smaller
139 apt-get -y remove \*llvm\*
140
141
142 ############### Cross-build kernel
143 KERNEL_URL="https://gitlab.freedesktop.org/tomeu/linux/-/archive/panfrost-veyron-fix/linux-panfrost-veyron-fix.tar.gz"
144 export ARCH=${KERNEL_ARCH}
145 export CROSS_COMPILE="${GCC_ARCH}-"
146
147 mkdir -p /kernel
148 wget -qO- ${KERNEL_URL} | tar -xz --strip-components=1 -C /kernel
149 cd /kernel
150 ./scripts/kconfig/merge_config.sh ${DEFCONFIG} /tmp/clone/.gitlab-ci/${KERNEL_ARCH}.config
151 make -j12 ${KERNEL_IMAGE_NAME} dtbs
152 cp arch/${KERNEL_ARCH}/boot/${KERNEL_IMAGE_NAME} /artifacts/.
153 cp ${DEVICE_TREES} /artifacts/.
154 rm -rf /kernel
155
156
157 ############### Create rootfs
158 cp /tmp/clone/.gitlab-ci/create-rootfs.sh /artifacts/rootfs/.
159 mkdir -p /artifacts/rootfs/bin
160 cp /usr/bin/qemu-aarch64-static /artifacts/rootfs/bin
161 cp /usr/bin/qemu-arm-static /artifacts/rootfs/bin
162
163 set +e
164 debootstrap --variant=minbase --arch=${DEBIAN_ARCH} testing /artifacts/rootfs/ http://deb.debian.org/debian
165 cat /artifacts/rootfs/debootstrap/debootstrap.log
166 set -e
167 chroot /artifacts/rootfs sh /create-rootfs.sh
168
169 rm /artifacts/rootfs/bin/qemu-arm-static
170 rm /artifacts/rootfs/bin/qemu-aarch64-static
171 rm /artifacts/rootfs/create-rootfs.sh