From nobody Tue Jan 10 21:01:43 2023
X-Original-To: freebsd-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 4Ns3C36YCCz2pDvK
	for <freebsd-python@mlmmj.nyi.freebsd.org>; Tue, 10 Jan 2023 21:01:35 +0000 (UTC)
	(envelope-from mizhka@gmail.com)
Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK))
	by mx1.freebsd.org (Postfix) with ESMTPS id 4Ns3C323ysz3Cpk
	for <freebsd-python@freebsd.org>; Tue, 10 Jan 2023 21:01:35 +0000 (UTC)
	(envelope-from mizhka@gmail.com)
Authentication-Results: mx1.freebsd.org;
	dkim=pass header.d=gmail.com header.s=20210112 header.b=LEd9kwY3;
	spf=pass (mx1.freebsd.org: domain of mizhka@gmail.com designates 2a00:1450:4864:20::233 as permitted sender) smtp.mailfrom=mizhka@gmail.com;
	dmarc=pass (policy=none) header.from=gmail.com
Received: by mail-lj1-x233.google.com with SMTP id y18so10359715ljk.11
        for <freebsd-python@freebsd.org>; Tue, 10 Jan 2023 13:01:35 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20210112;
        h=to:subject:message-id:date:from:mime-version:from:to:cc:subject
         :date:message-id:reply-to;
        bh=z25+RAFD+7wVZWrR5s7Aw6W7eDYz8HarOYbc/By7jBo=;
        b=LEd9kwY3ARKM1Owza23OvhTFGIt6OJCdBI8DZS8DeHcXDOR9dsL30cyBH3Dc3bVwe6
         VWU7rB3OdlsauxIF1qplgl53k2RHdFOaEc1+ov0RAqvMCLdAZBaT3W2jryTTRZysUSrW
         C1zZqeZVQgEJtcaJPgyM6yoSNSut0rkTVgpPMTDFjvBuLr/X2fgeKcTMBvfKQcoRO4gp
         m9SqkvRAvt8L2zzeu5AJrLoFlyIbu/TwaGjZV920AMvc4ZCB7aki4jizcHbmnrL4vNQC
         WH3Yxpw3L4R/S3ZcsjkRv1rQbmswDMeiuxKJKLyW2UY+XedGYW8qvKIZiZ1Te0/MUD64
         ulwg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20210112;
        h=to:subject:message-id:date:from:mime-version:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=z25+RAFD+7wVZWrR5s7Aw6W7eDYz8HarOYbc/By7jBo=;
        b=wwN9QAWxQQL8eZ9gh3RrN9IQsdLf02xIo1c4anWGbc95Oup6guXMNIfQx0xd8T5wZu
         lQmkPRcQOtfi9Te5u7GGCHaKNFwgn6IC/vWPpP6fHHDxLkR0/Wi/hCSfPuollJ6vBqbH
         R9mSG67wzGKR0PAjdE6g8FTfCdr/m/BC4jgmW5mqltVPuGN12ity4YRq7SPTY+8uyNNN
         FJVcLk4LOKv2ShDrtTXjHkY6fY5/3dWx7i7YO9gczeYYRXLx5ltZcHQ6tzg6xpMR3SkD
         0D+PnXOO7zErEFgu/mKV1uCIIEYsLdhLDC6Q5de1BjzYw6aLlRz3mZ3FnjXBJzgXELJO
         q4VA==
X-Gm-Message-State: AFqh2kovp6LPG01U6wcusyeh2mg6l0exhtRrIa6Z98ltCPB9+LpEHPJc
	jT0b6UuHUlTOIzp4y/pKOAs9jGc5UY8Dk7taoUV3zgbpfk8=
X-Google-Smtp-Source: AMrXdXsjHOFbNEVGo1mN4lTha3nXp3strGChLyEX1S9rhg2ZvDyMyPetYZwOT24wVwM6bM8GEm0OyIYsaCzpyJ8AKk4=
X-Received: by 2002:a2e:9d89:0:b0:27f:ee1b:770b with SMTP id
 c9-20020a2e9d89000000b0027fee1b770bmr1329585ljj.65.1673384493012; Tue, 10 Jan
 2023 13:01:33 -0800 (PST)
List-Id: FreeBSD-specific Python issues <freebsd-python.freebsd.org>
List-Archive: https://lists.freebsd.org/archives/freebsd-python
List-Help: <mailto:python+help@freebsd.org>
List-Post: <mailto:python@freebsd.org>
List-Subscribe: <mailto:python+subscribe@freebsd.org>
List-Unsubscribe: <mailto:python+unsubscribe@freebsd.org>
Sender: owner-freebsd-python@freebsd.org
X-BeenThere: freebsd-python@freebsd.org
MIME-Version: 1.0
From: Michael Zhilin <mizhka@gmail.com>
Date: Wed, 11 Jan 2023 00:01:43 +0300
Message-ID: <CAF19XBKVL=1CdJHsYC1-WZwX7Gvop7Zjv3aADHCx5eoW9rAz_w@mail.gmail.com>
Subject: PYTHON_EXT_SUFFIX value for shared libraries, pyc files and others
To: freebsd-python@freebsd.org
Content-Type: multipart/alternative; boundary="000000000000475ceb05f1ef30ac"
X-Spamd-Result: default: False [-2.20 / 15.00];
	NEURAL_HAM_MEDIUM(-1.00)[-1.000];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	NEURAL_SPAM_SHORT(0.80)[0.796];
	DMARC_POLICY_ALLOW(-0.50)[gmail.com,none];
	R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c];
	R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112];
	MIME_GOOD(-0.10)[multipart/alternative,text/plain];
	FROM_HAS_DN(0.00)[];
	FREEFALL_USER(0.00)[mizhka];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	PREVIOUSLY_DELIVERED(0.00)[freebsd-python@freebsd.org];
	RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::233:from];
	RCPT_COUNT_ONE(0.00)[1];
	FREEMAIL_FROM(0.00)[gmail.com];
	ARC_NA(0.00)[];
	DWL_DNSWL_NONE(0.00)[gmail.com:dkim];
	DKIM_TRACE(0.00)[gmail.com:+];
	MID_RHS_MATCH_FROMTLD(0.00)[];
	TO_DN_NONE(0.00)[];
	MLMMJ_DEST(0.00)[freebsd-python@freebsd.org];
	FROM_EQ_ENVFROM(0.00)[];
	MIME_TRACE(0.00)[0:+,1:+,2:~];
	RCVD_TLS_LAST(0.00)[];
	ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US];
	FREEMAIL_ENVFROM(0.00)[gmail.com];
	RCVD_COUNT_TWO(0.00)[2]
X-Rspamd-Queue-Id: 4Ns3C323ysz3Cpk
X-Spamd-Bar: --
X-ThisMailContainsUnwantedMimeParts: N

--000000000000475ceb05f1ef30ac
Content-Type: text/plain; charset="UTF-8"

Hi,

I have a problem with PYTHON_EXT_SUFFIX when I try to build ports
(including python) with the option WITH_DEBUG.

I want to build subset of ports with WITH_DEBUG by poudriere, but several
python package builds have failed on phase "package" due to missing
artifacts. The root cause of failure is that ports uses same macro
PYTHON_EXT_SUFFIX for shared libraries and pyc files, but actual file names
have different suffixes:
 - pyc files have the suffix ".cpython-39" as expected.
 - so files have the suffix ".cpython-39d".

The "d" is ${PYTHON_ABIVER} and actual ABI flags of Python build. According
to Python specifications, all pyc files must have a suffix without ABI
flags. Shared libraries have suffixes with ABI flags, but I didn't find any
spec about it.

For instance, port gobject-introspection contains pyc files like:

/usr/local/lib/gobject-introspection/giscanner/__pycache__/testcodegen.cpython-39.pyc
and shared library like:
   /usr/local/lib/gobject-introspection/giscanner/_giscanner.cpython-39d.so

The first idea came to me is to add an extra suffix PYTHON_EXTSO_SUFFIX
with value ".cpython-${PYTHON_SUFFIX}${PYTHON_ABIVER}". It's easy to add it
and replace all occurrences in pkg-plist and Makefile, but it may be hard
to maintain it in future.

Any thoughts?

Thanks,
Michael.

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

<div dir=3D"ltr"><div>Hi,</div><div><br></div><div>I have a problem with PY=
THON_EXT_SUFFIX when I try to build ports (including python) with the optio=
n WITH_DEBUG.</div><div><br></div><div>I want to build subset of ports with=
 WITH_DEBUG by poudriere, but several python package builds have failed on =
phase &quot;package&quot; due to missing artifacts. The root cause of failu=
re is that ports uses same macro PYTHON_EXT_SUFFIX for shared libraries and=
 pyc files, but actual file names have different suffixes:<br></div><div>=
=C2=A0- pyc files have the suffix &quot;.cpython-39&quot; as expected. <br>=
</div><div>=C2=A0- so files have the suffix &quot;.cpython-39d&quot;. <br><=
/div><div><br></div><div>The &quot;d&quot; is ${PYTHON_ABIVER} and actual A=
BI flags of Python build. According to Python specifications, all pyc files=
 must have a suffix without ABI flags. Shared libraries have suffixes with =
ABI flags, but I didn&#39;t find any spec about it.</div><div><br></div><di=
v>For instance, port gobject-introspection contains pyc files like:</div><d=
iv>=C2=A0=C2=A0 /usr/local/lib/gobject-introspection/giscanner/__pycache__/=
testcodegen.cpython-39.pyc</div><div>and shared library like:</div><div>=C2=
=A0=C2=A0 /usr/local/lib/gobject-introspection/giscanner/_<a href=3D"http:/=
/giscanner.cpython-39d.so">giscanner.cpython-39d.so</a><br></div><div><br><=
/div><div>The first idea came to me is to add an extra suffix PYTHON_EXTSO_=
SUFFIX with value &quot;.cpython-${PYTHON_SUFFIX}${PYTHON_ABIVER}&quot;. It=
&#39;s easy to add it and replace all occurrences in pkg-plist and Makefile=
, but it may be hard to maintain it in future. <br></div><div><br></div><di=
v>Any thoughts?</div><div><br></div><div>Thanks, <br></div><div>Michael.<br=
></div><div><br></div></div>

--000000000000475ceb05f1ef30ac--