From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1545769-garchives=archives.gentoo.org@lists.gentoo.org>
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 0819815800A
	for <garchives@archives.gentoo.org>; Mon, 14 Aug 2023 16:39:58 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id C4F0E2BC02C;
	Mon, 14 Aug 2023 16:39:56 +0000 (UTC)
Received: from smtp.gentoo.org (woodpecker.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))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id A9EC62BC02C
	for <gentoo-commits@lists.gentoo.org>; Mon, 14 Aug 2023 16:39:56 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id DEB46335DC2
	for <gentoo-commits@lists.gentoo.org>; Mon, 14 Aug 2023 16:39:55 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 7AD7DFA4
	for <gentoo-commits@lists.gentoo.org>; Mon, 14 Aug 2023 16:39:54 +0000 (UTC)
From: "Ionen Wolkens" <ionen@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Ionen Wolkens" <ionen@gentoo.org>
Message-ID: <1692031165.c431dd7010566a91baa4e3aa3b138d8249e67a7d.ionen@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/wine-staging/
X-VCS-Repository: repo/gentoo
X-VCS-Files: app-emulation/wine-staging/wine-staging-8.0.ebuild app-emulation/wine-staging/wine-staging-8.11-r1.ebuild app-emulation/wine-staging/wine-staging-8.12.ebuild app-emulation/wine-staging/wine-staging-8.13.ebuild app-emulation/wine-staging/wine-staging-9999.ebuild
X-VCS-Directories: app-emulation/wine-staging/
X-VCS-Committer: ionen
X-VCS-Committer-Name: Ionen Wolkens
X-VCS-Revision: c431dd7010566a91baa4e3aa3b138d8249e67a7d
X-VCS-Branch: master
Date: Mon, 14 Aug 2023 16:39:54 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 4547a8c7-ba15-4285-9e8b-05e3b75e0a29
X-Archives-Hash: 0ab49b711b24f4776dc740ab82fa36fd

commit:     c431dd7010566a91baa4e3aa3b138d8249e67a7d
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 14 13:50:35 2023 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Mon Aug 14 16:39:25 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c431dd70

app-emulation/wine-staging: "allow" USE=-mingw with clang for latest

Quotes given that is only if EXTRA_ECONF is used.

Explored the idea to support it (after bug #912237 is fixed),
and while it works for a basic setup, getting the ebuild *right*
for all configurations quickly got messy and not sure want the
increased maintenance.

To outline some thoughts:
1. USE=-mingw with clang is different than with gcc, gcc won't build
PE files (old layout) while clang needs it (--enable-archs). Meaning
would need a flag to mirror USE=mingw like USE=pe-clang to apply
similar logic with flags, stripping, and other verifications.
-> automagic depending on tc-is-clang is *possible*, but then can't
have e.g. wow64? ( || ( pe-clang mingw ) ) and need to have more
heuristics-based logic

2. test-flags-* cannot be used with `-target *-windows` given there
won't be any runtime (wine does early tests differently), albeit
*could* fallback to a safe CROSSFLAGS="-g -O2" or so

3. not sure want to deal with every future issues with clang cross
no top of mingw's and, on that note, clang-17 is currently broken
with USE=-mingw given don't believe can safely strip -mabi=ms as a
workaround if cross actually gets used

4. there are a lot of combinations to potentially handle, aka
gcc+mingw, gcc w/o mingw, clang w/o mingw, clang+mingw, gcc+pe-clang,
and some of these with either bfd or lld, and with or without 32bit...
And this is turning rather messy and Wine is already kind of fragile
and tracking runtime issues is difficult

5. ...ideally would want to reduce this by forcing mingw even with gcc
(like wine-proton) to simplify, not add more -- albeit if add clang PE
support then it should likely be combined with dropping non-PE support
to balance (i.e. could require clang with USE=-mingw)

6. wine with clang is less tested by distros, users, and well, me
(hardly even try USE=-mingw builds+runtime anymore as-is, including
with gcc), and feel it's better not pretend to support it

Not excluding revisiting, albeit would rather not deal with this at
the moment.

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 app-emulation/wine-staging/wine-staging-8.0.ebuild     |  8 ++++----
 app-emulation/wine-staging/wine-staging-8.11-r1.ebuild |  8 ++++----
 app-emulation/wine-staging/wine-staging-8.12.ebuild    |  8 ++++----
 app-emulation/wine-staging/wine-staging-8.13.ebuild    | 12 ++++++++----
 app-emulation/wine-staging/wine-staging-9999.ebuild    | 12 ++++++++----
 5 files changed, 28 insertions(+), 20 deletions(-)

diff --git a/app-emulation/wine-staging/wine-staging-8.0.ebuild b/app-emulation/wine-staging/wine-staging-8.0.ebuild
index 913b48dd933e..66827fdc086d 100644
--- a/app-emulation/wine-staging/wine-staging-8.0.ebuild
+++ b/app-emulation/wine-staging/wine-staging-8.0.ebuild
@@ -204,12 +204,12 @@ src_prepare() {
 	if tc-is-clang; then
 		if use mingw; then
 			# -mabi=ms was ignored by <clang:16 then turned error in :17
-			# and it still gets used in install phase despite USE=mingw,
-			# drop as a quick fix for now which hopefully should be safe
+			# if used without --target *-windows, then gets used in install
+			# phase despite USE=mingw, drop as a quick fix for now
 			sed -i '/MSVCRTFLAGS=/s/-mabi=ms//' configure.ac || die
 		else
-			# known broken due to bug #912237, require mingw for now
-			die "building ${PN} with clang requires USE=mingw to be enabled"
+			# ./configure will fail, abort early
+			die "building ${PN} with clang is only supported with USE=mingw"
 		fi
 	fi
 

diff --git a/app-emulation/wine-staging/wine-staging-8.11-r1.ebuild b/app-emulation/wine-staging/wine-staging-8.11-r1.ebuild
index 099bf613a54c..67326eaf843f 100644
--- a/app-emulation/wine-staging/wine-staging-8.11-r1.ebuild
+++ b/app-emulation/wine-staging/wine-staging-8.11-r1.ebuild
@@ -217,12 +217,12 @@ src_prepare() {
 	if tc-is-clang; then
 		if use mingw; then
 			# -mabi=ms was ignored by <clang:16 then turned error in :17
-			# and it still gets used in install phase despite USE=mingw,
-			# drop as a quick fix for now which hopefully should be safe
+			# if used without --target *-windows, then gets used in install
+			# phase despite USE=mingw, drop as a quick fix for now
 			sed -i '/MSVCRTFLAGS=/s/-mabi=ms//' configure.ac || die
 		else
-			# known broken due to bug #912237, require mingw for now
-			die "building ${PN} with clang requires USE=mingw to be enabled"
+			# ./configure will fail, abort early
+			die "building ${PN} with clang is only supported with USE=mingw"
 		fi
 	fi
 

diff --git a/app-emulation/wine-staging/wine-staging-8.12.ebuild b/app-emulation/wine-staging/wine-staging-8.12.ebuild
index 099bf613a54c..67326eaf843f 100644
--- a/app-emulation/wine-staging/wine-staging-8.12.ebuild
+++ b/app-emulation/wine-staging/wine-staging-8.12.ebuild
@@ -217,12 +217,12 @@ src_prepare() {
 	if tc-is-clang; then
 		if use mingw; then
 			# -mabi=ms was ignored by <clang:16 then turned error in :17
-			# and it still gets used in install phase despite USE=mingw,
-			# drop as a quick fix for now which hopefully should be safe
+			# if used without --target *-windows, then gets used in install
+			# phase despite USE=mingw, drop as a quick fix for now
 			sed -i '/MSVCRTFLAGS=/s/-mabi=ms//' configure.ac || die
 		else
-			# known broken due to bug #912237, require mingw for now
-			die "building ${PN} with clang requires USE=mingw to be enabled"
+			# ./configure will fail, abort early
+			die "building ${PN} with clang is only supported with USE=mingw"
 		fi
 	fi
 

diff --git a/app-emulation/wine-staging/wine-staging-8.13.ebuild b/app-emulation/wine-staging/wine-staging-8.13.ebuild
index 7141425288ae..d93f2f74f1f5 100644
--- a/app-emulation/wine-staging/wine-staging-8.13.ebuild
+++ b/app-emulation/wine-staging/wine-staging-8.13.ebuild
@@ -230,12 +230,16 @@ src_prepare() {
 	if tc-is-clang; then
 		if use mingw; then
 			# -mabi=ms was ignored by <clang:16 then turned error in :17
-			# and it still gets used in install phase despite USE=mingw,
-			# drop as a quick fix for now which hopefully should be safe
+			# if used without --target *-windows, then gets used in install
+			# phase despite USE=mingw, drop as a quick fix for now
 			sed -i '/MSVCRTFLAGS=/s/-mabi=ms//' configure.ac || die
 		else
-			# known broken due to bug #912237, require mingw for now
-			die "building ${PN} with clang requires USE=mingw to be enabled"
+			# fails in ./configure unless --enable-archs is passed, allow to
+			# bypass with EXTRA_ECONF but is currently considered unsupported
+			# (by Gentoo) as additional work is needed for (proper) support
+			# note: also fails w/ :17, but unsure if safe to drop w/o mingw
+			[[ ${EXTRA_ECONF} == *--enable-archs* ]] ||
+				die "building ${PN} with clang is only supported with USE=mingw"
 		fi
 	fi
 

diff --git a/app-emulation/wine-staging/wine-staging-9999.ebuild b/app-emulation/wine-staging/wine-staging-9999.ebuild
index 7141425288ae..d93f2f74f1f5 100644
--- a/app-emulation/wine-staging/wine-staging-9999.ebuild
+++ b/app-emulation/wine-staging/wine-staging-9999.ebuild
@@ -230,12 +230,16 @@ src_prepare() {
 	if tc-is-clang; then
 		if use mingw; then
 			# -mabi=ms was ignored by <clang:16 then turned error in :17
-			# and it still gets used in install phase despite USE=mingw,
-			# drop as a quick fix for now which hopefully should be safe
+			# if used without --target *-windows, then gets used in install
+			# phase despite USE=mingw, drop as a quick fix for now
 			sed -i '/MSVCRTFLAGS=/s/-mabi=ms//' configure.ac || die
 		else
-			# known broken due to bug #912237, require mingw for now
-			die "building ${PN} with clang requires USE=mingw to be enabled"
+			# fails in ./configure unless --enable-archs is passed, allow to
+			# bypass with EXTRA_ECONF but is currently considered unsupported
+			# (by Gentoo) as additional work is needed for (proper) support
+			# note: also fails w/ :17, but unsure if safe to drop w/o mingw
+			[[ ${EXTRA_ECONF} == *--enable-archs* ]] ||
+				die "building ${PN} with clang is only supported with USE=mingw"
 		fi
 	fi