public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Paul Murphy <murp@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/rust-cbindgen] epel10.2: Workaround cbindgen#1129
Date: Thu, 04 Jun 2026 17:17:10 GMT	[thread overview]
Message-ID: <178059343089.1.14207959795688946356.rpms-rust-cbindgen-3ce9439d1136@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/rust-cbindgen
            Branch : epel10.2
            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=epel10.2

            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}

                 reply	other threads:[~2026-06-04 17:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178059343089.1.14207959795688946356.rpms-rust-cbindgen-3ce9439d1136@fedoraproject.org \
    --to=murp@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox