[packages/gtk-webkit4] replace gir patch with more general one that should fix same issue

atler atler at pld-linux.org
Sat Jul 1 17:38:42 CEST 2023


commit d6e3a706d29a37dfed0f9584c71092b04c663732
Author: Jan Palus <atler at pld-linux.org>
Date:   Sat Jul 1 17:03:15 2023 +0200

    replace gir patch with more general one that should fix same issue

 gtk-webkit4-gir.patch | 20 --------------
 gtk-webkit4.spec      |  2 +-
 parallel-gir.patch    | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 73 insertions(+), 21 deletions(-)
---
diff --git a/gtk-webkit4.spec b/gtk-webkit4.spec
index dcc702e..f0bc3ed 100644
--- a/gtk-webkit4.spec
+++ b/gtk-webkit4.spec
@@ -32,7 +32,7 @@ Source0:	https://webkitgtk.org/releases/webkitgtk-%{version}.tar.xz
 # Source0-md5:	a50290fdc80842b1ae8be1e1147b5679
 Patch0:		x32.patch
 Patch1:		%{name}-icu59.patch
-Patch2:		%{name}-gir.patch
+Patch2:		parallel-gir.patch
 Patch3:		%{name}-driver-version-suffix.patch
 Patch4:		%{name}-gcc13.patch
 URL:		https://webkitgtk.org/
diff --git a/gtk-webkit4-gir.patch b/gtk-webkit4-gir.patch
deleted file mode 100644
index 7fd9584..0000000
--- a/gtk-webkit4-gir.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-#--- webkitgtk-2.38.5/Source/WebKit/PlatformGTK.cmake.orig	2022-09-14 13:58:10.556863500 +0200
-#+++ webkitgtk-2.38.5/Source/WebKit/PlatformGTK.cmake	2023-04-22 19:21:53.186764446 +0200
-#@@ -764,3 +764,6 @@ GI_INTROSPECT(WebKit2WebExtension ${WEBK
-# GI_DOCGEN(WebKit2WebExtension gtk/webkit2gtk-webextension.toml.in
-#     CONTENT_TEMPLATES gtk/urlmap.js
-# )
-#+
-#+add_dependencies(gir-WebKit2 gir-JavaScriptCore)
-#+add_dependencies(gir-WebKit2WebExtension gir-JavaScriptCore)
---- webkitgtk-2.38.5/Source/cmake/FindGI.cmake.orig	2023-02-14 10:01:07.457508800 +0100
-+++ webkitgtk-2.38.5/Source/cmake/FindGI.cmake	2023-04-22 19:21:53.186764446 +0200
-@@ -265,7 +265,7 @@ function(GI_INTROSPECT namespace nsversi
-             get_property(dep_gir_lib TARGET "gir-${dep}" PROPERTY GI_GIR_LIBRARY)
-             if (dep_gir_path)
-                 list(APPEND scanner_flags "--include-uninstalled=${dep_gir_path}")
--                list(APPEND gir_deps "${dep_gir_path}")
-+                list(APPEND gir_deps "gir-${dep}")
-             else ()
-                 message(AUTHOR_WARNING
-                     "Target '${dep}' listed as a dependency but it has not "
diff --git a/parallel-gir.patch b/parallel-gir.patch
new file mode 100644
index 0000000..ab5ccc2
--- /dev/null
+++ b/parallel-gir.patch
@@ -0,0 +1,72 @@
+From bbe8d64377e2ff81cfe146d961d3ce3d7005d666 Mon Sep 17 00:00:00 2001
+From: Jan Palus <jpalus at fastmail.com>
+Date: Sat, 1 Jul 2023 14:36:09 +0200
+Subject: [PATCH] Generate GIR once to fix intermittent parallel build failures
+
+typelib, doc-check and doc targets add file dependency on generated GIR
+file. As per CMake documentation that pulls commands to generate GIR
+file in every of those targets:
+
+https://cmake.org/cmake/help/latest/command/add_custom_command.html
+
+> If any dependency is an OUTPUT of another custom command in the same
+> directory (CMakeLists.txt file), CMake automatically brings the other
+> custom command into the target in which this command is built.
+
+Meaning there will be 4 different commands in total trying to create
+same file independently without any ordering enforced between them. This
+causes intermittent failures depending on timing in which those commands
+execute when invoking parallel build.
+
+To ensure that GIR is created only once and that proper ordering is in
+place replace file dependency with dependency on target creating GIR
+file.
+
+Signed-off-by: Jan Palus <jpalus at fastmail.com>
+---
+ Source/cmake/FindGI.cmake       | 2 +-
+ Source/cmake/FindGIDocgen.cmake | 5 +++--
+ 2 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/Source/cmake/FindGI.cmake b/Source/cmake/FindGI.cmake
+index fdc56b21b148..6b636af69a28 100644
+--- a/Source/cmake/FindGI.cmake
++++ b/Source/cmake/FindGI.cmake
+@@ -376,7 +376,7 @@ function(GI_INTROSPECT namespace nsversion header)
+     add_custom_command(
+         OUTPUT "${typ_path}"
+         COMMENT "Generating ${gir_name}.typelib"
+-        DEPENDS "${gir_path}"
++        DEPENDS "gir-${namespace}"
+         VERBATIM
+         COMMAND "${GI_COMPILER_EXE}"
+             "--includedir=${CMAKE_BINARY_DIR}"
+diff --git a/Source/cmake/FindGIDocgen.cmake b/Source/cmake/FindGIDocgen.cmake
+index 88c90633e63f..ef560db7a2f0 100644
+--- a/Source/cmake/FindGIDocgen.cmake
++++ b/Source/cmake/FindGIDocgen.cmake
+@@ -180,7 +180,7 @@ function(GI_DOCGEN namespace toml)
+     endif ()
+     set(outdir "${CMAKE_BINARY_DIR}/Documentation/${package}")
+ 
+-    set(docdeps "${toml_path};${gir_path}")
++    set(docdeps "${toml_path};gir-${namespace}")
+     foreach (item IN LISTS opt_CONTENT_TEMPLATES)
+         get_filename_component(filename "${item}" NAME)
+         configure_file("${item}.in" "${contentdir}/${filename}" @ONLY)
+@@ -239,10 +239,11 @@ function(GI_DOCGEN namespace toml)
+     add_custom_target("doc-check-${namespace}"
+         COMMENT "Checking documentation: ${namespace}"
+         WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
+-        DEPENDS "${toml_path}" "${gir_path}"
++        DEPENDS "${toml_path}"
+         VERBATIM
+         COMMAND "${GIDocgen_EXE}" check ${common_flags} "${gir_path}"
+     )
++    add_dependencies("doc-check-${namespace}" "gir-${namespace}")
+ 
+     if (NOT TARGET doc-check-all)
+         add_custom_target(doc-check-all COMMENT "Check all documentation targets")
+-- 
+2.41.0
+
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/gtk-webkit4.git/commitdiff/d6e3a706d29a37dfed0f9584c71092b04c663732



More information about the pld-cvs-commit mailing list