From nobody Tue Jul 13 02:25:36 2021 X-Original-To: python@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 9A63511E5AE0 for ; Tue, 13 Jul 2021 02:25:36 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GP4HN3gQNz3hNp for ; Tue, 13 Jul 2021 02:25:36 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 62BF71A416 for ; Tue, 13 Jul 2021 02:25:36 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 16D2Pajx080087 for ; Tue, 13 Jul 2021 02:25:36 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 16D2PaqF080086 for python@FreeBSD.org; Tue, 13 Jul 2021 02:25:36 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: python@FreeBSD.org Subject: [Bug 257041] [NEW PORT]: devel/py-lief: Parse, modify and abstract ELF, PE and MachO formats. Date: Tue, 13 Jul 2021 02:25:36 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: feature, needs-patch, needs-qa X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: loader@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: ports-bugs@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: FreeBSD-specific Python issues List-Archive: https://lists.freebsd.org/archives/freebsd-python List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-python@freebsd.org X-BeenThere: freebsd-python@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D257041 Fukang Chen changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |loader@FreeBSD.org --- Comment #6 from Fukang Chen --- It's unable to generate a correct ${_PYTHONPKGLIST} with USE_PYTHON=3Dautop= list=20 # make check-plist =3D=3D=3D=3D> Checking for pkg-plist issues (check-plist) =3D=3D=3D> Parsing plist =3D=3D=3D> Checking for items in STAGEDIR missing from pkg-plist Error: Orphaned: %%PYTHON_SITELIBDIR%%/lief%%PYTHON_EXT_SUFFIX%%.so =3D=3D=3D> Checking for items in pkg-plist which are not in STAGEDIR Error: Missing: %%PYTHON_SITELIBDIR%%/.11.5/lief%%PYTHON_EXT_SUFFIX%%.so =3D=3D=3D> Error: Plist issues found. *** Error code 1 Stop. make: stopped in /usr/ports/devel/py-lief There's a weird path in ${_PYTHONPKGLIST}: /usr/local/lib/python3.8/site-packages/.11.5/lief.cpython-38.so The weird path was caused by _mutate_outputs() in distutils/command/install_lib.py: https://github.com/python/cpython/blob/v3.8.10/Lib/distutils/command/instal= l_lib.py#L143-L156 143 def _mutate_outputs(self, has_any, build_cmd, cmd_option, output_dir): 144 if not has_any: 145 return [] 146 147 build_cmd =3D self.get_finalized_command(build_cmd) 148 build_files =3D build_cmd.get_outputs() 149 build_dir =3D getattr(build_cmd, cmd_option) 150 151 prefix_len =3D len(build_dir) + len(os.sep) 152 outputs =3D [] 153 for file in build_files: 154 outputs.append(os.path.join(output_dir, file[prefix_len= :])) 155 156 return outputs on my 14.0-CURRENT aarch64: build_dir =3D> build/lib.freebsd-14.0-CURRENT-arm64-3.8 file =3D> /usr/ports/devel/py-lief/work-py38/LIEF-0.11.5/lief.cpython-38.so prefix_len =3D> len(build_dir) + len(os.sep) =3D> 40 + 1 =3D> 41 file[prefix_len:] =3D> .11.5/lief.cpython-38.so output_dir =3D> /usr/ports/devel/py-lief/work-py38/stage/usr/local/lib/python3.8/site-packa= ges/ os.path.join(output_dir, file[prefix_len:]) =3D> /usr/ports/devel/py-lief/work-py38/stage/usr/local/lib/python3.8/site-packa= ges/.11.5/lief.cpython-38.so It looks like we are supposed to get a file name build/lib.freebsd-14.0-CURRENT-arm64-3.8/lief.cpython-38.so instead of=20 /usr/ports/devel/py-lief/work-py38/LIEF-0.11.5/lief.cpython-38.so https://github.com/python/cpython/blob/v3.8.10/Lib/distutils/command/build_= ext.py#L637-L664 637 # -- Name generators ----------------------------------------------- 638 # (extension names, filenames, whatever) 639 def get_ext_fullpath(self, ext_name): 640 """Returns the path of the filename for a given extension. 641 642 The file is located in `build_lib` or directly in the packa= ge 643 (inplace option). 644 """ 645 fullname =3D self.get_ext_fullname(ext_name) 646 modpath =3D fullname.split('.') 647 filename =3D self.get_ext_filename(modpath[-1]) 648 649 if not self.inplace: 650 # no further work needed 651 # returning : 652 # build_dir/package/path/filename 653 filename =3D os.path.join(*modpath[:-1]+[filename]) 654 return os.path.join(self.build_lib, filename) 655 656 # the inplace option requires to find the package directory 657 # using the build_py command for that 658 package =3D '.'.join(modpath[0:-1]) 659 build_py =3D self.get_finalized_command('build_py') 660 package_dir =3D os.path.abspath(build_py.get_package_dir(package)) 661 662 # returning 663 # package_dir/filename 664 return os.path.join(package_dir, filename) inplace =3D=3D 0 get_ext_fullpath(ext.name) =3D>=20 build/lib.freebsd-14.0-CURRENT-arm64-3.8/lief.cpython-38.so inplace =3D=3D 1 get_ext_fullpath(ext.name) =3D>=20 /usr/ports/devel/py-lief/work-py38/LIEF-0.11.5/lief.cpython-38.so We could change the inlpace value to 0 in ${WRKSRC}/setup.cfg, this should make USE_PYTHON=3Dautoplist work: post-patch: @${REINPLACE_CMD} -e 's|^inplace=3D1|inplace=3D0|' ${WRKSRC}/setup.= cfg --=20 You are receiving this mail because: You are on the CC list for the bug.=