public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rust-cbindgen] epel9: Workaround cbindgen#1129
@ 2026-06-04 17:36 Paul Murphy
  0 siblings, 0 replies; only message in thread
From: Paul Murphy @ 2026-06-04 17:36 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/rust-cbindgen
            Branch : epel9
            Commit : 3ce9439d1136b9347991ff22788c4da95160232b
            Author : Paul Murphy <murp@redhat.com>
            Date   : 2026-02-25T15:23:31-06:00
            Stats  : +33/-0 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/rust-cbindgen/c/3ce9439d1136b9347991ff22788c4da95160232b?branch=epel9

            Log:
            Workaround cbindgen#1129

test_body fails with a warning-as-error. I think this warning is
valid, but it is probably OK to ignore while testing. The failing
test, test_body validates user supplied C/C++ code snippets can
be appended to various constructs.

The choice of snippet is what causes the warning. It exposes a subtle
limitation of cbindgen which is now caught as a warning by gcc 16.

It should be safe to ignore the warning as test_body is about the
correct insertion of the snippets, not the correctness of the snippet.

---
diff --git a/0001-Ignore-non-c-typedef-for-linkage-warnings-during-tes.patch b/0001-Ignore-non-c-typedef-for-linkage-warnings-during-tes.patch
new file mode 100644
index 0000000..8af5e0d
--- /dev/null
+++ b/0001-Ignore-non-c-typedef-for-linkage-warnings-during-tes.patch
@@ -0,0 +1,32 @@
+From 62286d431428dcc66f4008fef976dfc95637c9b1 Mon Sep 17 00:00:00 2001
+From: Paul Murphy <murp@redhat.com>
+Date: Wed, 25 Feb 2026 19:56:56 +0000
+Subject: [PATCH] Ignore non-c-typedef-for-linkage warnings during testing
+
+test_body is meant to verify insertion of user supplied code
+snippets. cbindgen does this correctly. However, the snippets
+expose a previously subtle limitation of cbindgen which gcc 16
+now warns about.
+
+This is a temporary workaround for cbindgen#1129.
+---
+ tests/tests.rs | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/tests/tests.rs b/tests/tests.rs
+index 459c3cf..79ef920 100644
+--- a/tests/tests.rs
++++ b/tests/tests.rs
+@@ -174,6 +174,9 @@ fn compile(
+                 command.arg("-std=c++17");
+                 // Prevents warnings when compiling .c files as c++.
+                 command.arg("-x").arg("c++");
++                // Ignore gcc 16+ warning from test_body caused by user inserted code.
++                command.arg("-Wno-non-c-typedef-for-linkage");
++
+                 if let Ok(extra_flags) = env::var("CXXFLAGS") {
+                     command.args(extra_flags.split_whitespace());
+                 }
+-- 
+2.53.0
+

diff --git a/rust-cbindgen.spec b/rust-cbindgen.spec
index d6e2169..0387c1a 100644
--- a/rust-cbindgen.spec
+++ b/rust-cbindgen.spec
@@ -14,6 +14,7 @@ Source:         %{crates_source}
 # Manually created patch for downstream crate metadata changes
 # * bump serial_test dev-dependency from 2.0 to 3.1
 Patch:          cbindgen-fix-metadata.diff
+Patch:          0001-Ignore-non-c-typedef-for-linkage-warnings-during-tes.patch
 
 BuildRequires:  cargo-rpm-macros >= 24
 %if %{with check}

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

only message in thread, other threads:[~2026-06-04 17:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-04 17:36 [rpms/rust-cbindgen] epel9: Workaround cbindgen#1129 Paul Murphy

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