• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
15.templates_sha: &template_sha b61a03cabbf308e81289f7aaaf0b5a80a34ffb99 # see https://docs.gitlab.com/ee/ci/yaml/#includefile
16
17include:
18  - project: 'freedesktop/ci-templates'
19    ref: *template_sha
20    file:
21    - '/templates/debian.yml'
22    - '/templates/freebsd.yml'
23    - '/templates/ci-fairy.yml'
24
25variables:
26  FDO_UPSTREAM_REPO: mesa/drm
27  FDO_REPO_SUFFIX: "$BUILD_OS/$BUILD_ARCH"
28
29stages:
30  - "Base container"
31  - "Build"
32
33.ci-rules:
34  rules:
35    - when: on_success
36
37# CONTAINERS
38
39.os-debian:
40  variables:
41    BUILD_OS: debian
42    FDO_DISTRIBUTION_VERSION: bookworm
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    # bump this tag every time you change something which requires rebuilding the
45    # base image
46    FDO_DISTRIBUTION_TAG: "2024-06-25.0"
47
48.debian-x86_64:
49  extends:
50    - .os-debian
51  variables:
52    BUILD_ARCH: "x86-64"
53
54.debian-aarch64:
55  extends:
56    - .os-debian
57  variables:
58    BUILD_ARCH: "aarch64"
59
60.debian-armv7:
61  extends:
62    - .os-debian
63  variables:
64    BUILD_ARCH: "armv7"
65
66.os-freebsd:
67  variables:
68    BUILD_OS: freebsd
69    FDO_DISTRIBUTION_VERSION: "14.1"
70    FDO_DISTRIBUTION_PACKAGES: 'meson ninja pkgconf libpciaccess py39-docutils cairo'
71    # bump this tag every time you change something which requires rebuilding the
72    # base image
73    FDO_DISTRIBUTION_TAG: "2026-26-25.0"
74
75.freebsd-x86_64:
76  extends:
77    - .os-freebsd
78  variables:
79    BUILD_ARCH: "x86_64"
80
81# Build our base container image, which contains the core distribution, the
82# toolchain, and all our build dependencies. This will be reused in the build
83# stage.
84x86_64-debian-container_prep:
85  extends:
86    - .ci-rules
87    - .debian-x86_64
88    - .fdo.container-build@debian
89  stage: "Base container"
90  variables:
91    GIT_STRATEGY: none
92
93aarch64-debian-container_prep:
94  extends:
95    - .ci-rules
96    - .debian-aarch64
97    - .fdo.container-build@debian
98  tags:
99    - aarch64
100  stage: "Base container"
101  variables:
102    GIT_STRATEGY: none
103
104armv7-debian-container_prep:
105  extends:
106    - .ci-rules
107    - .debian-armv7
108    - .fdo.container-build@debian
109  tags:
110    - aarch64
111  stage: "Base container"
112  variables:
113    GIT_STRATEGY: none
114    FDO_BASE_IMAGE: "arm32v7/debian:$FDO_DISTRIBUTION_VERSION"
115
116x86_64-freebsd-container_prep:
117  extends:
118    - .ci-rules
119    - .freebsd-x86_64
120    - .fdo.qemu-build@freebsd@x86_64
121  stage: "Base container"
122  variables:
123    GIT_STRATEGY: none
124
125# Core build environment.
126.build-env:
127  variables:
128    MESON_BUILD_TYPE: "-Dbuildtype=debug -Doptimization=0 -Db_sanitize=address,undefined"
129
130# OS/architecture-specific variants
131.build-env-debian-x86_64:
132  extends:
133    - .fdo.suffixed-image@debian
134    - .debian-x86_64
135    - .build-env
136  needs:
137    - job: x86_64-debian-container_prep
138      artifacts: false
139
140.build-env-debian-aarch64:
141  extends:
142    - .fdo.suffixed-image@debian
143    - .debian-aarch64
144    - .build-env
145  variables:
146    # At least with the versions we have, the LSan runtime makes fork unusably
147    # slow on AArch64, which is bad news since the test suite decides to fork
148    # for every single subtest. For now, in order to get AArch64 builds and
149    # tests into CI, just assume that we're not going to leak any more on
150    # AArch64 than we would on ARMv7 or x86-64.
151    ASAN_OPTIONS: "detect_leaks=0"
152  tags:
153    - aarch64
154  needs:
155    - job: aarch64-debian-container_prep
156      artifacts: false
157
158.build-env-debian-armv7:
159  extends:
160    - .fdo.suffixed-image@debian
161    - .debian-armv7
162    - .build-env
163  tags:
164    - aarch64
165  needs:
166    - job: armv7-debian-container_prep
167      artifacts: false
168
169.build-env-freebsd-x86_64:
170  variables:
171    # Compiling with ASan+UBSan appears to trigger an infinite loop in the
172    # compiler shipped with FreeBSD 13.0, so we only use UBSan here.
173    # Additionally, sanitizers can't be used with b_lundef on FreeBSD.
174    MESON_BUILD_TYPE: "-Dbuildtype=debug -Db_sanitize=undefined -Db_lundef=false"
175  extends:
176    - .fdo.suffixed-image@freebsd
177    - .freebsd-x86_64
178    - .build-env
179  needs:
180    - job: x86_64-freebsd-container_prep
181      artifacts: false
182
183# BUILD
184
185.do-build:
186  extends:
187    - .ci-rules
188  stage: "Build"
189  variables:
190    GIT_DEPTH: 10
191  script:
192    - meson build
193        -D amdgpu=true
194        -D cairo-tests=true
195        -D etnaviv=true
196        -D exynos=true
197        -D freedreno=true
198        -D freedreno-kgsl=true
199        -D intel=true
200        -D libkms=true
201        -D man-pages=true
202        -D nouveau=true
203        -D omap=true
204        -D radeon=true
205        -D tegra=true
206        -D udev=true
207    - ninja -C build
208    - ninja -C build test
209    - DESTDIR=$PWD/install ninja -C build install
210  artifacts:
211    when: on_failure
212    paths:
213      - build/meson-logs/*
214
215.do-build-qemu:
216  extends:
217    - .ci-rules
218  stage: "Build"
219  script:
220    # Start the VM and copy our workspace to the VM
221    - /app/vmctl start
222    - scp -r $PWD "vm:"
223    # The `set +e is needed to ensure that we always copy the meson logs back to
224    # the workspace to see details about the failed tests.
225    - |
226      set +e
227      /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"
228      set -ex
229      scp -r vm:$CI_PROJECT_NAME/build/meson-logs .
230      /app/vmctl exec "ninja -C $CI_PROJECT_NAME/build install"
231      mkdir -p $PREFIX && scp -r vm:$PREFIX/ $PREFIX/
232    # Finally, shut down the VM.
233    - /app/vmctl stop
234  artifacts:
235    when: on_failure
236    paths:
237      - build/meson-logs/*
238
239# Full build and test.
240x86_64-debian-build:
241  extends:
242    - .build-env-debian-x86_64
243    - .do-build
244
245aarch64-debian-build:
246  extends:
247    - .build-env-debian-aarch64
248    - .do-build
249
250armv7-debian-build:
251  extends:
252    - .build-env-debian-armv7
253    - .do-build
254
255# Daily build
256meson-arch-daily:
257  rules:
258    - if: '$SCHEDULE == "arch-daily"'
259      when: on_success
260    - when: never
261  image: archlinux/archlinux:base-devel
262  before_script:
263    - pacman -Syu --noconfirm --needed
264        cairo
265        cunit
266        libatomic_ops
267        libpciaccess
268        meson
269        valgrind
270        python-docutils
271  extends: .do-build
272
273x86_64-freebsd-build:
274  extends:
275    - .build-env-freebsd-x86_64
276    - .do-build-qemu
277