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