From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 572B615808D for ; Sat, 23 Apr 2022 09:53:13 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4C9EAE08F0; Sat, 23 Apr 2022 09:53:12 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 51B44E08F0 for ; Sat, 23 Apr 2022 09:53:11 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2B1F3341932 for ; Sat, 23 Apr 2022 09:53:10 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 9A099318 for ; Sat, 23 Apr 2022 09:53:08 +0000 (UTC) From: "Hans de Graaff" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Hans de Graaff" Message-ID: <1650707525.78c5e6bb96842f6ab7eb5e6bf4c86360797f2564.graaff@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/ruby/, dev-lang/ruby/files/3.1/, dev-lang/ruby/files/3.0/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-lang/ruby/files/3.0/901-musl-stacksize.patch dev-lang/ruby/files/3.1/900-musl-coroutine.patch dev-lang/ruby/ruby-3.0.4.ebuild dev-lang/ruby/ruby-3.1.2.ebuild X-VCS-Directories: dev-lang/ruby/ dev-lang/ruby/files/3.1/ dev-lang/ruby/files/3.0/ X-VCS-Committer: graaff X-VCS-Committer-Name: Hans de Graaff X-VCS-Revision: 78c5e6bb96842f6ab7eb5e6bf4c86360797f2564 X-VCS-Branch: master Date: Sat, 23 Apr 2022 09:53:08 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 4401eef2-1512-4c5d-88a0-e44f7d969393 X-Archives-Hash: 0db943e0c4f08375d9f38b0b02e1597f commit: 78c5e6bb96842f6ab7eb5e6bf4c86360797f2564 Author: Hans de Graaff gentoo org> AuthorDate: Sat Apr 23 09:52:05 2022 +0000 Commit: Hans de Graaff gentoo org> CommitDate: Sat Apr 23 09:52:05 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=78c5e6bb dev-lang/ruby: copy patches to adhere to ruby lang policy We keep patch sets per version, even if the patches can be applied as-is, to keep things manageable. Signed-off-by: Hans de Graaff gentoo.org> dev-lang/ruby/files/3.0/901-musl-stacksize.patch | 26 +++++++++++++++ dev-lang/ruby/files/3.1/900-musl-coroutine.patch | 41 ++++++++++++++++++++++++ dev-lang/ruby/ruby-3.0.4.ebuild | 2 +- dev-lang/ruby/ruby-3.1.2.ebuild | 2 +- 4 files changed, 69 insertions(+), 2 deletions(-) diff --git a/dev-lang/ruby/files/3.0/901-musl-stacksize.patch b/dev-lang/ruby/files/3.0/901-musl-stacksize.patch new file mode 100644 index 000000000000..e5fcfce2195e --- /dev/null +++ b/dev-lang/ruby/files/3.0/901-musl-stacksize.patch @@ -0,0 +1,26 @@ +musl has a conservative stacksize, as compared to glibc, so treat it +like other systems with such stacksize + +diff --git a/thread_pthread.c b/thread_pthread.c +index 951885ffa0..e2d662143b 100644 +--- a/thread_pthread.c ++++ b/thread_pthread.c +@@ -721,7 +721,7 @@ ruby_init_stack(volatile VALUE *addr + { + native_main_thread.id = pthread_self(); + +-#if MAINSTACKADDR_AVAILABLE ++#if MAINSTACKADDR_AVAILABLE && !(defined(__linux__) && !defined(__GLIBC__)) + if (native_main_thread.stack_maxsize) return; + { + void* stackaddr; +@@ -1680,7 +1680,7 @@ ruby_stack_overflowed_p(const rb_thread_t *th, const void *addr) + + #ifdef STACKADDR_AVAILABLE + if (get_stack(&base, &size) == 0) { +-# ifdef __APPLE__ ++# if defined(__APPLE__) || (defined(__linux__) && !defined(__GLIBC__)) + if (pthread_equal(th->thread_id, native_main_thread.id)) { + struct rlimit rlim; + if (getrlimit(RLIMIT_STACK, &rlim) == 0 && rlim.rlim_cur > size) { + diff --git a/dev-lang/ruby/files/3.1/900-musl-coroutine.patch b/dev-lang/ruby/files/3.1/900-musl-coroutine.patch new file mode 100644 index 000000000000..ed47c54e29c7 --- /dev/null +++ b/dev-lang/ruby/files/3.1/900-musl-coroutine.patch @@ -0,0 +1,41 @@ +Adapted for Gentoo version 2.7.4 + +From b570e7de87aaad8c903176d835e8124127f627b3 Mon Sep 17 00:00:00 2001 +From: Andrew Aladjev +Date: Sat, 26 Sep 2020 12:58:06 +0300 +Subject: [PATCH] fixed default coroutine selection for musl + +--- + configure.ac | 5 ++++- + coroutine/copy/Context.c | 2 ++ + 2 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index ab5d532c103b..084f0936c006 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -2364,7 +2364,10 @@ + rb_cv_coroutine=copy + ], + [*], [ +- rb_cv_coroutine=ucontext ++ AC_CHECK_FUNCS([getcontext swapcontext makecontext], ++ [rb_cv_coroutine=ucontext], ++ [rb_cv_coroutine=copy; break] ++ ) + ] + ) + AC_MSG_RESULT(${rb_cv_coroutine}) +diff --git a/coroutine/copy/Context.c b/coroutine/copy/Context.c +index c1b4144e9857..94a7f57f7d89 100644 +--- a/coroutine/copy/Context.c ++++ b/coroutine/copy/Context.c +@@ -5,6 +5,8 @@ + * Copyright, 2019, by Samuel Williams. + */ + ++#include ++ + #include "Context.h" + + // http://gcc.gnu.org/onlinedocs/gcc/Alternate-Keywords.html diff --git a/dev-lang/ruby/ruby-3.0.4.ebuild b/dev-lang/ruby/ruby-3.0.4.ebuild index 9f2844fcd073..bc7abb7b0e17 100644 --- a/dev-lang/ruby/ruby-3.0.4.ebuild +++ b/dev-lang/ruby/ruby-3.0.4.ebuild @@ -69,7 +69,7 @@ src_prepare() { if use elibc_musl ; then eapply "${FILESDIR}"/3.0/900-musl-*.patch - eapply "${FILESDIR}"/2.7/901-musl-*.patch + eapply "${FILESDIR}"/3.0/901-musl-*.patch fi einfo "Unbundling gems..." diff --git a/dev-lang/ruby/ruby-3.1.2.ebuild b/dev-lang/ruby/ruby-3.1.2.ebuild index 4d6261c67b20..df0d23d2bc16 100644 --- a/dev-lang/ruby/ruby-3.1.2.ebuild +++ b/dev-lang/ruby/ruby-3.1.2.ebuild @@ -68,7 +68,7 @@ src_prepare() { eapply "${FILESDIR}"/"${SLOT}"/010*.patch if use elibc_musl ; then - eapply "${FILESDIR}"/2.7/901-musl-*.patch + eapply "${FILESDIR}"/3.1/901-musl-*.patch fi einfo "Unbundling gems..."