public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-portage-dev] Fixing EAPI 8 --enable-static once and for all
@ 2022-11-19  3:12 David Seifert
  2022-11-19  3:12 ` [gentoo-portage-dev] [PATCH] Make EAPI 8 `--disable-static` logic libtool-specific David Seifert
  2022-11-19  8:33 ` [gentoo-portage-dev] Fixing EAPI 8 --enable-static once and for all Ulrich Mueller
  0 siblings, 2 replies; 5+ messages in thread
From: David Seifert @ 2022-11-19  3:12 UTC (permalink / raw
  To: gentoo-portage-dev

Attached a patch to finally fix https://bugs.gentoo.org/814380.

When I opened the bug, it was clear that I intended to only disable
static libtool archive building. Unfortunately, I hadn't done the
necessary due diligence, and it turns out how we detect the
"--enable-static" flag is overly broad and leads to a sizable number of
false positives in EAPI 8.

I have 937 EAPI 8 packages on my machine, and in 0 cases does my patch
now produce static libraries where none were produced before, while it
successfully reduces the annoying QA warnings on packages that don't use
libtool or use the flag for different purposes:

1. packages that have an "off-target"/false-positive flag triggering
   the current logic:

  dev-libs/nspr-4.35
    --enable-static-rtl     Use the MSVC static runtime library
  sys-fs/lvm2-2.03.16
    --enable-static_link    use this to link the tools to their libraries

2. packages with a real --{dis,en}able-static flag, but with semantics
   that don't actually disable building of static-libs:

  dev-util/strace-5.19
    --enable-static         link strace statically
  sys-process/htop-3.2.1
    --enable-static         build a static htop binary [default=no]
  media-video/mkvtoolnix-71.1.0
    --enable-static         make a static build of the applications (no)
    --enable-static-qt      link to static versions of the Qt library (no)

dev-util/strace has a $(use_enable static) option, and the other two are
default disabled. Hence in all of these cases, the patch does not change
the build output.

3. packages with a --{dis,en}able-static flag that controls building of
   static libraries, but with a slightly different --help output that
   doesn't trigger the updated glob anymore:

  dev-libs/icu-72.1
    --enable-static         build static libraries default=no
  dev-libs/nettle-3.8.1
    --disable-static        Do not build any static library
  net-print/cups-2.4.2
    --enable-static         install static libraries

All of these packages pass a $(use_enable static-libs static) option,
hence none of them would be affected by the missing --disable-static.

With this extensive analysis, I believe this patch to be safe.



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

* [gentoo-portage-dev] [PATCH] Make EAPI 8 `--disable-static` logic libtool-specific
  2022-11-19  3:12 [gentoo-portage-dev] Fixing EAPI 8 --enable-static once and for all David Seifert
@ 2022-11-19  3:12 ` David Seifert
  2022-11-19  8:33 ` [gentoo-portage-dev] Fixing EAPI 8 --enable-static once and for all Ulrich Mueller
  1 sibling, 0 replies; 5+ messages in thread
From: David Seifert @ 2022-11-19  3:12 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: David Seifert

* The intention has always been to only target `configure` scripts that use
  libtool, not just any script with a `--disable-static*` option.

* libtool has been using the same `configure` format for at least
  the past 15 years (going back to libtool 1.5.22):

  1. shared and static libraries enabled (the main use case):
       --enable-shared[=PKGS]  build shared libraries [default=yes]
       --enable-static[=PKGS]  build static libraries [default=yes]

  2. shared libraries enabled and static libraries disabled:
       --enable-static[=PKGS]  build static libraries [default=no]
       --enable-shared[=PKGS]  build shared libraries [default=yes]

  3. shared libraries disabled and static libraries enabled:
       --enable-shared[=PKGS]  build shared libraries [default=no]
       --enable-static[=PKGS]  build static libraries [default=yes]

Bug: https://bugs.gentoo.org/814380
---
 bin/phase-helpers.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 2217e5a0b..6f691f6ff 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -655,8 +655,8 @@ econf() {
 			fi
 
 			if ___eapi_econf_passes_--disable-static; then
-				if [[ ${conf_help} == *--disable-static* || \
-						${conf_help} == *--enable-static* ]]; then
+				if [[ ${conf_help} == *--enable-shared\[=PKGS\]* &&
+						${conf_help} == *--enable-static\[=PKGS\]* ]]; then
 					conf_args+=( --disable-static )
 				fi
 			fi
-- 
2.38.1



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

* Re: [gentoo-portage-dev] Fixing EAPI 8 --enable-static once and for all
  2022-11-19  3:12 [gentoo-portage-dev] Fixing EAPI 8 --enable-static once and for all David Seifert
  2022-11-19  3:12 ` [gentoo-portage-dev] [PATCH] Make EAPI 8 `--disable-static` logic libtool-specific David Seifert
@ 2022-11-19  8:33 ` Ulrich Mueller
  2022-11-19  9:46   ` Michał Górny
  2022-11-19 17:38   ` Mike Gilbert
  1 sibling, 2 replies; 5+ messages in thread
From: Ulrich Mueller @ 2022-11-19  8:33 UTC (permalink / raw
  To: David Seifert; +Cc: gentoo-portage-dev

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

>>>>> On Sat, 19 Nov 2022, David Seifert wrote:

> With this extensive analysis, I believe this patch to be safe.

Still looks like an incompatible change, so it will need an EAPI bump.

EAPI 9 feature bug is here: https://bugs.gentoo.org/815169

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

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

* Re: [gentoo-portage-dev] Fixing EAPI 8 --enable-static once and for all
  2022-11-19  8:33 ` [gentoo-portage-dev] Fixing EAPI 8 --enable-static once and for all Ulrich Mueller
@ 2022-11-19  9:46   ` Michał Górny
  2022-11-19 17:38   ` Mike Gilbert
  1 sibling, 0 replies; 5+ messages in thread
From: Michał Górny @ 2022-11-19  9:46 UTC (permalink / raw
  To: gentoo-portage-dev, David Seifert

On Sat, 2022-11-19 at 09:33 +0100, Ulrich Mueller wrote:
> > > > > > On Sat, 19 Nov 2022, David Seifert wrote:
> 
> > With this extensive analysis, I believe this patch to be safe.
> 
> Still looks like an incompatible change, so it will need an EAPI bump.
> 
> EAPI 9 feature bug is here: https://bugs.gentoo.org/815169

I dare say we've done worse retroactive changes.

-- 
Best regards,
Michał Górny



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

* Re: [gentoo-portage-dev] Fixing EAPI 8 --enable-static once and for all
  2022-11-19  8:33 ` [gentoo-portage-dev] Fixing EAPI 8 --enable-static once and for all Ulrich Mueller
  2022-11-19  9:46   ` Michał Górny
@ 2022-11-19 17:38   ` Mike Gilbert
  1 sibling, 0 replies; 5+ messages in thread
From: Mike Gilbert @ 2022-11-19 17:38 UTC (permalink / raw
  To: gentoo-portage-dev

On Sat, Nov 19, 2022 at 3:33 AM Ulrich Mueller <ulm@gentoo.org> wrote:
>
> >>>>> On Sat, 19 Nov 2022, David Seifert wrote:
>
> > With this extensive analysis, I believe this patch to be safe.
>
> Still looks like an incompatible change, so it will need an EAPI bump.
>
> EAPI 9 feature bug is here: https://bugs.gentoo.org/815169

I support this patch to fix Portage, regardless of what PMS says.
Coding to the spec doesn't make sense if the spec is broken.


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

end of thread, other threads:[~2022-11-19 17:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-19  3:12 [gentoo-portage-dev] Fixing EAPI 8 --enable-static once and for all David Seifert
2022-11-19  3:12 ` [gentoo-portage-dev] [PATCH] Make EAPI 8 `--disable-static` logic libtool-specific David Seifert
2022-11-19  8:33 ` [gentoo-portage-dev] Fixing EAPI 8 --enable-static once and for all Ulrich Mueller
2022-11-19  9:46   ` Michał Górny
2022-11-19 17:38   ` Mike Gilbert

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