455506d2972a0b33da08da5def7e020c08e524ce
[mesa.git] / .gitlab-ci / container / x86_test-vk.sh
1 #!/bin/bash
2
3 set -e
4 set -o xtrace
5
6 export DEBIAN_FRONTEND=noninteractive
7
8 apt-get install -y \
9 ca-certificates \
10 gnupg
11
12 # Upstream LLVM package repository
13 apt-key add .gitlab-ci/container/llvm-snapshot.gpg.key
14 echo "deb https://apt.llvm.org/buster/ llvm-toolchain-buster-9 main" >/etc/apt/sources.list.d/llvm9.list
15
16 sed -i -e 's/http:\/\/deb/https:\/\/deb/g' /etc/apt/sources.list
17 echo 'deb https://deb.debian.org/debian testing main' >/etc/apt/sources.list.d/testing.list
18
19 apt-get update
20
21 # Don't use newer packages from testing by default
22 cat >/etc/apt/preferences <<EOF
23 Package: *
24 Pin: release a=testing
25 Pin-Priority: 100
26 EOF
27
28 apt-get dist-upgrade -y
29
30 apt-get install -y --no-remove \
31 ccache \
32 cmake \
33 g++ \
34 gcc \
35 git \
36 git-lfs \
37 libexpat1 \
38 libgbm-dev \
39 libgles2-mesa-dev \
40 libllvm9 \
41 liblz4-1 \
42 liblz4-dev \
43 libpng-dev \
44 libpng16-16 \
45 libvulkan-dev \
46 libvulkan1 \
47 libwayland-client0 \
48 libwayland-server0 \
49 libxcb-ewmh-dev \
50 libxcb-ewmh2 \
51 libxcb-keysyms1 \
52 libxcb-keysyms1-dev \
53 libxcb-randr0 \
54 libxcb-xfixes0 \
55 libxkbcommon-dev \
56 libxkbcommon0 \
57 libxrandr-dev \
58 libxrandr2 \
59 libxrender-dev \
60 libxrender1 \
61 meson \
62 p7zip \
63 pkg-config \
64 python \
65 python3-distutils \
66 python3-pil \
67 python3-requests \
68 python3-yaml \
69 vulkan-tools \
70 wget \
71 xauth \
72 xvfb
73
74 # We need multiarch for Wine
75 dpkg --add-architecture i386
76
77 apt-get update
78
79 apt-get install -y --no-remove \
80 wine \
81 wine32 \
82 wine64
83
84 # Install packages we need from Debian testing last, to avoid pulling in more
85 apt-get install -y -t testing \
86 libc6-dev
87
88
89 ############### Set up Wine env variables
90
91 export WINEDEBUG="-all"
92 export WINEPREFIX="/dxvk-wine64"
93
94 ############### Install DXVK
95
96 DXVK_VERSION="1.6"
97
98 # We don't want crash dialogs
99 cat >crashdialog.reg <<EOF
100 Windows Registry Editor Version 5.00
101
102 [HKEY_CURRENT_USER\Software\Wine\WineDbg]
103 "ShowCrashDialog"=dword:00000000
104
105 EOF
106
107 # Set the wine prefix and disable the crash dialog
108 wine regedit crashdialog.reg
109 rm crashdialog.reg
110
111 # DXVK's setup often fails with:
112 # "${WINEPREFIX}: Not a valid wine prefix."
113 # and that is just spit because of checking the existance of the
114 # system.reg file, which fails.
115 # Just giving it a bit more of time for it to be created solves the
116 # problem ...
117 test -f "${WINEPREFIX}/system.reg" || sleep 2
118
119 wget "https://github.com/doitsujin/dxvk/releases/download/v${DXVK_VERSION}/dxvk-${DXVK_VERSION}.tar.gz"
120 tar xzpf dxvk-"${DXVK_VERSION}".tar.gz
121 dxvk-"${DXVK_VERSION}"/setup_dxvk.sh install
122 rm -rf dxvk-"${DXVK_VERSION}"
123 rm dxvk-"${DXVK_VERSION}".tar.gz
124
125 ############### Install Windows' apitrace binaries
126
127 APITRACE_VERSION="9.0"
128 APITRACE_VERSION_DATE="20191126"
129
130 wget "https://github.com/apitrace/apitrace/releases/download/${APITRACE_VERSION}/apitrace-${APITRACE_VERSION}.${APITRACE_VERSION_DATE}-win64.7z"
131 7zr x "apitrace-${APITRACE_VERSION}.${APITRACE_VERSION_DATE}-win64.7z" \
132 "apitrace-${APITRACE_VERSION}.${APITRACE_VERSION_DATE}-win64/bin/apitrace.exe" \
133 "apitrace-${APITRACE_VERSION}.${APITRACE_VERSION_DATE}-win64/bin/d3dretrace.exe"
134 mv "apitrace-${APITRACE_VERSION}.${APITRACE_VERSION_DATE}-win64" /apitrace-msvc-win64
135 rm "apitrace-${APITRACE_VERSION}.${APITRACE_VERSION_DATE}-win64.7z"
136
137 # Add the apitrace path to the registry
138 wine \
139 reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment" \
140 /v Path \
141 /t REG_EXPAND_SZ \
142 /d "C:\windows\system32;C:\windows;C:\windows\system32\wbem;Z:\apitrace-msvc-win64\bin" \
143 /f
144
145 ############### Building ...
146
147 . .gitlab-ci/container/container_pre_build.sh
148
149 ############### Build dEQP runner
150
151 . .gitlab-ci/build-cts-runner.sh
152
153 ############### Build Fossilize
154
155 . .gitlab-ci/build-fossilize.sh
156
157 ############### Build dEQP VK
158
159 . .gitlab-ci/build-deqp-vk.sh
160
161 ############### Build gfxreconstruct
162
163 . .gitlab-ci/build-gfxreconstruct.sh
164
165 ############### Build VulkanTools
166
167 . .gitlab-ci/build-vulkantools.sh
168
169 ############### Uninstall the build software
170
171 ccache --show-stats
172
173 apt-get purge -y \
174 ccache \
175 cmake \
176 g++ \
177 gcc \
178 gnupg \
179 libgbm-dev \
180 libgles2-mesa-dev \
181 liblz4-dev \
182 libpng-dev \
183 libvulkan-dev \
184 libxcb-ewmh-dev \
185 libxcb-keysyms1-dev \
186 libxkbcommon-dev \
187 libxrandr-dev \
188 libxrender-dev \
189 meson \
190 p7zip \
191 pkg-config \
192 wget
193
194 apt-get autoremove -y --purge