From 153e8a0c9219665f93f0a1e7ccd5200eed021fe4 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 29 Jan 2020 10:34:41 +0100 Subject: [PATCH 01/19] ci: Use release builds for Flatpak bundles --- .gitlab-ci/flatpak-build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci/flatpak-build.sh b/.gitlab-ci/flatpak-build.sh index f01583458f..7b9464d130 100644 --- a/.gitlab-ci/flatpak-build.sh +++ b/.gitlab-ci/flatpak-build.sh @@ -17,7 +17,7 @@ flatpak-builder \ meson \ --prefix /app \ --libdir /app/lib \ - --buildtype debug \ + --buildtype release \ -Dx11-backend=true \ -Dwayland-backend=true \ -Dprint-backends=file \ From 56f9cdd99d7f18b0bad1d491108571e5307d6836 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 29 Jan 2020 10:35:10 +0100 Subject: [PATCH 02/19] ci: Refactor the CI pipeline We should have a single job for building both static and shared versions of GTK. On the other hand, having a separate job for the release build would be a plus. Additionally, we shouldn't use an opaque script to build GTK; the only step in the process that requires hand-holding is running the tests suites under Xvfb, and having the build options visible from the YAML file gives us a better idea of what kind of build we're running. --- .gitlab-ci.yml | 46 +++++++++++++++++--- .gitlab-ci/{Dockerfile => fedora.Dockerfile} | 1 + .gitlab-ci/run-tests.sh | 11 +++++ 3 files changed, 53 insertions(+), 5 deletions(-) rename .gitlab-ci/{Dockerfile => fedora.Dockerfile} (99%) create mode 100755 .gitlab-ci/run-tests.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2c3b35b62e..7f5ef322da 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,11 +12,38 @@ stages: - subprojects/libepoxy/ - subprojects/pango/ -fedora-x86_64: &fedora-x86_64-defaults +# Common variables +variables: + COMMON_MESON_FLAGS: "--fatal-meson-warnings --werror" + MESON_TEST_TIMEOUT_MULTIPLIER: 2 + G_MESSAGES_DEBUG: all + +fedora-x86_64: image: registry.gitlab.gnome.org/gnome/gtk/master:v10 stage: build + variables: + EXTRA_MESON_FLAGS: "--buildtype=debug --default-library=both" script: - - bash -x ./.gitlab-ci/test-docker.sh + - meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} + -Dx11-backend=true + -Dwayland-backend=true + -Dbroadway-backend=true + -Dvulkan=yes + -Dprofiler=true + _build + - ninja -C _build + - .gitlab-ci/run-tests.sh _build + - .gitlab-ci/meson-junit-report.py + --project-name=gtk + --job-id="${CI_JOB_NAME}" + --output=_build/report.xml + _build/meson-logs/testlog.json + - .gitlab-ci/meson-html-report.py + --project-name=gtk + --job-id="${CI_JOB_NAME}" + --reftest-output-dir="_build/testsuite/reftests/output" + --output=_build/report.html + _build/meson-logs/testlog.json artifacts: when: always reports: @@ -34,10 +61,19 @@ fedora-x86_64: &fedora-x86_64-defaults key: "$CI_JOB_NAME" <<: *cache-paths -fedora-x86_64-staticlibs: +fedora-x86_64-release: + image: registry.gitlab.gnome.org/gnome/gtk/master:v10 + stage: build variables: - EXTRA_MESON_FLAGS: "-Ddefault_library=both" - <<: *fedora-x86_64-defaults + EXTRA_MESON_FLAGS: "--buildtype=release" + script: + - meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} + -Dx11-backend=true + -Dwayland-backend=true + -Dbroadway-backend=true + -Dvulkan=yes + _build + - ninja -C _build .mingw-defaults: &mingw-defaults stage: build diff --git a/.gitlab-ci/Dockerfile b/.gitlab-ci/fedora.Dockerfile similarity index 99% rename from .gitlab-ci/Dockerfile rename to .gitlab-ci/fedora.Dockerfile index d8cabe1a9d..a9006c01f2 100644 --- a/.gitlab-ci/Dockerfile +++ b/.gitlab-ci/fedora.Dockerfile @@ -61,6 +61,7 @@ RUN dnf -y install \ ninja-build \ pango-devel \ pcre-devel \ + pygments \ python3 \ python3-jinja2 \ python3-pip \ diff --git a/.gitlab-ci/run-tests.sh b/.gitlab-ci/run-tests.sh new file mode 100755 index 0000000000..ad3a4a7491 --- /dev/null +++ b/.gitlab-ci/run-tests.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +set -e + +builddir=$1 + +cd ${builddir} +xvfb-run -a -s "-screen 0 1024x768x24" \ + meson test --print-errorlogs \ + --suite=gtk + --no-suite=gtk:a11y From 9e38a70c6b526285fa6e49857606107c7ef49fea Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 29 Jan 2020 11:01:10 +0100 Subject: [PATCH 03/19] ci: Replicate the CI image scripts from GLib They are easier to use and document, and allow us to add new base images in the future without making a mess. --- .gitlab-ci.yml | 11 +-- .gitlab-ci/README.md | 38 ++++++++++ .gitlab-ci/fedora.Dockerfile | 2 +- .gitlab-ci/run-docker.sh | 131 +++++++++++++++++++++++++++++++++-- 4 files changed, 170 insertions(+), 12 deletions(-) create mode 100644 .gitlab-ci/README.md diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7f5ef322da..2780fc437f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,7 +19,7 @@ variables: G_MESSAGES_DEBUG: all fedora-x86_64: - image: registry.gitlab.gnome.org/gnome/gtk/master:v10 + image: registry.gitlab.gnome.org/gnome/gtk/fedora:v11 stage: build variables: EXTRA_MESON_FLAGS: "--buildtype=debug --default-library=both" @@ -62,7 +62,7 @@ fedora-x86_64: <<: *cache-paths fedora-x86_64-release: - image: registry.gitlab.gnome.org/gnome/gtk/master:v10 + image: registry.gitlab.gnome.org/gnome/gtk/fedora:v11 stage: build variables: EXTRA_MESON_FLAGS: "--buildtype=release" @@ -144,11 +144,12 @@ flatpak-master:icon-browser: <<: *flatpak-master pages: - image: registry.gitlab.gnome.org/gnome/gtk/master:v10 + image: registry.gitlab.gnome.org/gnome/gtk/fedora:v11 stage: deploy + variables: + EXTRA_MESON_FLAGS: "--buildtype=release" script: - - meson -Dgtk_doc=true _build . - - ninja -C _build + - meson ${COMMON_MESON_FLAGS} -Dgtk_doc=true _build - ninja -C _build gdk4-doc gsk4-doc gtk4-doc - mkdir -p public/ - mv _build/docs/reference/gtk/html/ public/gtk/ diff --git a/.gitlab-ci/README.md b/.gitlab-ci/README.md new file mode 100644 index 0000000000..3958faf001 --- /dev/null +++ b/.gitlab-ci/README.md @@ -0,0 +1,38 @@ +## GTK CI infrastructure + +GTK uses different CI images depending on platform and jobs. + +The CI images are Docker containers, generated either using `docker` or +`podman`, and pushed to the GitLab [container registry][registry]. + +Each Docker image has a tag composed of two parts: + + - `${image}`: the base image for a given platform, like "fedora" or + "debian-stable" + - `${number}`: an incremental version number, or `latest` + +See the [container registry][registry] for the available images for each +branch, as well as their available versions. + +### Checklist for Updating a CI image + + - [ ] Update the `${image}.Dockerfile` file with the dependencies + - [ ] Run `./run-docker.sh build --base ${image} --base-version ${number}` + - [ ] Run `./run-docker.sh push --base ${image} --base-version ${number}` + once the Docker image is built; you may need to log in by using + `docker login` or `podman login` + - [ ] Update the `image` keys in the `.gitlab-ci.yml` file with the new + image tag + - [ ] Open a merge request with your changes and let it run + +### Checklist for Adding a new CI image + + - [ ] Write a new `${image}.Dockerfile` with the instructions to set up + a build environment + - [ ] Add the `pip3 install meson` incantation + - [ ] Run `./run-docker.sh build --base ${image} --base-version ${number}` + - [ ] Run `./run-docker.sh push --base ${image} --base-version ${number}` + - [ ] Add the new job to `.gitlab-ci.yml` referencing the image + - [ ] Open a merge request with your changes and let it run + +[registry]: https://gitlab.gnome.org/GNOME/gtk/container_registry diff --git a/.gitlab-ci/fedora.Dockerfile b/.gitlab-ci/fedora.Dockerfile index a9006c01f2..2490f0a507 100644 --- a/.gitlab-ci/fedora.Dockerfile +++ b/.gitlab-ci/fedora.Dockerfile @@ -61,10 +61,10 @@ RUN dnf -y install \ ninja-build \ pango-devel \ pcre-devel \ - pygments \ python3 \ python3-jinja2 \ python3-pip \ + python3-pygments \ python3-wheel \ redhat-rpm-config \ sassc \ diff --git a/.gitlab-ci/run-docker.sh b/.gitlab-ci/run-docker.sh index 8a04ce8c89..dc9647bd4b 100755 --- a/.gitlab-ci/run-docker.sh +++ b/.gitlab-ci/run-docker.sh @@ -1,11 +1,130 @@ #!/bin/bash +read_arg() { + # $1 = arg name + # $2 = arg value + # $3 = arg parameter + local rematch='^[^=]*=(.*)$' + if [[ $2 =~ $rematch ]]; then + read "$1" <<< "${BASH_REMATCH[1]}" + else + read "$1" <<< "$3" + # There is no way to shift our callers args, so + # return 1 to indicate they should do it instead. + return 1 + fi +} + set -e -TAG="registry.gitlab.gnome.org/gnome/gtk/master:v10" +build=0 +run=0 +push=0 +list=0 +print_help=0 +no_login=0 -sudo docker build --build-arg HOST_USER_ID="$UID" --tag "${TAG}" \ - --file "Dockerfile" . -sudo docker run --rm --security-opt label=disable \ - --volume "$(pwd)/..:/home/user/app" --workdir "/home/user/app" \ - --tty --interactive "${TAG}" bash +while (($# > 0)); do + case "${1%%=*}" in + build) build=1;; + run) run=1;; + push) push=1;; + list) list=1;; + help) print_help=1;; + --base|-b) read_arg base "$@" || shift;; + --base-version) read_arg base_version "$@" || shift;; + --no-login) no_login=1;; + *) echo -e "\e[1;31mERROR\e[0m: Unknown option '$1'"; exit 1;; + esac + shift +done + +if [ $print_help == 1 ]; then + echo "$0 - Build and run Docker images" + echo "" + echo "Usage: $0 [options] [basename]" + echo "" + echo "Available commands" + echo "" + echo " build --base= - Build Docker image .Dockerfile" + echo " run --base= - Run Docker image " + echo " push --base= - Push Docker image to the registry" + echo " list - List available images" + echo " help - This help message" + echo "" + exit 0 +fi + +cd "$(dirname "$0")" + +if [ $list == 1 ]; then + echo "Available Docker images:" + for f in *.Dockerfile; do + filename=$( basename -- "$f" ) + basename="${filename%.*}" + + echo -e " \e[1;39m$basename\e[0m" + done + exit 0 +fi + +# All commands after this require --base to be set +if [ -z $base ]; then + echo "Usage: $0 " + exit 1 +fi + +if [ ! -f "$base.Dockerfile" ]; then + echo -e "\e[1;31mERROR\e[0m: Dockerfile for '$base' not found" + exit 1 +fi + +if [ -z $base_version ]; then + base_version="latest" +else + base_version="v$base_version" +fi + +TAG="registry.gitlab.gnome.org/gnome/gtk/${base}:${base_version}" + +if [ $build == 1 ]; then + if docker --help |& grep -q podman; then + # Docker is actually implemented by podman, and its OCI output + # is incompatible with some of the dockerd instances on GitLab + # CI runners. + format="--format docker" + else + format="" + fi + + echo -e "\e[1;32mBUILDING\e[0m: ${base} as ${TAG}" + sudo docker build \ + ${format} \ + --build-arg HOST_USER_ID="$UID" \ + --tag "${TAG}" \ + --file "${base}.Dockerfile" . + exit $? +fi + +if [ $push == 1 ]; then + echo -e "\e[1;32mPUSHING\e[0m: ${base} as ${TAG}" + + if [ $no_login == 0 ]; then + sudo docker login registry.gitlab.gnome.org + fi + + sudo docker push $TAG + exit $? +fi + +if [ $run == 1 ]; then + echo -e "\e[1;32mRUNNING\e[0m: ${base} as ${TAG}" + sudo docker run \ + --rm \ + --volume "$(pwd)/..:/home/user/app" \ + --workdir "/home/user/app" \ + --tty \ + --interactive "${TAG}" \ + bash + exit $? +fi From c06a08d63ae272667e76a3cf23cb1e495352df68 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 29 Jan 2020 11:31:47 +0100 Subject: [PATCH 04/19] ci: Split the static and shared builds (again) Sadly, we can't do a static build with the profiling code enabled because we don't have a static GLib build available. --- .gitlab-ci.yml | 56 +++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 53 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2780fc437f..824a6ad4ba 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,7 +22,7 @@ fedora-x86_64: image: registry.gitlab.gnome.org/gnome/gtk/fedora:v11 stage: build variables: - EXTRA_MESON_FLAGS: "--buildtype=debug --default-library=both" + EXTRA_MESON_FLAGS: "--buildtype=debug" script: - meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} -Dx11-backend=true @@ -48,7 +48,7 @@ fedora-x86_64: when: always reports: junit: - - "${CI_PROJECT_DIR}/_build/report.xml" + - "${CI_PROJECT_DIR}/_build/report.xml" name: "gtk-${CI_COMMIT_REF_NAME}" paths: - "${CI_PROJECT_DIR}/_build/meson-logs" @@ -61,7 +61,39 @@ fedora-x86_64: key: "$CI_JOB_NAME" <<: *cache-paths -fedora-x86_64-release: +static-build: + image: registry.gitlab.gnome.org/gnome/gtk/fedora:v11 + stage: build + variables: + EXTRA_MESON_FLAGS: "--default-library=both" + script: + - meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} + -Dx11-backend=true + -Dwayland-backend=true + -Dbroadway-backend=true + -Dvulkan=yes + _build + - ninja -C _build + - .gitlab-ci/run-tests.sh _build + - .gitlab-ci/meson-junit-report.py + --project-name=gtk + --job-id="${CI_JOB_NAME}" + --output=_build/report.xml + _build/meson-logs/testlog.json + artifacts: + when: always + reports: + junit: + - "${CI_PROJECT_DIR}/_build/report.xml" + name: "gtk-${CI_COMMIT_REF_NAME}" + paths: + - "${CI_PROJECT_DIR}/_build/meson-logs" + - "${CI_PROJECT_DIR}/_build/report.xml" + cache: + key: "$CI_JOB_NAME" + <<: *cache-paths + +release-build: image: registry.gitlab.gnome.org/gnome/gtk/fedora:v11 stage: build variables: @@ -74,6 +106,24 @@ fedora-x86_64-release: -Dvulkan=yes _build - ninja -C _build + - .gitlab-ci/run-tests.sh _build + - .gitlab-ci/meson-junit-report.py + --project-name=gtk + --job-id="${CI_JOB_NAME}" + --output=_build/report.xml + _build/meson-logs/testlog.json + artifacts: + when: always + reports: + junit: + - "${CI_PROJECT_DIR}/_build/report.xml" + name: "gtk-${CI_COMMIT_REF_NAME}" + paths: + - "${CI_PROJECT_DIR}/_build/meson-logs" + - "${CI_PROJECT_DIR}/_build/report.xml" + cache: + key: "$CI_JOB_NAME" + <<: *cache-paths .mingw-defaults: &mingw-defaults stage: build From 02ac7ff0aab816a35ce362c7847959db8f736bd7 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 29 Jan 2020 11:34:11 +0100 Subject: [PATCH 05/19] Initialise out variable Otherwise we might return an undefined value, and the compiler will be very cross at us. --- gdk/broadway/gdkdevice-broadway.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdk/broadway/gdkdevice-broadway.c b/gdk/broadway/gdkdevice-broadway.c index 801b021c56..52ffa719db 100644 --- a/gdk/broadway/gdkdevice-broadway.c +++ b/gdk/broadway/gdkdevice-broadway.c @@ -303,7 +303,7 @@ gdk_broadway_device_surface_at_position (GdkDevice *device, GdkModifierType *mask, gboolean get_toplevel) { - GdkSurface *surface; + GdkSurface *surface = NULL; gdk_broadway_device_query_state (device, NULL, &surface, NULL, NULL, win_x, win_y, mask); From 74b5bb12fb9be2041aa278ac4c0f3949ed561537 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 29 Jan 2020 11:45:33 +0100 Subject: [PATCH 06/19] ci: Disable ccache --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 824a6ad4ba..e9e2fd5131 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,7 +16,8 @@ stages: variables: COMMON_MESON_FLAGS: "--fatal-meson-warnings --werror" MESON_TEST_TIMEOUT_MULTIPLIER: 2 - G_MESSAGES_DEBUG: all + G_MESSAGES_DEBUG: "all" + CCACHE_DISABLE: "true" fedora-x86_64: image: registry.gitlab.gnome.org/gnome/gtk/fedora:v11 From 62352dd1fcbb1b479cfa78c83f64eeb702aaa2e8 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 29 Jan 2020 12:00:48 +0100 Subject: [PATCH 07/19] Fix compiler warnings in the release build We have a bunch of debug-only variables that get set and never used outside of debug code paths, and the compiler is not happy about it. --- gdk/gdkgl.c | 18 +++++++++++------- gdk/gdkglcontext.c | 40 ++++++++++++++++++++++++++++++++++++---- 2 files changed, 47 insertions(+), 11 deletions(-) diff --git a/gdk/gdkgl.c b/gdk/gdkgl.c index b1073483a7..1e24e77687 100644 --- a/gdk/gdkgl.c +++ b/gdk/gdkgl.c @@ -443,7 +443,6 @@ gdk_gl_texture_from_surface (cairo_surface_t *cairo_surface, cairo_region_t *region) { GdkGLContext *paint_context; - GdkDisplay *display; cairo_surface_t *image; double device_x_offset, device_y_offset; cairo_rectangle_int_t rect, e; @@ -458,13 +457,18 @@ gdk_gl_texture_from_surface (cairo_surface_t *cairo_surface, guint target; paint_context = gdk_gl_context_get_current (); - if (paint_context) - display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (paint_context)); - else - display = NULL; - if (paint_context && - GDK_DISPLAY_DEBUG_CHECK (display, GL_SOFTWARE) == 0 && +#ifdef G_ENABLE_DEBUG + if (paint_context != NULL) + { + GdkDisplay *display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (paint_context)); + + if (GDK_DISPLAY_DEBUG_CHECK (display, GL_SOFTWARE) == 0) + return; + } +#endif + + if (paint_context != NULL && GDK_GL_CONTEXT_GET_CLASS (paint_context)->texture_from_surface && GDK_GL_CONTEXT_GET_CLASS (paint_context)->texture_from_surface (paint_context, cairo_surface, region)) return; diff --git a/gdk/gdkglcontext.c b/gdk/gdkglcontext.c index 20f4727b48..4a01b2bab9 100644 --- a/gdk/gdkglcontext.c +++ b/gdk/gdkglcontext.c @@ -638,7 +638,11 @@ gdk_gl_context_set_required_version (GdkGLContext *context, int minor) { GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context); + gboolean force_gles = FALSE; int version, min_ver; +#ifdef G_ENABLE_DEBUG + GdkDisplay *display; +#endif g_return_if_fail (GDK_IS_GL_CONTEXT (context)); g_return_if_fail (!priv->realized); @@ -651,10 +655,16 @@ gdk_gl_context_set_required_version (GdkGLContext *context, return; } - /* Enforce a minimum context version number of 3.2 */ version = (major * 100) + minor; - if (priv->use_es > 0 || GDK_DISPLAY_DEBUG_CHECK (gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)), GL_GLES)) +#ifdef G_ENABLE_DEBUG + display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)); + force_gles = GDK_DISPLAY_DEBUG_CHECK (display, GL_GLES); +#endif + /* Enforce a minimum context version number of 3.2 for desktop GL, + * and 2.0 for GLES + */ + if (priv->use_es > 0 || force_gles) min_ver = 200; else min_ver = 302; @@ -683,12 +693,25 @@ gdk_gl_context_get_required_version (GdkGLContext *context, int *minor) { GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context); + gboolean force_gles = FALSE; +#ifdef G_ENABLE_DEBUG + GdkDisplay *display; +#endif int default_major, default_minor; int maj, min; g_return_if_fail (GDK_IS_GL_CONTEXT (context)); - if (priv->use_es > 0 || GDK_DISPLAY_DEBUG_CHECK (gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)), GL_GLES)) +#ifdef G_ENABLE_DEBUG + display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)); + force_gles = GDK_DISPLAY_DEBUG_CHECK (display, GL_GLES); +#endif + + /* Default fallback values for uninitialised contexts; we + * enforce a context version number of 3.2 for desktop GL, + * and 2.0 for GLES + */ + if (priv->use_es > 0 || force_gles) { default_major = 2; default_minor = 0; @@ -936,6 +959,10 @@ gdk_gl_context_check_extensions (GdkGLContext *context) { GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context); gboolean has_npot, has_texture_rectangle; + gboolean gl_debug = FALSE; +#ifdef G_ENABLE_DEBUG + GdkDisplay *display; +#endif if (!priv->realized) return; @@ -993,7 +1020,12 @@ gdk_gl_context_check_extensions (GdkGLContext *context) priv->is_legacy = TRUE; } - if (priv->has_khr_debug && GDK_DISPLAY_DEBUG_CHECK (gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)), GL_DEBUG)) +#ifdef G_ENABLE_DEBUG + display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)); + gl_debug = GDK_DISPLAY_DEBUG_CHECK (display, GL_DEBUG); +#endif + + if (priv->has_khr_debug && gl_debug) { priv->use_khr_debug = TRUE; glGetIntegerv (GL_MAX_LABEL_LENGTH, &priv->max_debug_label_length); From a7d295254f90fe70a34dffa9b67b1e503a378cde Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 29 Jan 2020 12:16:44 +0100 Subject: [PATCH 08/19] ci: Add static packages for GLib and PCRE Otherwise Meson will warn about missing static dependencies for sysprof-capture-3. --- .gitlab-ci/fedora.Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci/fedora.Dockerfile b/.gitlab-ci/fedora.Dockerfile index 2490f0a507..8c96f33222 100644 --- a/.gitlab-ci/fedora.Dockerfile +++ b/.gitlab-ci/fedora.Dockerfile @@ -23,6 +23,7 @@ RUN dnf -y install \ gettext \ git \ glib2-devel \ + glib2-static \ glibc-devel \ glibc-headers \ gobject-introspection-devel \ @@ -61,6 +62,7 @@ RUN dnf -y install \ ninja-build \ pango-devel \ pcre-devel \ + pcre-static \ python3 \ python3-jinja2 \ python3-pip \ From 5ace9ef4e8a737c494a3bc61f823b349858d3797 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 29 Jan 2020 12:18:09 +0100 Subject: [PATCH 09/19] ci: Use the new Fedora image --- .gitlab-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e9e2fd5131..ef92e1d696 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,7 +20,7 @@ variables: CCACHE_DISABLE: "true" fedora-x86_64: - image: registry.gitlab.gnome.org/gnome/gtk/fedora:v11 + image: registry.gitlab.gnome.org/gnome/gtk/fedora:v12 stage: build variables: EXTRA_MESON_FLAGS: "--buildtype=debug" @@ -63,7 +63,7 @@ fedora-x86_64: <<: *cache-paths static-build: - image: registry.gitlab.gnome.org/gnome/gtk/fedora:v11 + image: registry.gitlab.gnome.org/gnome/gtk/fedora:v12 stage: build variables: EXTRA_MESON_FLAGS: "--default-library=both" @@ -95,7 +95,7 @@ static-build: <<: *cache-paths release-build: - image: registry.gitlab.gnome.org/gnome/gtk/fedora:v11 + image: registry.gitlab.gnome.org/gnome/gtk/fedora:v12 stage: build variables: EXTRA_MESON_FLAGS: "--buildtype=release" @@ -195,7 +195,7 @@ flatpak-master:icon-browser: <<: *flatpak-master pages: - image: registry.gitlab.gnome.org/gnome/gtk/fedora:v11 + image: registry.gitlab.gnome.org/gnome/gtk/fedora:v12 stage: deploy variables: EXTRA_MESON_FLAGS: "--buildtype=release" From c00896a090ec0a95fdc62476513cf8be380e1da5 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 29 Jan 2020 12:23:06 +0100 Subject: [PATCH 10/19] ci: Remove static build job Now that we figured out why the build was failing on Fedora when the profiling code was enabled, we can go back to building both shared and static libraries by default. --- .gitlab-ci.yml | 34 +--------------------------------- 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ef92e1d696..276b3e903d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,7 +23,7 @@ fedora-x86_64: image: registry.gitlab.gnome.org/gnome/gtk/fedora:v12 stage: build variables: - EXTRA_MESON_FLAGS: "--buildtype=debug" + EXTRA_MESON_FLAGS: "--buildtype=debug --default-library=both" script: - meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} -Dx11-backend=true @@ -62,38 +62,6 @@ fedora-x86_64: key: "$CI_JOB_NAME" <<: *cache-paths -static-build: - image: registry.gitlab.gnome.org/gnome/gtk/fedora:v12 - stage: build - variables: - EXTRA_MESON_FLAGS: "--default-library=both" - script: - - meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS} - -Dx11-backend=true - -Dwayland-backend=true - -Dbroadway-backend=true - -Dvulkan=yes - _build - - ninja -C _build - - .gitlab-ci/run-tests.sh _build - - .gitlab-ci/meson-junit-report.py - --project-name=gtk - --job-id="${CI_JOB_NAME}" - --output=_build/report.xml - _build/meson-logs/testlog.json - artifacts: - when: always - reports: - junit: - - "${CI_PROJECT_DIR}/_build/report.xml" - name: "gtk-${CI_COMMIT_REF_NAME}" - paths: - - "${CI_PROJECT_DIR}/_build/meson-logs" - - "${CI_PROJECT_DIR}/_build/report.xml" - cache: - key: "$CI_JOB_NAME" - <<: *cache-paths - release-build: image: registry.gitlab.gnome.org/gnome/gtk/fedora:v12 stage: build From c4dfacc40422905b5d9062d61914ede368df2b7f Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 29 Jan 2020 12:31:00 +0100 Subject: [PATCH 11/19] ci: Add missing newline escape Otherwise we're going to run the accessibility test suite, and it's going to fail. --- .gitlab-ci/run-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci/run-tests.sh b/.gitlab-ci/run-tests.sh index ad3a4a7491..136988e11e 100755 --- a/.gitlab-ci/run-tests.sh +++ b/.gitlab-ci/run-tests.sh @@ -7,5 +7,5 @@ builddir=$1 cd ${builddir} xvfb-run -a -s "-screen 0 1024x768x24" \ meson test --print-errorlogs \ - --suite=gtk + --suite=gtk \ --no-suite=gtk:a11y From 1806af1e83b08d44f257b868d6b8e17a6fb8077b Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 29 Jan 2020 14:02:16 +0100 Subject: [PATCH 12/19] Declare global counter only in debug builds --- gdk/gdkdrawcontext.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gdk/gdkdrawcontext.c b/gdk/gdkdrawcontext.c index 5822ed7eb2..93f85528e6 100644 --- a/gdk/gdkdrawcontext.c +++ b/gdk/gdkdrawcontext.c @@ -175,13 +175,17 @@ gdk_draw_context_class_init (GdkDrawContextClass *klass) g_object_class_install_properties (gobject_class, LAST_PROP, pspecs); } +#ifdef G_ENABLE_DEBUG static guint pixels_counter; +#endif static void gdk_draw_context_init (GdkDrawContext *self) { +#ifdef G_ENABLE_DEBUG if (pixels_counter == 0) pixels_counter = gdk_profiler_define_int_counter ("frame pixels", "Pixels drawn per frame"); +#endif } /** @@ -320,6 +324,7 @@ gdk_draw_context_begin_frame (GdkDrawContext *context, GDK_DRAW_CONTEXT_GET_CLASS (context)->begin_frame (context, priv->frame_region); } +#ifdef G_ENABLE_DEBUG static gint64 region_get_pixels (cairo_region_t *region) { @@ -336,6 +341,7 @@ region_get_pixels (cairo_region_t *region) return pixels; } +#endif /** * gdk_draw_context_end_frame: @@ -376,10 +382,12 @@ gdk_draw_context_end_frame (GdkDrawContext *context) GDK_DRAW_CONTEXT_GET_CLASS (context)->end_frame (context, priv->frame_region); +#ifdef G_ENABLE_DEBUG if (gdk_profiler_is_running ()) gdk_profiler_set_int_counter (pixels_counter, g_get_monotonic_time () * 1000, region_get_pixels (priv->frame_region)); +#endif g_clear_pointer (&priv->frame_region, cairo_region_destroy); g_clear_object (&priv->surface->paint_context); From 47c44644b109e0ec1757c83786de2d5a0785675e Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 29 Jan 2020 14:02:41 +0100 Subject: [PATCH 13/19] Silence compiler warnings in non-debug builds --- gsk/gl/gskglrenderer.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c index 44d8115dbb..011bbb18b8 100644 --- a/gsk/gl/gskglrenderer.c +++ b/gsk/gl/gskglrenderer.c @@ -2845,17 +2845,18 @@ gsk_gl_renderer_unrealize (GskRenderer *renderer) static void gsk_gl_renderer_clear_tree (GskGLRenderer *self) { - int removed_textures; - if (self->gl_context == NULL) return; gdk_gl_context_make_current (self->gl_context); ops_reset (&self->op_builder); - removed_textures = gsk_gl_driver_collect_textures (self->gl_driver); + +#ifdef G_ENABLE_DEBUG + int removed_textures = gsk_gl_driver_collect_textures (self->gl_driver); GSK_RENDERER_NOTE (GSK_RENDERER (self), OPENGL, g_message ("Collected: %d textures", removed_textures)); +#endif } static void @@ -3050,7 +3051,7 @@ add_offscreen_ops (GskGLRenderer *self, graphene_matrix_t prev_projection; graphene_rect_t prev_viewport; graphene_matrix_t item_proj; - float prev_opacity; + float prev_opacity = 1.0; int texture_id = 0; if (node_is_invisible (child_node)) From 0df542e4940c528c2664358c3362b80d3f3ca9d5 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 29 Jan 2020 14:03:56 +0100 Subject: [PATCH 14/19] Declare global counters only in debug builds --- gsk/vulkan/gskvulkanrenderer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gsk/vulkan/gskvulkanrenderer.c b/gsk/vulkan/gskvulkanrenderer.c index 867f51b5d6..cd10a31857 100644 --- a/gsk/vulkan/gskvulkanrenderer.c +++ b/gsk/vulkan/gskvulkanrenderer.c @@ -37,10 +37,10 @@ typedef struct { GQuark cpu_time; GQuark gpu_time; } ProfileTimers; -#endif static guint texture_pixels_counter; static guint fallback_pixels_counter; +#endif struct _GskVulkanRenderer { From 59028d7d0f3a607949a1c1bc97b9cd6d3a653140 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 29 Jan 2020 14:36:23 +0100 Subject: [PATCH 15/19] ci: Generate the report for the release builds We are going to need to hide the report generation into the test runner script, as we want the job to produce the reports even in case of failure, instead of bailing out immediately. --- .gitlab-ci.yml | 20 ++++---------------- .gitlab-ci/run-tests.sh | 27 ++++++++++++++++++++++++--- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 276b3e903d..26e4c0ea10 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -34,17 +34,6 @@ fedora-x86_64: _build - ninja -C _build - .gitlab-ci/run-tests.sh _build - - .gitlab-ci/meson-junit-report.py - --project-name=gtk - --job-id="${CI_JOB_NAME}" - --output=_build/report.xml - _build/meson-logs/testlog.json - - .gitlab-ci/meson-html-report.py - --project-name=gtk - --job-id="${CI_JOB_NAME}" - --reftest-output-dir="_build/testsuite/reftests/output" - --output=_build/report.html - _build/meson-logs/testlog.json artifacts: when: always reports: @@ -76,11 +65,6 @@ release-build: _build - ninja -C _build - .gitlab-ci/run-tests.sh _build - - .gitlab-ci/meson-junit-report.py - --project-name=gtk - --job-id="${CI_JOB_NAME}" - --output=_build/report.xml - _build/meson-logs/testlog.json artifacts: when: always reports: @@ -90,6 +74,10 @@ release-build: paths: - "${CI_PROJECT_DIR}/_build/meson-logs" - "${CI_PROJECT_DIR}/_build/report.xml" + - "${CI_PROJECT_DIR}/_build/report.html" + - "${CI_PROJECT_DIR}/_build/testsuite/reftests/output/*.png" + - "${CI_PROJECT_DIR}/_build/testsuite/gsk/compare/*/*.png" + - "${CI_PROJECT_DIR}/_build/testsuite/css/output/*.syscap" cache: key: "$CI_JOB_NAME" <<: *cache-paths diff --git a/.gitlab-ci/run-tests.sh b/.gitlab-ci/run-tests.sh index 136988e11e..9bac5b93c8 100755 --- a/.gitlab-ci/run-tests.sh +++ b/.gitlab-ci/run-tests.sh @@ -1,11 +1,32 @@ #!/bin/bash -set -e +set +x +set +e +srcdir=$( pwd ) builddir=$1 -cd ${builddir} +export GDK_BACKEND=x11 xvfb-run -a -s "-screen 0 1024x768x24" \ - meson test --print-errorlogs \ + meson test -C ${builddir} \ + --print-errorlogs \ --suite=gtk \ --no-suite=gtk:a11y + +# Store the exit code for the CI run, but always +# generate the reports +exit_code=$? + +$srcdir/.gitlab-ci/meson-junit-report.py \ + --project-name=gtk \ + --job-id="${CI_JOB_NAME}" \ + --output=${builddir}/report.xml \ + ${builddir}/meson-logs/testlog.json +$srcdir/.gitlab-ci/meson-html-report.py \ + --project-name=gtk \ + --job-id="${CI_JOB_NAME}" \ + --reftest-output-dir="${builddir}/testsuite/reftests/output" \ + --output=${builddir}/report.html \ + ${builddir}/meson-logs/testlog.json + +exit $exit_code From 76aba1f0460fde2115842e8480d700f1e5418138 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 11 Feb 2020 13:28:16 +0000 Subject: [PATCH 16/19] ci: Add a style check pass We should at least try to get the style check done by a machine, as opposed to have humans go through merge requests with coding style nitpicks. --- .clang-format | 11 +++ .gitlab-ci.yml | 21 ++++- .gitlab-ci/clang-format-diff.py | 133 +++++++++++++++++++++++++++++ .gitlab-ci/fedora.Dockerfile | 1 + .gitlab-ci/run-style-check-diff.sh | 34 ++++++++ 5 files changed, 197 insertions(+), 3 deletions(-) create mode 100644 .clang-format create mode 100755 .gitlab-ci/clang-format-diff.py create mode 100755 .gitlab-ci/run-style-check-diff.sh diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000000..13fd0fbd44 --- /dev/null +++ b/.clang-format @@ -0,0 +1,11 @@ +# See https://wiki.apertis.org/Guidelines/Coding_conventions#Code_formatting +BasedOnStyle: GNU +AlwaysBreakAfterDefinitionReturnType: All +BreakBeforeBinaryOperators: None +BinPackParameters: false +SpaceAfterCStyleCast: true +# Our column limit is actually 80, but setting that results in clang-format +# making a lot of dubious hanging-indent choices; disable it and assume the +# developer will line wrap appropriately. clang-format will still check +# existing hanging indents. +ColumnLimit: 0 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 26e4c0ea10..58db3d7a4e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,5 @@ stages: + - style-check - build - flatpak - deploy @@ -19,8 +20,22 @@ variables: G_MESSAGES_DEBUG: "all" CCACHE_DISABLE: "true" +.only-default: + only: + - branches + except: + - tags + +style-check-diff: + extends: .only-default + image: registry.gitlab.gnome.org/gnome/gtk/fedora:v13 + stage: style-check + allow_failure: true + script: + - .gitlab-ci/run-style-check-diff.sh + fedora-x86_64: - image: registry.gitlab.gnome.org/gnome/gtk/fedora:v12 + image: registry.gitlab.gnome.org/gnome/gtk/fedora:v13 stage: build variables: EXTRA_MESON_FLAGS: "--buildtype=debug --default-library=both" @@ -52,7 +67,7 @@ fedora-x86_64: <<: *cache-paths release-build: - image: registry.gitlab.gnome.org/gnome/gtk/fedora:v12 + image: registry.gitlab.gnome.org/gnome/gtk/fedora:v13 stage: build variables: EXTRA_MESON_FLAGS: "--buildtype=release" @@ -151,7 +166,7 @@ flatpak-master:icon-browser: <<: *flatpak-master pages: - image: registry.gitlab.gnome.org/gnome/gtk/fedora:v12 + image: registry.gitlab.gnome.org/gnome/gtk/fedora:v13 stage: deploy variables: EXTRA_MESON_FLAGS: "--buildtype=release" diff --git a/.gitlab-ci/clang-format-diff.py b/.gitlab-ci/clang-format-diff.py new file mode 100755 index 0000000000..3fb776c592 --- /dev/null +++ b/.gitlab-ci/clang-format-diff.py @@ -0,0 +1,133 @@ +#!/usr/bin/env python3 +# +# === clang-format-diff.py - ClangFormat Diff Reformatter ---*- python -*-=== # +# +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# +# ===---------------------------------------------------------------------=== # + +""" +This script reads input from a unified diff and reformats all the changed +lines. This is useful to reformat all the lines touched by a specific patch. +Example usage for git/svn users: + + git diff -U0 --no-color HEAD^ | clang-format-diff.py -p1 -i + svn diff --diff-cmd=diff -x-U0 | clang-format-diff.py -i + +""" +from __future__ import absolute_import, division, print_function + +import argparse +import difflib +import re +import subprocess +import sys + +if sys.version_info.major >= 3: + from io import StringIO +else: + from io import BytesIO as StringIO + + +def main(): + parser = argparse.ArgumentParser( + description=__doc__, + formatter_class=argparse.RawDescriptionHelpFormatter) + parser.add_argument('-i', action='store_true', default=False, + help='apply edits to files instead of displaying a ' + 'diff') + parser.add_argument('-p', metavar='NUM', default=0, + help='strip the smallest prefix containing P slashes') + parser.add_argument('-regex', metavar='PATTERN', default=None, + help='custom pattern selecting file paths to reformat ' + '(case sensitive, overrides -iregex)') + parser.add_argument('-iregex', metavar='PATTERN', + default=r'.*\.(cpp|cc|c\+\+|cxx|c|cl|h|hh|hpp|m|mm|inc' + r'|js|ts|proto|protodevel|java|cs)', + help='custom pattern selecting file paths to reformat ' + '(case insensitive, overridden by -regex)') + parser.add_argument('-sort-includes', action='store_true', default=False, + help='let clang-format sort include blocks') + parser.add_argument('-v', '--verbose', action='store_true', + help='be more verbose, ineffective without -i') + parser.add_argument('-style', + help='formatting style to apply (LLVM, Google, ' + 'Chromium, Mozilla, WebKit)') + parser.add_argument('-binary', default='clang-format', + help='location of binary to use for clang-format') + args = parser.parse_args() + + # Extract changed lines for each file. + filename = None + lines_by_file = {} + for line in sys.stdin: + match = re.search(r'^\+\+\+\ (.*?/){%s}(\S*)' % args.p, line) + if match: + filename = match.group(2) + if filename is None: + continue + + if args.regex is not None: + if not re.match('^%s$' % args.regex, filename): + continue + else: + if not re.match('^%s$' % args.iregex, filename, re.IGNORECASE): + continue + + match = re.search(r'^@@.*\+(\d+)(,(\d+))?', line) + if match: + start_line = int(match.group(1)) + line_count = 1 + if match.group(3): + line_count = int(match.group(3)) + if line_count == 0: + continue + end_line = start_line + line_count - 1 + lines_by_file.setdefault(filename, []).extend( + ['-lines', str(start_line) + ':' + str(end_line)]) + + # Reformat files containing changes in place. + # We need to count amount of bytes generated in the output of + # clang-format-diff. If clang-format-diff doesn't generate any bytes it + # means there is nothing to format. + format_line_counter = 0 + for filename, lines in lines_by_file.items(): + if args.i and args.verbose: + print('Formatting {}'.format(filename)) + command = [args.binary, filename] + if args.i: + command.append('-i') + if args.sort_includes: + command.append('-sort-includes') + command.extend(lines) + if args.style: + command.extend(['-style', args.style]) + p = subprocess.Popen(command, + stdout=subprocess.PIPE, + stderr=None, + stdin=subprocess.PIPE, + universal_newlines=True) + stdout, _ = p.communicate() + if p.returncode != 0: + sys.exit(p.returncode) + + if not args.i: + with open(filename) as f: + code = f.readlines() + formatted_code = StringIO(stdout).readlines() + diff = difflib.unified_diff(code, formatted_code, + filename, filename, + '(before formatting)', + '(after formatting)') + diff_string = ''.join(diff) + if diff_string: + format_line_counter += sys.stdout.write(diff_string) + + if format_line_counter > 0: + sys.exit(1) + + +if __name__ == '__main__': + main() diff --git a/.gitlab-ci/fedora.Dockerfile b/.gitlab-ci/fedora.Dockerfile index 8c96f33222..1a0ca24dec 100644 --- a/.gitlab-ci/fedora.Dockerfile +++ b/.gitlab-ci/fedora.Dockerfile @@ -8,6 +8,7 @@ RUN dnf -y install \ cairo-devel \ cairo-gobject-devel \ ccache \ + clang \ colord-devel \ cups-devel \ dbus-daemon \ diff --git a/.gitlab-ci/run-style-check-diff.sh b/.gitlab-ci/run-style-check-diff.sh new file mode 100755 index 0000000000..e6f54f93c6 --- /dev/null +++ b/.gitlab-ci/run-style-check-diff.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +set +e + +# We need to add a new remote for the upstream master, since this script could +# be running in a personal fork of the repository which has out of date branches. +git remote add upstream https://gitlab.gnome.org/GNOME/gtk.git +git fetch upstream + +# Work out the newest common ancestor between the detached HEAD that this CI job +# has checked out, and the upstream target branch (which will typically be +# `upstream/master` or `upstream/gtk-3-24`). +# +# `${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}` is only defined if we’re running in +# a merge request pipeline; fall back to `${CI_DEFAULT_BRANCH}` otherwise. +newest_common_ancestor_sha=$(diff --old-line-format='' --new-line-format='' <(git rev-list --first-parent upstream/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:-${CI_DEFAULT_BRANCH}}) <(git rev-list --first-parent HEAD) | head -1) +git diff -U0 --no-color "${newest_common_ancestor_sha}" | .gitlab-ci/clang-format-diff.py -binary "clang-format" -p1 + +# The style check is not infallible. The clang-format configuration cannot +# perfectly describe GTK’s coding style: in particular, it cannot align +# function arguments. The documented coding style for GTK takes priority over +# clang-format suggestions. Hopefully we can eventually improve clang-format to +# be configurable enough for our coding style. That’s why this CI check is OK +# to fail: the idea is that people can look through the output and ignore it if +# it’s wrong. (That situation can also happen if someone touches pre-existing +# badly formatted code and it doesn’t make sense to tidy up the wider coding +# style with the changes they’re making.) +echo "" +echo "Note that clang-format output is advisory and cannot always match the" +echo "GTK coding style, documented at:" +echo " https://gitlab.gnome.org/GNOME/gtk/blob/master/docs/CODING-STYLE" +echo "Warnings from this tool can be ignored in favour of the documented " +echo "coding style, or in favour of matching the style of existing" +echo "surrounding code." From c69595a3a97775fa0ca915834dbc5ea77a6241d8 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 11 Feb 2020 14:07:43 +0000 Subject: [PATCH 17/19] vulkan: Handle VK_ERROR_UNKNOWN A newly added Vulkan 1.2 error. --- gdk/gdkvulkancontext.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gdk/gdkvulkancontext.c b/gdk/gdkvulkancontext.c index 5582afeb92..76f120b76a 100644 --- a/gdk/gdkvulkancontext.c +++ b/gdk/gdkvulkancontext.c @@ -205,7 +205,10 @@ gdk_vulkan_strerror (VkResult result) case VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT: return "An operation on a swapchain created with VK_FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT failed as it did not have exlusive full-screen access."; #endif - +#if VK_HEADER_VERSION >= 131 + case VK_ERROR_UNKNOWN: + return "An unknown error has occurred; either the application has provided invalid input, or an implementation failure has occurred."; +#endif case VK_RESULT_RANGE_SIZE: case VK_RESULT_MAX_ENUM: default: From b99a4da939b1acfa7459b45b97f02f7220ceb414 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 11 Feb 2020 14:53:57 +0000 Subject: [PATCH 18/19] testsuite/gtk: Add xfail tests Some tests are expected to fail. Some tests are expected to fail in non-debugging builds. The icontheme test is the latter. --- testsuite/gtk/meson.build | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/testsuite/gtk/meson.build b/testsuite/gtk/meson.build index 4255d8817f..02d38cbece 100644 --- a/testsuite/gtk/meson.build +++ b/testsuite/gtk/meson.build @@ -70,6 +70,17 @@ tests = [ ['widgetorder'], ] +# Tests that are expected to fail +xfail = [ +] + +# Tests that are expected to fail on non-debug builds +xfail_nodebug = [ + 'icontheme', # Overrides debugging messages +] + +is_debug = get_option('buildtype').startswith('debug') + test_cargs = [] if os_unix @@ -90,6 +101,11 @@ foreach t : tests install: get_option('install-tests'), install_dir: testexecdir) + expect_fail = xfail.contains(test_name) + if not is_debug + expect_fail = xfail_nodebug.contains(test_name) + endif + test(test_name, test_exe, args: [ '--tap', '-k' ], env: [ 'GIO_USE_VOLUME_MONITOR=unix', @@ -102,7 +118,9 @@ foreach t : tests 'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()), 'GSETTINGS_SCHEMA_DIR=@0@'.format(gtk_schema_build_dir), ], - suite: 'gtk') + suite: 'gtk', + should_fail: expect_fail, + ) endforeach # FIXME: if objc autotestkeywords_CPPFLAGS += -DHAVE_OBJC=1 -x objective-c++ From 2b425fa88a65e62e37ac29bf7822fdba88a086af Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 11 Feb 2020 15:12:14 +0000 Subject: [PATCH 19/19] ci: Allow release job to fail We need to investigate release-specific failures, and possibly fix our test suite to deal with debug-specific poking through the internal state. For the time being, allow the release job to fail, but this is strictly a temporary measure. --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 58db3d7a4e..6df0a99184 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -80,6 +80,7 @@ release-build: _build - ninja -C _build - .gitlab-ci/run-tests.sh _build + allow_failure: true artifacts: when: always reports: