gitlab-ci: x86_test-base image as common base for x86_test-gl/vk
[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 # Ephemeral packages (installed for this script and removed again at the end)
9 STABLE_EPHEMERAL=" \
10 ccache \
11 cmake \
12 g++ \
13 gcc \
14 libgbm-dev \
15 libgles2-mesa-dev \
16 liblz4-dev \
17 libpng-dev \
18 libvulkan-dev \
19 libxcb-ewmh-dev \
20 libxcb-keysyms1-dev \
21 libxkbcommon-dev \
22 libxrandr-dev \
23 libxrender-dev \
24 meson \
25 p7zip \
26 pkg-config \
27 python3-distutils \
28 wget \
29 "
30
31 TESTING_EPHEMERAL=" \
32 libc6-dev \
33 "
34
35 apt-get update
36
37 apt-get install -y --no-remove \
38 $STABLE_EPHEMERAL
39
40 # We need multiarch for Wine
41 dpkg --add-architecture i386
42
43 apt-get update
44
45 apt-get install -y --no-remove \
46 wine \
47 wine32 \
48 wine64
49
50 # Install packages we need from Debian testing last, to avoid pulling in more
51 apt-get install -y -t testing \
52 $TESTING_EPHEMERAL
53
54
55 ############### Set up Wine env variables
56
57 export WINEDEBUG="-all"
58 export WINEPREFIX="/dxvk-wine64"
59
60 ############### Install DXVK
61
62 DXVK_VERSION="1.6"
63
64 # We don't want crash dialogs
65 cat >crashdialog.reg <<EOF
66 Windows Registry Editor Version 5.00
67
68 [HKEY_CURRENT_USER\Software\Wine\WineDbg]
69 "ShowCrashDialog"=dword:00000000
70
71 EOF
72
73 # Set the wine prefix and disable the crash dialog
74 wine regedit crashdialog.reg
75 rm crashdialog.reg
76
77 # DXVK's setup often fails with:
78 # "${WINEPREFIX}: Not a valid wine prefix."
79 # and that is just spit because of checking the existance of the
80 # system.reg file, which fails.
81 # Just giving it a bit more of time for it to be created solves the
82 # problem ...
83 test -f "${WINEPREFIX}/system.reg" || sleep 2
84
85 wget "https://github.com/doitsujin/dxvk/releases/download/v${DXVK_VERSION}/dxvk-${DXVK_VERSION}.tar.gz"
86 tar xzpf dxvk-"${DXVK_VERSION}".tar.gz
87 dxvk-"${DXVK_VERSION}"/setup_dxvk.sh install
88 rm -rf dxvk-"${DXVK_VERSION}"
89 rm dxvk-"${DXVK_VERSION}".tar.gz
90
91 ############### Install Windows' apitrace binaries
92
93 APITRACE_VERSION="9.0"
94 APITRACE_VERSION_DATE="20191126"
95
96 wget "https://github.com/apitrace/apitrace/releases/download/${APITRACE_VERSION}/apitrace-${APITRACE_VERSION}.${APITRACE_VERSION_DATE}-win64.7z"
97 7zr x "apitrace-${APITRACE_VERSION}.${APITRACE_VERSION_DATE}-win64.7z" \
98 "apitrace-${APITRACE_VERSION}.${APITRACE_VERSION_DATE}-win64/bin/apitrace.exe" \
99 "apitrace-${APITRACE_VERSION}.${APITRACE_VERSION_DATE}-win64/bin/d3dretrace.exe"
100 mv "apitrace-${APITRACE_VERSION}.${APITRACE_VERSION_DATE}-win64" /apitrace-msvc-win64
101 rm "apitrace-${APITRACE_VERSION}.${APITRACE_VERSION_DATE}-win64.7z"
102
103 # Add the apitrace path to the registry
104 wine \
105 reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment" \
106 /v Path \
107 /t REG_EXPAND_SZ \
108 /d "C:\windows\system32;C:\windows;C:\windows\system32\wbem;Z:\apitrace-msvc-win64\bin" \
109 /f
110
111 ############### Building ...
112
113 . .gitlab-ci/container/container_pre_build.sh
114
115 ############### Build dEQP runner
116
117 . .gitlab-ci/build-cts-runner.sh
118
119 ############### Build Fossilize
120
121 . .gitlab-ci/build-fossilize.sh
122
123 ############### Build dEQP VK
124
125 . .gitlab-ci/build-deqp-vk.sh
126
127 ############### Build gfxreconstruct
128
129 . .gitlab-ci/build-gfxreconstruct.sh
130
131 ############### Build VulkanTools
132
133 . .gitlab-ci/build-vulkantools.sh
134
135 ############### Uninstall the build software
136
137 ccache --show-stats
138
139 apt-get purge -y \
140 $STABLE_EPHEMERAL \
141 $TESTING_EPHEMERAL
142
143 apt-get autoremove -y --purge