NetBSD Problem Report #56785

From www@netbsd.org  Sun Apr 10 00:31:31 2022
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))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id B194D1A921F
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 10 Apr 2022 00:31:31 +0000 (UTC)
Message-Id: <20220410003130.8449E1A923B@mollari.NetBSD.org>
Date: Sun, 10 Apr 2022 00:31:30 +0000 (UTC)
From: you.kawasaki@gmail.com
Reply-To: you.kawasaki@gmail.com
To: gnats-bugs@NetBSD.org
Subject: Python 3.9 build fails with pkgsrc-2022Q1 on Linux
X-Send-Pr-Version: www-1.0

>Number:         56785
>Category:       pkg
>Synopsis:       Python 3.9 build fails with pkgsrc-2022Q1 on Linux
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Apr 10 00:35:00 +0000 2022
>Closed-Date:    Sun Jul 10 00:16:03 +0000 2022
>Last-Modified:  Sun Jul 10 00:16:03 +0000 2022
>Originator:     Yosuke Kawasaki
>Release:        pkgsrc-2022Q1
>Organization:
>Environment:
Debian linux 11.3 kernel 5.11.0 x86_64
>Description:
This problem appears to be similar to NetBSD Problem Report #56774.
The build of lang/python39 failed with the following error.

--- sharedmods ---
LD_LIBRARY_PATH=/var/pkg/work/lang/python39/work/Python-3.9.12 CC='cc -pthread' LDSHARED='cc -pthread -shared -L. -Wl,-zrelro -L/usr/lib64 -Wl,-R/usr/lib64 -L/var/pkg/lib -Wl,-
R/var/pkg/lib -Wl,-zrelro -L/usr/lib64 -Wl,-R/usr/lib64 -L/var/pkg/lib -Wl,-R/var/pkg/lib  ' OPT='-DNDEBUG -O2 -D_FORTIFY_SOURCE=2 -I/usr/include -I/var/pkg/include -I/var/pkg/
include/ncurses -I/var/pkg/include/db4'  _TCLTK_INCLUDES='' _TCLTK_LIBS=''  ./python -E ./setup.py  build
Traceback (most recent call last):
  File "/var/pkg/work/lang/python39/work/Python-3.9.12/./setup.py", line 17, in <module>
    import subprocess
ModuleNotFoundError: No module named 'subprocess'

>How-To-Repeat:
Run bmake in pkgsrc/lang/python39.
>Fix:
I found commenting out the following line from patch/patch-setup is effective in completing the build.

+sys.path = [p for p in sys.path if not re.compile('^' + sys.base_prefix + '/').match(p)]

Under my environment, this line makes the sys.path an empty list.
Moreover, it worked fine if I change "if not" to "if".

>Release-Note:

>Audit-Trail:
From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/56785: Python 3.9 build fails with pkgsrc-2022Q1 on Linux
Date: Thu, 21 Apr 2022 02:50:06 +0000

 On Sun, Apr 10, 2022 at 12:35:00AM +0000, you.kawasaki@gmail.com wrote:
  > I found commenting out the following line from patch/patch-setup is effective in completing the build.
  > 
  > +sys.path = [p for p in sys.path if not re.compile('^' + sys.base_prefix + '/').match(p)]
  >
  > Under my environment, this line makes the sys.path an empty list.
  > Moreover, it worked fine if I change "if not" to "if".

 What's in sys.base_prefix? Sounds like it's got some characters in it
 that make Python think it's an invalid regexp.

 There should probably be some kind of quoting operation on there to
 protect it.

 -- 
 David A. Holland
 dholland@netbsd.org

From: "David H. Gutteridge" <david@gutteridge.ca>
To: Gnats Bugs <gnats-bugs@netbsd.org>
Cc: 
Subject: Re: pkg/56785: Python 3.9 build fails with pkgsrc-2022Q1 on Linux
Date: Wed, 20 Apr 2022 23:36:14 -0400

 FWIW, I'm not able to reproduce this on Fedora Linux 35. In my case,
 it's an unprivileged build that installs under my home directory.

 Dave

From: Yosuke Kawasaki <you.kawasaki@gmail.com>
To: gnats-bugs@netbsd.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org
Subject: Re: pkg/56785: Python 3.9 build fails with pkgsrc-2022Q1 on Linux
Date: Sun, 24 Apr 2022 06:45:05 +0900

 --0000000000003a066205dd5942fa
 Content-Type: text/plain; charset="UTF-8"
 Content-Transfer-Encoding: quoted-printable

 Following are sys.base_prefix and sys.path under my build environment.

 sys.base_prefix:/var/pkg
 sys.path:['/var/pkg/work/lang/python39/work/Python-3.9.12',
 '/var/pkg/lib/python39.zip',
 '/var/pkg/work/lang/python39/work/Python-3.9.12/Lib',
 '/var/pkg/work/lang/python39/work/Python-3.9.12/build/lib.linux-x86_64-3.9'=
 ,
 '/var/pkg/lib/python3.9/site-packages']

 My PREFIX is /var/pkg and WRKOBJDIR is /var/pkg/work.
 The patched operation "sys.path =3D [p for p..." removes all the sys.path
 members.

 It seems that the patched operation should keep paths under WRKOBJDIR in
 sys.path.
 When I disabled WRKOBJDIR setting, the build finished without problem.

 Best regards,

 Yosuke

 2022=E5=B9=B44=E6=9C=8821=E6=97=A5(=E6=9C=A8) 11:55 David Holland <dholland=
 -pbugs@netbsd.org>:

 > The following reply was made to PR pkg/56785; it has been noted by GNATS.
 >
 > From: David Holland <dholland-pbugs@netbsd.org>
 > To: gnats-bugs@netbsd.org
 > Cc:
 > Subject: Re: pkg/56785: Python 3.9 build fails with pkgsrc-2022Q1 on Linu=
 x
 > Date: Thu, 21 Apr 2022 02:50:06 +0000
 >
 >  On Sun, Apr 10, 2022 at 12:35:00AM +0000, you.kawasaki@gmail.com wrote:
 >   > I found commenting out the following line from patch/patch-setup is
 > effective in completing the build.
 >   >
 >   > +sys.path =3D [p for p in sys.path if not re.compile('^' +
 > sys.base_prefix + '/').match(p)]
 >   >
 >   > Under my environment, this line makes the sys.path an empty list.
 >   > Moreover, it worked fine if I change "if not" to "if".
 >
 >  What's in sys.base_prefix? Sounds like it's got some characters in it
 >  that make Python think it's an invalid regexp.
 >
 >  There should probably be some kind of quoting operation on there to
 >  protect it.
 >
 >  --
 >  David A. Holland
 >  dholland@netbsd.org
 >
 >

 --=20
 Yosuke Kawasaki

 you.kawasaki@gmail.com

 --0000000000003a066205dd5942fa
 Content-Type: text/html; charset="UTF-8"
 Content-Transfer-Encoding: quoted-printable

 <div dir=3D"ltr"><div>Following are sys.base_prefix and sys.path under my b=
 uild environment.</div><div><br></div><div>sys.base_prefix:/var/pkg<br>sys.=
 path:[&#39;/var/pkg/work/lang/python39/work/Python-3.9.12&#39;, &#39;/var/p=
 kg/lib/python39.zip&#39;, &#39;/var/pkg/work/lang/python39/work/Python-3.9.=
 12/Lib&#39;, &#39;/var/pkg/work/lang/python39/work/Python-3.9.12/build/lib.=
 linux-x86_64-3.9&#39;, &#39;/var/pkg/lib/python3.9/site-packages&#39;]</div=
 ><div><br></div><div>My PREFIX is /var/pkg and WRKOBJDIR is /var/pkg/work.<=
 /div><div>The patched operation &quot;sys.path =3D [p for p...&quot; remove=
 s all the sys.path members.</div><div><br></div><div>It seems that the patc=
 hed operation should keep paths under WRKOBJDIR in sys.path.</div><div><div=
 >When I disabled WRKOBJDIR setting, the build finished without problem.<br>=
 </div></div><div><br></div><div>Best regards,</div><div><br></div><div>Yosu=
 ke<br></div><div><br></div><div><div class=3D"gmail_quote"><div dir=3D"ltr"=
  class=3D"gmail_attr">2022=E5=B9=B44=E6=9C=8821=E6=97=A5(=E6=9C=A8) 11:55 D=
 avid Holland &lt;<a href=3D"mailto:dholland-pbugs@netbsd.org" target=3D"_bl=
 ank">dholland-pbugs@netbsd.org</a>&gt;:<br></div><blockquote class=3D"gmail=
 _quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204=
 ,204);padding-left:1ex">The following reply was made to PR pkg/56785; it ha=
 s been noted by GNATS.<br>
 <br>
 From: David Holland &lt;<a href=3D"mailto:dholland-pbugs@netbsd.org" target=
 =3D"_blank">dholland-pbugs@netbsd.org</a>&gt;<br>
 To: <a href=3D"mailto:gnats-bugs@netbsd.org" target=3D"_blank">gnats-bugs@n=
 etbsd.org</a><br>
 Cc: <br>
 Subject: Re: pkg/56785: Python 3.9 build fails with pkgsrc-2022Q1 on Linux<=
 br>
 Date: Thu, 21 Apr 2022 02:50:06 +0000<br>
 <br>
 =C2=A0On Sun, Apr 10, 2022 at 12:35:00AM +0000, <a href=3D"mailto:you.kawas=
 aki@gmail.com" target=3D"_blank">you.kawasaki@gmail.com</a> wrote:<br>
 =C2=A0 &gt; I found commenting out the following line from patch/patch-setu=
 p is effective in completing the build.<br>
 =C2=A0 &gt; <br>
 =C2=A0 &gt; +sys.path =3D [p for p in sys.path if not re.compile(&#39;^&#39=
 ; + sys.base_prefix + &#39;/&#39;).match(p)]<br>
 =C2=A0 &gt;<br>
 =C2=A0 &gt; Under my environment, this line makes the sys.path an empty lis=
 t.<br>
 =C2=A0 &gt; Moreover, it worked fine if I change &quot;if not&quot; to &quo=
 t;if&quot;.<br>
 <br>
 =C2=A0What&#39;s in sys.base_prefix? Sounds like it&#39;s got some characte=
 rs in it<br>
 =C2=A0that make Python think it&#39;s an invalid regexp.<br>
 <br>
 =C2=A0There should probably be some kind of quoting operation on there to<b=
 r>
 =C2=A0protect it.<br>
 <br>
 =C2=A0-- <br>
 =C2=A0David A. Holland<br>
 =C2=A0<a href=3D"mailto:dholland@netbsd.org" target=3D"_blank">dholland@net=
 bsd.org</a><br>
 <br>
 </blockquote></div></div><br clear=3D"all"><br>-- <br><div dir=3D"ltr" data=
 -smartmail=3D"gmail_signature"><div dir=3D"ltr"><div>Yosuke Kawasaki</div><=
 div><br></div><div><a href=3D"mailto:you.kawasaki@gmail.com" target=3D"_bla=
 nk">you.kawasaki@gmail.com</a><br></div><div><p class=3D"MsoNormal" style=
 =3D"margin-top:1.2pt;line-height:12.0pt"><br></p></div></div></div></div>

 --0000000000003a066205dd5942fa--

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/56785: Python 3.9 build fails with pkgsrc-2022Q1 on Linux
Date: Sun, 15 May 2022 04:50:54 +0000

 On Sat, Apr 23, 2022 at 09:50:01PM +0000, Yosuke Kawasaki wrote:
  >  My PREFIX is /var/pkg and WRKOBJDIR is /var/pkg/work.
  >  The patched operation "sys.path =3D [p for p..." removes all the sys.path
  >  members.

 Ah, that makes sense.

 I don't think that particular combination is officially unsupported,
 but it's ... not usual, and you may run into other problems because of
 it.

 If you don't mind dealing with that, feel free to report any other
 problems you run into. If you don't want to bother, the path of least
 resistance is to put WRKOBJDIR somewhere else.

 -- 
 David A. Holland
 dholland@netbsd.org

State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sun, 10 Jul 2022 00:16:03 +0000
State-Changed-Why:
Duplicate of 56774.

It seems that even though this report has an analysis and 56774 didn't,
someone tracked down 56774 this week and fixed it, and it turns out to
have been the same.

So, it's now fixed...


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.