public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/libpkgmanifest] epel10: Fix building with GCC 16 (bug #2434767)
@ 2026-06-11 15:54 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-06-11 15:54 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/libpkgmanifest
Branch : epel10
Commit : 79bbc26e0b858caf9434e186d911e2f75eb891a0
Author : Petr Písař <ppisar@redhat.com>
Date   : 2026-01-30T10:34:42+01:00
Stats  : +83/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/libpkgmanifest/c/79bbc26e0b858caf9434e186d911e2f75eb891a0?branch=epel10

Log:
Fix building with GCC 16 (bug #2434767)

---
diff --git a/0001-build-Turn-compiler-warnings-into-errors-only-for-ou.patch b/0001-build-Turn-compiler-warnings-into-errors-only-for-ou.patch
new file mode 100644
index 0000000..27bc704
--- /dev/null
+++ b/0001-build-Turn-compiler-warnings-into-errors-only-for-ou.patch
@@ -0,0 +1,80 @@
+From d21bfef59dc6276afb922fbad4d988a3dc07e231 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
+Date: Fri, 30 Jan 2026 10:10:18 +0100
+Subject: [PATCH] build: Turn compiler warnings into errors only for our code
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Building with GCC 16 failed on i686 architecture:
+
+    /builddir/build/BUILD/libpkgmanifest-0.5.9-build/libpkgmanifest-0.5.9/redhat-linux-build/bindings/python/libpkgmanifest/CMakeFiles/python3_common.dir/commonPYTHON_wrap.cxx: In function ‘void SWIG_TypeClientData(swig_type_info*, void*)’:
+    /builddir/build/BUILD/libpkgmanifest-0.5.9-build/libpkgmanifest-0.5.9/redhat-linux-build/bindings/python/libpkgmanifest/CMakeFiles/python3_common.dir/commonPYTHON_wrap.cxx:692:37: error: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Werror=sign-compare]
+      692 |     for (cast = head; (cast - head) <= head->value; cast++) {
+	  |                       ~~~~~~~~~~~~~~^~~~~~~~~~~~~~
+
+The cause is a bug in Swig-4.4.1 <https://github.com/swig/swig/issues/3323>.
+The bug is triggered by adding -Wextra -Werror to all compiler invocation,
+stricter GCC, and building on 32-bit platforms where a ptrdiff_t type
+has the same rank as the int type.
+
+This patch works around the compiler warning by only applying the
+-Werror option to code we maintain. Particullary, not applying to
+Swig-generated code. In my opinion, this is more sustainable approach
+than adding -Wno-warn-... exceptions to bindings/CMakeLists.txt
+whenever the C++ compiler or Swig changes.
+
+Resolve: https://bugzilla.redhat.com/show_bug.cgi?id=2434767
+---
+ CMakeLists.txt      | 2 +-
+ src/CMakeLists.txt  | 1 +
+ test/CMakeLists.txt | 3 ++-
+ 3 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 05c4080..d7d961e 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -24,7 +24,7 @@ include(GNUInstallDirs)
+ find_package(PkgConfig REQUIRED)
+ pkg_check_modules(YAMLCPP REQUIRED yaml-cpp)
+ 
+-add_compile_options(-Wall -Wextra -Werror)
++add_compile_options(-Wall -Wextra)
+ 
+ include_directories("${PROJECT_SOURCE_DIR}/include")
+ 
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 8ac7689..250f16b 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -3,6 +3,7 @@ file(GLOB_RECURSE libpkgmanifest_SOURCES *.cpp)
+ list(APPEND libpkgmanifest_PC_REQUIRES)
+ list(APPEND libpkgmanifest_PC_REQUIRES_PRIVATE)
+ 
++add_compile_options(-Werror)
+ include_directories(.)
+ 
+ add_library(libpkgmanifest SHARED ${libpkgmanifest_SOURCES})
+diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
+index 2eac730..a4e87d3 100644
+--- a/test/CMakeLists.txt
++++ b/test/CMakeLists.txt
+@@ -7,6 +7,7 @@ pkg_check_modules(GMOCK REQUIRED gmock)
+ 
+ file(GLOB_RECURSE TEST_libpkgmanifest_SOURCES *.cpp)
+ 
++add_compile_options(-Werror)
+ include_directories(.)
+ include_directories(${PROJECT_SOURCE_DIR}/include)
+ include_directories(${PROJECT_SOURCE_DIR}/src)
+@@ -22,4 +23,4 @@ set_property(TEST tests_libpkgmanifest PROPERTY ENVIRONMENT
+     "PROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}"
+ )
+ 
+-add_subdirectory("python")
+\ No newline at end of file
++add_subdirectory("python")
+-- 
+2.52.0
+

diff --git a/libpkgmanifest.spec b/libpkgmanifest.spec
index 48a690b..afd73c7 100644
--- a/libpkgmanifest.spec
+++ b/libpkgmanifest.spec
@@ -20,6 +20,8 @@ Summary:    Library for working with RPM manifests
 License:    LGPL-2.1-or-later
 URL:        %{forgeurl}
 Source:     %{forgesource}
+# Fix building with GCC 16, bug #2434767, proposed upstream
+Patch1:     0001-build-Turn-compiler-warnings-into-errors-only-for-ou.patch
 
 BuildRequires:  pkgconf-pkg-config
 BuildRequires:  cmake >= 3.13
@@ -107,4 +109,4 @@ Python 3 bindings for the %{name} library.
 %cmake_install
 
 %changelog
-%autochangelog
\ No newline at end of file
+%autochangelog

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-11 15:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-11 15:54 [rpms/libpkgmanifest] epel10: Fix building with GCC 16 (bug #2434767) 

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox