NetBSD Problem Report #58857

From www@netbsd.org  Wed Nov 27 15:54:03 2024
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits)
	 client-signature RSA-PSS (2048 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 3D4AC1A9238
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 27 Nov 2024 15:54:03 +0000 (UTC)
Message-Id: <20241127155401.DDD4E1A923E@mollari.NetBSD.org>
Date: Wed, 27 Nov 2024 15:54:01 +0000 (UTC)
From: stephen@borrill.org.uk
Reply-To: stephen@borrill.org.uk
To: gnats-bugs@NetBSD.org
Subject: gcc10-libs REQUIRES libraries so it cannot be added wth new pkg_add
X-Send-Pr-Version: www-1.0

>Number:         58857
>Category:       pkg
>Synopsis:       gcc10-libs REQUIRES libraries so it cannot be added wth new pkg_add
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          analyzed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Nov 27 15:55:00 +0000 2024
>Closed-Date:    
>Last-Modified:  Sun Mar 16 23:52:02 +0000 2025
>Originator:     Stephen Borrill
>Release:        pkgsrc-2024Q3
>Organization:
Precedence Technologies Ltd
>Environment:
etBSD  9.4_STABLE NetBSD 9.4_STABLE (XEN3_DOMU) #0: Thu May 16 12:24:02 UTC 2024  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/xen/compile/XEN3_DOMU amd64
>Description:
On NetBSD 9.4 I'm doing a limited pkg bulk build.

mk.conf includes the follows to allow GCC 10 to be built and used:

.if \\
        empty(PKGPATH:Mdevel/gmake) && \\
        empty(PKGPATH:Mlang/gcc10) && \\
        empty(PKGPATH:Mlang/gcc10-libs) && \\
        empty(PKGPATH:Mlang/perl5) && \\
        empty(PKGPATH:Mpkgtools/cwrappers) && \\
        empty(PKGPATH:Mpkgtools/digest) && \\
        empty(PKGPATH:Mpkgtools/mktools) && \\
        empty(PKGPATH:Mtextproc/gsed)
GCC_REQD=10
.endif
PYTHON_VERSION_DEFAULT=312

Packages to build are:
editors/joe
net/chrony
net/rsync
shells/tcsh
sysutils/xe-guest-utilities

pbulk fails to build py312-flit_core with the following in depends.log:

pkg_add: Missing required library: /usr/pkg/gcc10//lib/./libgcc_s.so.1
pkg_add: Missing required library: /usr/pkg/gcc10//lib/./libquadmath.so.0
pkg_add: Missing required library: /usr/pkg/gcc10//lib/./libstdc++.so.7
pkg_add: Can't install dependency gcc10-libs>=10.2.0
pkg_add: Expected dependency gcc10-libs>=10.2.0 still missing
pkg_add: Can't install dependency libffi>=3.4.2nb3
pkg_add: Expected dependency libffi>=3.4.2nb3 still missing
pkg_add: 1 package addition failed

This is in response to running:
PKG_PATH=/usr/pkgsrc/packages.base/All /usr/pkg_bulk/sbin/pkg_add -K /usr/pkg/pkgdb digest-20220214 mktools-20220614 cwrappers-20220403 python312-3.12.6

More specifically, this is when trying to install the gcc10-libs package with pkg_add bootstrapped by pbulk:

# PKG_PATH=/usr/pkgsrc/packages.base/All /usr/pkg_bulk/sbin/pkg_add -K /usr/pkg/pkgdb gcc10-libs
pkg_add: Missing required library: /usr/pkg/gcc10//lib/./libgcc_s.so.1
pkg_add: Missing required library: /usr/pkg/gcc10//lib/./libquadmath.so.0
pkg_add: Missing required library: /usr/pkg/gcc10//lib/./libstdc++.so.7
pkg_add: 1 package addition failed

pkg_add in base adds it just fine:
# PKG_PATH=/usr/pkgsrc/packages.base/All /usr/sbin/pkg_add -K /usr/pkg/pkgdb gcc10-libs
# echo $?
0

Versions as follows:
# /usr/pkg_bulk/sbin/pkg_add -V
20240826

# /usr/sbin/pkg_add -V
20201218

pkg_info -B gcc10-libs shows:

REQUIRES=/usr/pkg/gcc10//lib/./libgcc_s.so.1
REQUIRES=/usr/pkg/gcc10//lib/./libquadmath.so.0
REQUIRES=/usr/pkg/gcc10//lib/./libstdc++.so.7

This is also the same in TNF bulk builds, e.g. http://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/9.4/All/gcc10-libs-10.5.0nb3.tgz

It appears therefore that successful bulk builds only work if one of the following is true:

1) using old pkg_install
2) using pkg_install in base
3) GCC_REQD=10 is not being set

For some reason, this seems to be particularly triggered by packages that depend on python

>How-To-Repeat:
1) bootstrap pbulk from pkgsrc-2024Q3 on NetBSD 9.4
2) Add the mk.conf fragment above to switch to GCC 10
3) Bulk build a restricted pkg list that includes a package that depends on python e.g. devel/py-flit_core

>Fix:
No fix

>Release-Note:

>Audit-Trail:
From: Thomas Klausner <wiz@NetBSD.org>
To: NetBSD bugtracking <gnats-bugs@NetBSD.org>
Cc: 
Subject: Re: pkg/58857: gcc10-libs REQUIRES libraries so it cannot be added
 wth new pkg_add
Date: Wed, 27 Nov 2024 22:27:00 +0100

 On Wed, Nov 27, 2024 at 03:55:00PM +0000, stephen@borrill.org.uk wrote:
 > >Number:         58857
 > >Category:       pkg
 > >Synopsis:       gcc10-libs REQUIRES libraries so it cannot be added wth new pkg_add

 This is a known problem, see https://mail-index.netbsd.org/tech-pkg/2024/08/30/msg029859.html

 A workaround is to install the gcc10 (not gcc10-libs) package, but the
 proper fix is to change the gcc1*-libs packages so the paths to the
 libraries are correct.
  Thomas

From: Stephen Borrill <stephen@borrill.org.uk>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/58857: gcc10-libs REQUIRES libraries so it cannot be added
 wth new pkg_add
Date: Thu, 28 Nov 2024 08:24:08 +0000

 I note that the thread here also discusses this issue:
 https://mail-index.netbsd.org/tech-pkg/2024/10/18/msg030005.html

 Specifically there is a partial patch, but I can confirm that as stated 
 it does not fix the REQUIRES problem:

 https://mail-index.netbsd.org/tech-pkg/2024/10/30/msg030034.html

 -- 
 Stephen

State-Changed-From-To: open->analyzed
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Sun, 16 Mar 2025 23:52:02 +0000
State-Changed-Why:
I committed a workaround back in January:

https://mail-index.netbsd.org/pkgsrc-changes/2025/01/07/msg313956.html

The underlying problem breaking the REQUIRES for gcc10-libs is:

PR pkg/58966: mk: REQUIRES/PROVIDES analysis is wrong for self-libraries
https://gnats.netbsd.org/58966

The workaround was pulled up to pkgsrc-2024Q4:

https://releng.netbsd.org/cgi-bin/req-pkgsrc.cgi?show=6928

We still need to properly fix the REQUIRES line rather than paper over
it with this workaround, though, so I'll leave this in state `analyzed'
until then.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2025 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.