public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH 0/4] python eclasses: PyPy3.10 update + cargo LTO strip-flags
@ 2023-07-12 12:22 Michał Górny
  2023-07-12 12:22 ` [gentoo-dev] [PATCH 1/4] python-utils-r1.eclass: Require >=dev-python/pypy3-7.3.12 Michał Górny
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Michał Górny @ 2023-07-12 12:22 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

Hi,

Here's a quick patchset on top of vimproved's patchset to remove
`--reflink=auto` calls from the eclasses.  It does two things:

1. Update the eclass to assume PyPy3.10 (and therefore cease supporting
   PyPy3.9 as a target).

2. Strip LTO flags when distutils-r1 is used with cargo.eclass.

The second commit is a bit hacky but I think it's a good enough approach
that doesn't require us to strip LTO unconditionally or add yet another
control variable to tell the eclass if we're dealing with Rust or not.



Michał Górny (4):
  python-utils-r1.eclass: Require >=dev-python/pypy3-7.3.12
  python-utils-r1.eclass: pypy3 is now 3.10-only
  distutils-r1.eclass: Update addpredict for PyPy3.10
  distutils-r1.eclass: Disable LTO when using cargo.eclass

 eclass/distutils-r1.eclass    | 9 ++++++++-
 eclass/python-utils-r1.eclass | 7 +++----
 2 files changed, 11 insertions(+), 5 deletions(-)

-- 
2.41.0



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [gentoo-dev] [PATCH 1/4] python-utils-r1.eclass: Require >=dev-python/pypy3-7.3.12
  2023-07-12 12:22 [gentoo-dev] [PATCH 0/4] python eclasses: PyPy3.10 update + cargo LTO strip-flags Michał Górny
@ 2023-07-12 12:22 ` Michał Górny
  2023-07-12 12:22 ` [gentoo-dev] [PATCH 2/4] python-utils-r1.eclass: pypy3 is now 3.10-only Michał Górny
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Michał Górny @ 2023-07-12 12:22 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
 eclass/python-utils-r1.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 40c15b65d7a5..81051699f1d9 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -454,7 +454,7 @@ _python_export() {
 					python3.12)
 						PYTHON_PKG_DEP=">=dev-lang/python-3.12.0_beta3:3.12";;
 					pypy3)
-						PYTHON_PKG_DEP='>=dev-python/pypy3-7.3.11_p1:0=';;
+						PYTHON_PKG_DEP='>=dev-python/pypy3-7.3.12:0=';;
 					*)
 						die "Invalid implementation: ${impl}"
 				esac
-- 
2.41.0



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-dev] [PATCH 2/4] python-utils-r1.eclass: pypy3 is now 3.10-only
  2023-07-12 12:22 [gentoo-dev] [PATCH 0/4] python eclasses: PyPy3.10 update + cargo LTO strip-flags Michał Górny
  2023-07-12 12:22 ` [gentoo-dev] [PATCH 1/4] python-utils-r1.eclass: Require >=dev-python/pypy3-7.3.12 Michał Górny
@ 2023-07-12 12:22 ` Michał Górny
  2023-07-12 12:22 ` [gentoo-dev] [PATCH 3/4] distutils-r1.eclass: Update addpredict for PyPy3.10 Michał Górny
  2023-07-12 12:22 ` [gentoo-dev] [PATCH 4/4] distutils-r1.eclass: Disable LTO when using cargo.eclass Michał Górny
  3 siblings, 0 replies; 7+ messages in thread
From: Michał Górny @ 2023-07-12 12:22 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
 eclass/python-utils-r1.eclass | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 81051699f1d9..a395538be39c 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -238,12 +238,11 @@ _python_impl_matches() {
 				fi
 				return 0
 				;;
-			3.9|3.10)
-				# <pypy3-7.3.12 is 3.9, >=7.3.12 is 3.10
+			3.10)
 				[[ ${impl} == python${pattern/./_} || ${impl} == pypy3 ]] &&
 					return 0
 				;;
-			3.8|3.1[1-2])
+			3.8|3.9|3.1[1-2])
 				[[ ${impl} == python${pattern/./_} ]] && return 0
 				;;
 			*)
-- 
2.41.0



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-dev] [PATCH 3/4] distutils-r1.eclass: Update addpredict for PyPy3.10
  2023-07-12 12:22 [gentoo-dev] [PATCH 0/4] python eclasses: PyPy3.10 update + cargo LTO strip-flags Michał Górny
  2023-07-12 12:22 ` [gentoo-dev] [PATCH 1/4] python-utils-r1.eclass: Require >=dev-python/pypy3-7.3.12 Michał Górny
  2023-07-12 12:22 ` [gentoo-dev] [PATCH 2/4] python-utils-r1.eclass: pypy3 is now 3.10-only Michał Górny
@ 2023-07-12 12:22 ` Michał Górny
  2023-07-12 12:22 ` [gentoo-dev] [PATCH 4/4] distutils-r1.eclass: Disable LTO when using cargo.eclass Michał Górny
  3 siblings, 0 replies; 7+ messages in thread
From: Michał Górny @ 2023-07-12 12:22 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
 eclass/distutils-r1.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 046277d0371c..924e83b54ad8 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -1718,7 +1718,7 @@ distutils-r1_python_install() {
 		# python likes to compile any module it sees, which triggers sandbox
 		# failures if some packages haven't compiled their modules yet.
 		addpredict "${EPREFIX}/usr/lib/${EPYTHON}"
-		addpredict "${EPREFIX}/usr/lib/pypy3.9"
+		addpredict "${EPREFIX}/usr/lib/pypy3.10"
 		addpredict "${EPREFIX}/usr/local" # bug 498232
 
 		if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
-- 
2.41.0



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-dev] [PATCH 4/4] distutils-r1.eclass: Disable LTO when using cargo.eclass
  2023-07-12 12:22 [gentoo-dev] [PATCH 0/4] python eclasses: PyPy3.10 update + cargo LTO strip-flags Michał Górny
                   ` (2 preceding siblings ...)
  2023-07-12 12:22 ` [gentoo-dev] [PATCH 3/4] distutils-r1.eclass: Update addpredict for PyPy3.10 Michał Górny
@ 2023-07-12 12:22 ` Michał Górny
  2023-07-12 17:42   ` Ulrich Mueller
  3 siblings, 1 reply; 7+ messages in thread
From: Michał Górny @ 2023-07-12 12:22 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

Strip LTO flags when cargo.eclass is inherited.  This means that Rust
extensions are being built, and linking them with C/C++ style LTO
results in broken shared libraries.

Closes: https://bugs.gentoo.org/910220
Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
 eclass/distutils-r1.eclass | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 924e83b54ad8..5f2decaa89a3 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -191,6 +191,7 @@ esac
 if [[ -z ${_DISTUTILS_R1_ECLASS} ]]; then
 _DISTUTILS_R1_ECLASS=1
 
+inherit flag-o-matic
 inherit multibuild multilib multiprocessing ninja-utils toolchain-funcs
 
 if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
@@ -1836,6 +1837,12 @@ distutils-r1_run_phase() {
 		local -x CYTHON_FORCE_REGEN=1
 	fi
 
+	# Rust extensions are incompatible with C/C++ LTO compiler
+	# see e.g. https://bugs.gentoo.org/910220
+	if [[ ${_CARGO_ECLASS} ]]; then
+		filter-lto
+	fi
+
 	# How to build Python modules in different worlds...
 	local ldopts
 	case "${CHOST}" in
-- 
2.41.0



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [gentoo-dev] [PATCH 4/4] distutils-r1.eclass: Disable LTO when using cargo.eclass
  2023-07-12 12:22 ` [gentoo-dev] [PATCH 4/4] distutils-r1.eclass: Disable LTO when using cargo.eclass Michał Górny
@ 2023-07-12 17:42   ` Ulrich Mueller
  2023-07-12 17:48     ` Michał Górny
  0 siblings, 1 reply; 7+ messages in thread
From: Ulrich Mueller @ 2023-07-12 17:42 UTC (permalink / raw
  To: Michał Górny; +Cc: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 246 bytes --]

>>>>> On Wed, 12 Jul 2023, Michał Górny wrote:

> +	if [[ ${_CARGO_ECLASS} ]]; then
> +		filter-lto
> +	fi

Testing for an internal variable of another eclass seems less than
ideal. How about "has cargo ${INHERITED}" instead?

Ulrich

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 507 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-dev] [PATCH 4/4] distutils-r1.eclass: Disable LTO when using cargo.eclass
  2023-07-12 17:42   ` Ulrich Mueller
@ 2023-07-12 17:48     ` Michał Górny
  0 siblings, 0 replies; 7+ messages in thread
From: Michał Górny @ 2023-07-12 17:48 UTC (permalink / raw
  To: gentoo-dev

On Wed, 2023-07-12 at 19:42 +0200, Ulrich Mueller wrote:
> > > > > > On Wed, 12 Jul 2023, Michał Górny wrote:
> 
> > +	if [[ ${_CARGO_ECLASS} ]]; then
> > +		filter-lto
> > +	fi
> 
> Testing for an internal variable of another eclass seems less than
> ideal. How about "has cargo ${INHERITED}" instead?
> 

Sure, as long as it works.

-- 
Best regards,
Michał Górny



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-07-12 17:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-12 12:22 [gentoo-dev] [PATCH 0/4] python eclasses: PyPy3.10 update + cargo LTO strip-flags Michał Górny
2023-07-12 12:22 ` [gentoo-dev] [PATCH 1/4] python-utils-r1.eclass: Require >=dev-python/pypy3-7.3.12 Michał Górny
2023-07-12 12:22 ` [gentoo-dev] [PATCH 2/4] python-utils-r1.eclass: pypy3 is now 3.10-only Michał Górny
2023-07-12 12:22 ` [gentoo-dev] [PATCH 3/4] distutils-r1.eclass: Update addpredict for PyPy3.10 Michał Górny
2023-07-12 12:22 ` [gentoo-dev] [PATCH 4/4] distutils-r1.eclass: Disable LTO when using cargo.eclass Michał Górny
2023-07-12 17:42   ` Ulrich Mueller
2023-07-12 17:48     ` Michał Górny

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