From 67fb5a94b6fe29ea44bb6e98719c982ad2901901 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 11 Dec 2024 15:36:00 +0000 Subject: [PATCH 1/5] ci: Enable -Dintrospection for dist builds This means that the documentation can actually be generated, which was broken before. Building the documentation requires `enable_gir`. Signed-off-by: Philip Withnall --- .gitlab-ci.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index aac2d53a3..bc63d51d6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -965,17 +965,25 @@ pages: - public dist-job: + extends: + - .build-gobject-introspection + - .build-linux + - .with-git image: "${FEDORA_IMAGE}" stage: build + before_script: + - !reference [".build-linux", "before_script"] + - !reference [".with-git", "before_script"] + - !reference [".build-gobject-introspection", "before_script"] only: - tags script: - # Ignore extra git security checks as we don't care in CI. - - git config --global --add safe.directory "${PWD}" - - git submodule update --init - - for m in $(git submodule foreach -q 'echo $path'); do git config --global --add safe.directory "${PWD}/${m}"; done - - meson subprojects download - - meson setup ${MESON_COMMON_OPTIONS} --buildtype release -Ddocumentation=true -Dman-pages=enabled _build + - meson setup ${MESON_COMMON_OPTIONS} + --buildtype release + -Ddocumentation=true + -Dintrospection=enabled + -Dman-pages=enabled + _build - meson dist -C _build # Compile again to build the docs - meson compile -C _build From e9670d3c3c4637099dc0f0c91cd5cb526e48ad63 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 11 Dec 2024 15:36:50 +0000 Subject: [PATCH 2/5] docs: Warn if building documentation without enable_gir MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If `-Ddocumentation=true` is specified without `-Dintrospection=enabled`, warn the user. They might expect the documentation to be built, but it won’t. Signed-off-by: Philip Withnall --- docs/reference/meson.build | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/reference/meson.build b/docs/reference/meson.build index 699504b0a..b99c69ee4 100644 --- a/docs/reference/meson.build +++ b/docs/reference/meson.build @@ -15,6 +15,8 @@ if get_option('documentation') and enable_gir '--fatal-warnings', '--add-include-path=@0@'.format(meson.current_build_dir() / '../../girepository/introspection'), ] +elif get_option('documentation') + warning('Full documentation cannot be built without -Dintrospection=enabled') endif docs_dir = glib_datadir / 'doc' From cc627ea0df5e05a17db42b9f7b5a016bc1c8a288 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 11 Dec 2024 15:37:52 +0000 Subject: [PATCH 3/5] ci: Clear dependencies for dist-job MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise it never executes, because it’s waiting patiently for zero dependencies to complete. 🤦 Signed-off-by: Philip Withnall --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bc63d51d6..665d6527b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -971,6 +971,7 @@ dist-job: - .with-git image: "${FEDORA_IMAGE}" stage: build + needs: [] before_script: - !reference [".build-linux", "before_script"] - !reference [".with-git", "before_script"] From fe1ff50e5c438d075df3a92a36d668c47e097f27 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 11 Dec 2024 15:38:46 +0000 Subject: [PATCH 4/5] ci: Run dist-job on a schedule as well as on tags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will allow us to test that it actually still works, which is important for being able to make releases, because once we push a tag, there’s no going back. The release can’t happen if `dist-job` then fails on that tag. Sigh. Signed-off-by: Philip Withnall --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 665d6527b..2e1aff8fc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -977,6 +977,7 @@ dist-job: - !reference [".with-git", "before_script"] - !reference [".build-gobject-introspection", "before_script"] only: + - schedules - tags script: - meson setup ${MESON_COMMON_OPTIONS} From f582a0dd9c010b5f93ca8412ef1d373f8c0825f6 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 11 Dec 2024 15:39:40 +0000 Subject: [PATCH 5/5] ci: Fix output paths for docs tarballs in dist-job MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise they’re not picked up as artifacts, and hence are basically lost. Signed-off-by: Philip Withnall --- .gitlab-ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2e1aff8fc..6cf3a970d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -989,11 +989,11 @@ dist-job: - meson dist -C _build # Compile again to build the docs - meson compile -C _build - - tar -c -J -f "glib-docs-${CI_COMMIT_TAG}.tar.xz" -C _build/docs/reference/glib glib-2.0 - - tar -c -J -f "gmodule-docs-${CI_COMMIT_TAG}.tar.xz" -C _build/docs/reference/gmodule gmodule-2.0 - - tar -c -J -f "gobject-docs-${CI_COMMIT_TAG}.tar.xz" -C _build/docs/reference/gobject gobject-2.0 - - tar -c -J -f "gio-docs-${CI_COMMIT_TAG}.tar.xz" -C _build/docs/reference/gio gio-2.0 - - tar -c -J -f "girepository-docs-${CI_COMMIT_TAG}.tar.xz" -C _build/docs/reference/girepository girepository-2.0 + - tar -c -J -f "_build/glib-docs-${CI_COMMIT_TAG}.tar.xz" -C _build/docs/reference/glib glib-2.0 + - tar -c -J -f "_build/gmodule-docs-${CI_COMMIT_TAG}.tar.xz" -C _build/docs/reference/gmodule gmodule-2.0 + - tar -c -J -f "_build/gobject-docs-${CI_COMMIT_TAG}.tar.xz" -C _build/docs/reference/gobject gobject-2.0 + - tar -c -J -f "_build/gio-docs-${CI_COMMIT_TAG}.tar.xz" -C _build/docs/reference/gio gio-2.0 + - tar -c -J -f "_build/girepository-docs-${CI_COMMIT_TAG}.tar.xz" -C _build/docs/reference/girepository girepository-2.0 artifacts: paths: - "${CI_PROJECT_DIR}/_build/glib-docs-${CI_COMMIT_TAG}.tar.xz"