public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Hans de Graaff <graaff@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: Hans de Graaff <graaff@gentoo.org>
Subject: [gentoo-dev] [PATCH] ruby-fakegem.eclass: compile ruby31 extensions with gnu17
Date: Sun,  8 Dec 2024 11:53:54 +0100	[thread overview]
Message-ID: <20241208105354.26044-1-graaff@gentoo.org> (raw)

The varargs implementation in Ruby 3.2 is not compatible with gnu23. Ruby
3.1 is in security maintenance mode upstream so it is unlikely that the
fixes from Ruby 3.2 will be backported. Ruby 3.1 is EOL in March 2025
and will be removed from Gentoo around that time.

Signed-off-by: Hans de Graaff <graaff@gentoo.org>
---
 eclass/ruby-fakegem.eclass | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/eclass/ruby-fakegem.eclass b/eclass/ruby-fakegem.eclass
index eb6257a50cf9..fc78428be714 100644
--- a/eclass/ruby-fakegem.eclass
+++ b/eclass/ruby-fakegem.eclass
@@ -23,6 +23,8 @@ case ${EAPI} in
 	*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
+# flag-o-matic is only required for ruby31 support.
+inherit flag-o-matic
 inherit ruby-ng
 
 # @ECLASS_VARIABLE: RUBY_FAKEGEM_NAME
@@ -424,6 +426,16 @@ EOF
 each_fakegem_configure() {
 	debug-print-function ${FUNCNAME} "$@"
 
+	# Ruby 3.1 has a varargs implementation that is not compatible with
+	# gnu23. Ruby 3.1 is EOL in March 2025 and will be removed shortly
+	# after that.
+	case ${RUBY} in
+		*ruby31)
+			append-flags -std=gnu17
+			filter-flags -std=gnu23
+			;;
+	esac
+
 	tc-export PKG_CONFIG
 	for extension in "${RUBY_FAKEGEM_EXTENSIONS[@]}" ; do
 		CC=$(tc-getCC) ${RUBY} --disable=did_you_mean -C ${extension%/*} ${extension##*/} --with-cflags="${CFLAGS}" --with-ldflags="${LDFLAGS}" ${RUBY_FAKEGEM_EXTENSION_OPTIONS} || die
-- 
2.45.2



             reply	other threads:[~2024-12-08 10:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-08 10:53 Hans de Graaff [this message]
2024-12-09  5:51 ` [gentoo-dev] [PATCH] ruby-fakegem.eclass: compile ruby31 extensions with gnu17 Sam James

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=20241208105354.26044-1-graaff@gentoo.org \
    --to=graaff@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.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