Eric Engestrom | c69c9c4 | 2019-09-25 22:54:59 +0100 | [diff] [blame] | 1 | # This is the tag of the docker image used for the build jobs. If the |
| 2 | # image doesn't exist yet, the containers stage generates it. |
| 3 | # |
| 4 | # In order to generate a new image, one should generally change the tag. |
| 5 | # While removing the image from the registry would also work, that's not |
| 6 | # recommended except for ephemeral images during development: Replacing |
| 7 | # an image after a significant amount of time might pull in newer |
| 8 | # versions of gcc/clang or other packages, which might break the build |
| 9 | # with older commits using the same tag. |
| 10 | # |
| 11 | # After merging a change resulting in generating a new image to the |
| 12 | # main repository, it's recommended to remove the image from the source |
| 13 | # repository's container registry, so that the image from the main |
| 14 | # repository's registry will be used there as well. |
Emmanuel Vadot | e722ba9 | 2021-11-09 21:26:24 +0100 | [diff] [blame] | 15 | .templates_sha: &template_sha 567700e483aabed992d0a4fea84994a0472deff6 # see https://docs.gitlab.com/ee/ci/yaml/#includefile |
Daniel Stone | 946fa21 | 2018-09-06 11:01:17 +0100 | [diff] [blame] | 16 | |
Eric Engestrom | c69c9c4 | 2019-09-25 22:54:59 +0100 | [diff] [blame] | 17 | include: |
Emmanuel Vadot | e722ba9 | 2021-11-09 21:26:24 +0100 | [diff] [blame] | 18 | - project: 'freedesktop/ci-templates' |
| 19 | ref: *template_sha |
| 20 | file: |
| 21 | - '/templates/debian.yml' |
Emmanuel Vadot | b40d0a7 | 2021-11-10 17:49:55 +0100 | [diff] [blame] | 22 | - '/templates/freebsd.yml' |
Emmanuel Vadot | e722ba9 | 2021-11-09 21:26:24 +0100 | [diff] [blame] | 23 | - '/templates/ci-fairy.yml' |
| 24 | |
| 25 | variables: |
| 26 | FDO_UPSTREAM_REPO: mesa/drm |
| 27 | FDO_REPO_SUFFIX: "$BUILD_OS/$BUILD_ARCH" |
Eric Engestrom | 7f7c28d | 2018-09-06 12:10:50 +0100 | [diff] [blame] | 28 | |
Eric Engestrom | c69c9c4 | 2019-09-25 22:54:59 +0100 | [diff] [blame] | 29 | stages: |
Emmanuel Vadot | e722ba9 | 2021-11-09 21:26:24 +0100 | [diff] [blame] | 30 | - "Base container" |
| 31 | - "Build" |
Eric Engestrom | c69c9c4 | 2019-09-25 22:54:59 +0100 | [diff] [blame] | 32 | |
Emmanuel Vadot | e722ba9 | 2021-11-09 21:26:24 +0100 | [diff] [blame] | 33 | .ci-rules: |
| 34 | rules: |
| 35 | - when: on_success |
Eric Engestrom | c69c9c4 | 2019-09-25 22:54:59 +0100 | [diff] [blame] | 36 | |
| 37 | # CONTAINERS |
| 38 | |
Emmanuel Vadot | e722ba9 | 2021-11-09 21:26:24 +0100 | [diff] [blame] | 39 | .os-debian: |
Eric Engestrom | c69c9c4 | 2019-09-25 22:54:59 +0100 | [diff] [blame] | 40 | variables: |
Emmanuel Vadot | e722ba9 | 2021-11-09 21:26:24 +0100 | [diff] [blame] | 41 | BUILD_OS: debian |
| 42 | FDO_DISTRIBUTION_VERSION: buster |
| 43 | FDO_DISTRIBUTION_PACKAGES: 'build-essential docbook-xsl libatomic-ops-dev libcairo2-dev libcunit1-dev libpciaccess-dev meson ninja-build pkg-config python3 python3-pip python3-wheel python3-setuptools python3-docutils valgrind' |
| 44 | FDO_DISTRIBUTION_EXEC: 'pip3 install meson==0.52.1' |
| 45 | # bump this tag every time you change something which requires rebuilding the |
| 46 | # base image |
| 47 | FDO_DISTRIBUTION_TAG: "2021-08-03.0" |
Eric Engestrom | c69c9c4 | 2019-09-25 22:54:59 +0100 | [diff] [blame] | 48 | |
Emmanuel Vadot | e722ba9 | 2021-11-09 21:26:24 +0100 | [diff] [blame] | 49 | .debian-x86_64: |
| 50 | extends: |
| 51 | - .os-debian |
| 52 | variables: |
| 53 | BUILD_ARCH: "x86-64" |
| 54 | |
| 55 | .debian-aarch64: |
| 56 | extends: |
| 57 | - .os-debian |
| 58 | variables: |
| 59 | BUILD_ARCH: "aarch64" |
| 60 | |
| 61 | .debian-armv7: |
| 62 | extends: |
| 63 | - .os-debian |
| 64 | variables: |
| 65 | BUILD_ARCH: "armv7" |
| 66 | |
Emmanuel Vadot | b40d0a7 | 2021-11-10 17:49:55 +0100 | [diff] [blame] | 67 | .os-freebsd: |
| 68 | variables: |
| 69 | BUILD_OS: freebsd |
| 70 | FDO_DISTRIBUTION_VERSION: "13.0" |
| 71 | FDO_DISTRIBUTION_PACKAGES: 'meson ninja pkgconf libpciaccess libpthread-stubs py38-docutils cairo' |
| 72 | # bump this tag every time you change something which requires rebuilding the |
| 73 | # base image |
| 74 | FDO_DISTRIBUTION_TAG: "2021-11-10.1" |
| 75 | |
| 76 | .freebsd-x86_64: |
| 77 | extends: |
| 78 | - .os-freebsd |
| 79 | variables: |
| 80 | BUILD_ARCH: "x86_64" |
| 81 | |
Emmanuel Vadot | e722ba9 | 2021-11-09 21:26:24 +0100 | [diff] [blame] | 82 | # Build our base container image, which contains the core distribution, the |
| 83 | # toolchain, and all our build dependencies. This will be reused in the build |
| 84 | # stage. |
| 85 | x86_64-debian-container_prep: |
| 86 | extends: |
| 87 | - .ci-rules |
| 88 | - .debian-x86_64 |
| 89 | - .fdo.container-build@debian |
| 90 | stage: "Base container" |
| 91 | variables: |
| 92 | GIT_STRATEGY: none |
| 93 | |
| 94 | aarch64-debian-container_prep: |
| 95 | extends: |
| 96 | - .ci-rules |
| 97 | - .debian-aarch64 |
| 98 | - .fdo.container-build@debian |
| 99 | tags: |
| 100 | - aarch64 |
| 101 | stage: "Base container" |
| 102 | variables: |
| 103 | GIT_STRATEGY: none |
| 104 | |
| 105 | armv7-debian-container_prep: |
| 106 | extends: |
| 107 | - .ci-rules |
| 108 | - .debian-armv7 |
| 109 | - .fdo.container-build@debian |
| 110 | tags: |
| 111 | - aarch64 |
| 112 | stage: "Base container" |
| 113 | variables: |
| 114 | GIT_STRATEGY: none |
| 115 | FDO_BASE_IMAGE: "arm32v7/debian:$FDO_DISTRIBUTION_VERSION" |
| 116 | |
Emmanuel Vadot | b40d0a7 | 2021-11-10 17:49:55 +0100 | [diff] [blame] | 117 | x86_64-freebsd-container_prep: |
| 118 | extends: |
| 119 | - .ci-rules |
| 120 | - .freebsd-x86_64 |
| 121 | - .fdo.qemu-build@freebsd@x86_64 |
| 122 | stage: "Base container" |
| 123 | variables: |
| 124 | GIT_STRATEGY: none |
| 125 | |
Emmanuel Vadot | e722ba9 | 2021-11-09 21:26:24 +0100 | [diff] [blame] | 126 | # Core build environment. |
| 127 | .build-env: |
| 128 | variables: |
| 129 | MESON_BUILD_TYPE: "-Dbuildtype=debug -Doptimization=0 -Db_sanitize=address,undefined" |
| 130 | |
| 131 | # OS/architecture-specific variants |
| 132 | .build-env-debian-x86_64: |
| 133 | extends: |
| 134 | - .fdo.suffixed-image@debian |
| 135 | - .debian-x86_64 |
| 136 | - .build-env |
| 137 | needs: |
| 138 | - job: x86_64-debian-container_prep |
| 139 | artifacts: false |
| 140 | |
| 141 | .build-env-debian-aarch64: |
| 142 | extends: |
| 143 | - .fdo.suffixed-image@debian |
| 144 | - .debian-aarch64 |
| 145 | - .build-env |
| 146 | variables: |
| 147 | # At least with the versions we have, the LSan runtime makes fork unusably |
| 148 | # slow on AArch64, which is bad news since the test suite decides to fork |
| 149 | # for every single subtest. For now, in order to get AArch64 builds and |
| 150 | # tests into CI, just assume that we're not going to leak any more on |
| 151 | # AArch64 than we would on ARMv7 or x86-64. |
| 152 | ASAN_OPTIONS: "detect_leaks=0" |
| 153 | tags: |
| 154 | - aarch64 |
| 155 | needs: |
| 156 | - job: aarch64-debian-container_prep |
| 157 | artifacts: false |
| 158 | |
| 159 | .build-env-debian-armv7: |
| 160 | extends: |
| 161 | - .fdo.suffixed-image@debian |
| 162 | - .debian-armv7 |
| 163 | - .build-env |
| 164 | tags: |
| 165 | - aarch64 |
| 166 | needs: |
| 167 | - job: armv7-debian-container_prep |
| 168 | artifacts: false |
Eric Engestrom | c69c9c4 | 2019-09-25 22:54:59 +0100 | [diff] [blame] | 169 | |
Emmanuel Vadot | b40d0a7 | 2021-11-10 17:49:55 +0100 | [diff] [blame] | 170 | .build-env-freebsd-x86_64: |
| 171 | variables: |
| 172 | # Compiling with ASan+UBSan appears to trigger an infinite loop in the |
| 173 | # compiler shipped with FreeBSD 13.0, so we only use UBSan here. |
| 174 | # Additionally, sanitizers can't be used with b_lundef on FreeBSD. |
| 175 | MESON_BUILD_TYPE: "-Dbuildtype=debug -Db_sanitize=undefined -Db_lundef=false" |
| 176 | extends: |
| 177 | - .fdo.suffixed-image@freebsd |
| 178 | - .freebsd-x86_64 |
| 179 | - .build-env |
| 180 | needs: |
| 181 | - job: x86_64-freebsd-container_prep |
| 182 | artifacts: false |
| 183 | |
Eric Engestrom | c69c9c4 | 2019-09-25 22:54:59 +0100 | [diff] [blame] | 184 | # BUILD |
| 185 | |
Emmanuel Vadot | e722ba9 | 2021-11-09 21:26:24 +0100 | [diff] [blame] | 186 | .do-build: |
| 187 | extends: |
| 188 | - .ci-rules |
| 189 | stage: "Build" |
Eric Engestrom | c69c9c4 | 2019-09-25 22:54:59 +0100 | [diff] [blame] | 190 | variables: |
| 191 | GIT_DEPTH: 10 |
| 192 | script: |
Eric Engestrom | 6d3f06f | 2019-12-17 22:29:11 +0000 | [diff] [blame] | 193 | - meson build |
Eric Engestrom | c69c9c4 | 2019-09-25 22:54:59 +0100 | [diff] [blame] | 194 | -D amdgpu=true |
| 195 | -D cairo-tests=true |
| 196 | -D etnaviv=true |
| 197 | -D exynos=true |
| 198 | -D freedreno=true |
| 199 | -D freedreno-kgsl=true |
| 200 | -D intel=true |
| 201 | -D libkms=true |
| 202 | -D man-pages=true |
| 203 | -D nouveau=true |
| 204 | -D omap=true |
| 205 | -D radeon=true |
| 206 | -D tegra=true |
| 207 | -D udev=true |
Eric Engestrom | 55be53d | 2019-10-20 23:06:56 +0100 | [diff] [blame] | 208 | -D valgrind=auto |
Eric Engestrom | c69c9c4 | 2019-09-25 22:54:59 +0100 | [diff] [blame] | 209 | -D vc4=true |
| 210 | -D vmwgfx=true |
Eric Engestrom | 6d3f06f | 2019-12-17 22:29:11 +0000 | [diff] [blame] | 211 | - ninja -C build |
| 212 | - ninja -C build test |
| 213 | - DESTDIR=$PWD/install ninja -C build install |
Eric Engestrom | c69c9c4 | 2019-09-25 22:54:59 +0100 | [diff] [blame] | 214 | artifacts: |
| 215 | when: on_failure |
| 216 | paths: |
Eric Engestrom | 6d3f06f | 2019-12-17 22:29:11 +0000 | [diff] [blame] | 217 | - build/meson-logs/* |
Eric Engestrom | 4a9030d | 2018-08-30 15:51:40 +0100 | [diff] [blame] | 218 | |
Emmanuel Vadot | b40d0a7 | 2021-11-10 17:49:55 +0100 | [diff] [blame] | 219 | .do-build-qemu: |
| 220 | extends: |
| 221 | - .ci-rules |
| 222 | stage: "Build" |
| 223 | script: |
| 224 | # Start the VM and copy our workspace to the VM |
| 225 | - /app/vmctl start |
| 226 | - scp -r $PWD "vm:" |
| 227 | # The `set +e is needed to ensure that we always copy the meson logs back to |
| 228 | # the workspace to see details about the failed tests. |
| 229 | - | |
| 230 | set +e |
| 231 | /app/vmctl exec "pkg info; cd $CI_PROJECT_NAME ; meson build -D amdgpu=true -D cairo-tests=true -D intel=true -D libkms=true -D man-pages=true -D nouveau=false -D radeon=true -D valgrind=auto && ninja -C build" |
| 232 | set -ex |
| 233 | scp -r vm:$CI_PROJECT_NAME/build/meson-logs . |
| 234 | /app/vmctl exec "ninja -C $CI_PROJECT_NAME/build install" |
| 235 | mkdir -p $PREFIX && scp -r vm:$PREFIX/ $PREFIX/ |
| 236 | # Finally, shut down the VM. |
| 237 | - /app/vmctl stop |
| 238 | artifacts: |
| 239 | when: on_failure |
| 240 | paths: |
| 241 | - build/meson-logs/* |
| 242 | |
Emmanuel Vadot | e722ba9 | 2021-11-09 21:26:24 +0100 | [diff] [blame] | 243 | # Full build and test. |
| 244 | x86_64-debian-build: |
Eric Engestrom | 1128fa1 | 2019-11-12 12:13:11 +0000 | [diff] [blame] | 245 | extends: |
Emmanuel Vadot | e722ba9 | 2021-11-09 21:26:24 +0100 | [diff] [blame] | 246 | - .build-env-debian-x86_64 |
| 247 | - .do-build |
Eric Engestrom | c69c9c4 | 2019-09-25 22:54:59 +0100 | [diff] [blame] | 248 | |
Emmanuel Vadot | e722ba9 | 2021-11-09 21:26:24 +0100 | [diff] [blame] | 249 | aarch64-debian-build: |
| 250 | extends: |
| 251 | - .build-env-debian-aarch64 |
| 252 | - .do-build |
Eric Engestrom | 202d10a | 2018-09-05 12:23:26 +0100 | [diff] [blame] | 253 | |
Emmanuel Vadot | e722ba9 | 2021-11-09 21:26:24 +0100 | [diff] [blame] | 254 | armv7-debian-build: |
| 255 | extends: |
| 256 | - .build-env-debian-armv7 |
| 257 | - .do-build |
Eric Engestrom | a39c34e | 2018-10-24 11:19:15 +0100 | [diff] [blame] | 258 | |
Emmanuel Vadot | e722ba9 | 2021-11-09 21:26:24 +0100 | [diff] [blame] | 259 | # Daily build |
Eric Engestrom | 1128fa1 | 2019-11-12 12:13:11 +0000 | [diff] [blame] | 260 | meson-arch-daily: |
| 261 | rules: |
| 262 | - if: '$SCHEDULE == "arch-daily"' |
| 263 | when: on_success |
| 264 | - when: never |
Eric Engestrom | bf08984 | 2021-04-29 10:15:11 +0200 | [diff] [blame] | 265 | image: archlinux/archlinux:base-devel |
Eric Engestrom | 1128fa1 | 2019-11-12 12:13:11 +0000 | [diff] [blame] | 266 | before_script: |
| 267 | - pacman -Syu --noconfirm --needed |
Eric Engestrom | 1128fa1 | 2019-11-12 12:13:11 +0000 | [diff] [blame] | 268 | cairo |
| 269 | cunit |
Eric Engestrom | 1128fa1 | 2019-11-12 12:13:11 +0000 | [diff] [blame] | 270 | libatomic_ops |
| 271 | libpciaccess |
Eric Engestrom | 1128fa1 | 2019-11-12 12:13:11 +0000 | [diff] [blame] | 272 | meson |
| 273 | valgrind |
Simon Ser | 05b0a95 | 2020-06-03 11:58:07 +0200 | [diff] [blame] | 274 | python-docutils |
Emmanuel Vadot | e722ba9 | 2021-11-09 21:26:24 +0100 | [diff] [blame] | 275 | extends: .do-build |
Emmanuel Vadot | b40d0a7 | 2021-11-10 17:49:55 +0100 | [diff] [blame] | 276 | |
| 277 | x86_64-freebsd-build: |
| 278 | extends: |
| 279 | - .build-env-freebsd-x86_64 |
| 280 | - .do-build-qemu |