devel/py-importlib-metadata and devel.py-build have circular dependencies when building with python3.7, because of this in devel/py-build: .if ${PYTHON_REL} < 30800 RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}importlib-metadata>=0.22:devel/py-importlib-metadata@${PY_FLAVOR} .endif Now that py-importlib-metadata has USE_PYTHON=pep517 (committed Feb 3, 2023), it now depends on py-build.
Add yuri@ (committed pep517 update). Making USE_PYTHON conditional on PYTHON_REL (USE_PYTHON=distutils for < 3.8 and pep517 for >= 3.8) is not easy since USE_PYTHON wants to be defined before the pre-makefile parts (and PYTHON_REL is not defined until after).
Will fix this shortly, thanks.
Fix committed, thanks for the report.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=d6583d67b69dbf690e6f102e1aec799cb7fd564a commit d6583d67b69dbf690e6f102e1aec799cb7fd564a Author: Yuri Victorovich <yuri@FreeBSD.org> AuthorDate: 2023-02-06 02:52:52 +0000 Commit: Yuri Victorovich <yuri@FreeBSD.org> CommitDate: 2023-02-06 02:54:51 +0000 devel/py-importlib-metadata: Fix circular dependency problem ... introduced by USE_PYTHON=pep517. PR: 269363 Reported by: John Hein <jcfyecrayz@liamekaens.com> devel/py-importlib-metadata/Makefile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
Note to revert this after devel/py-build drops the now-incorrect setuptools dependency.
Thanks for the quick workaround. Another way to fix this might be to build py-importlib-metadata with a copy of py-build (and any other dependencies that are needed but cannot be installed due to any circular deps) in the py-importlib-metadata WRKDIR (instead of requiring a fully installed py-build pkg). If that could be done without too much trouble, then py-importlib-metadata could be built with pep517 methods for py37.
(In reply to John Hein from comment #6) Not necessary. The chief problem with Python ports in general right now is setuptools being specified as an unconditional RUN_DEPENDS. As soon as such is remedied, a whole class of issues like this one goes away.
(In reply to Charlie Li from comment #7) Ok. I don't see how that (removing setuptools dependency) will fix the circular dependency when py-importlib-metadata has to call 'python37 -m build ...' to build it the pep517 way. But I certainly don't fully have a grip on the maze of complex nuance between setuptools/distutils/pep517 yet.
Using poudriere, I'm still getting a circular dependency: [00:02:26] Error: Dependency loop detected: These packages depend on each other: py39-keyring-23.9.3_2,1 py39-importlib-metadata-6.0.0_1 py39-wheel-0.38.4 [00:02:26] Cleaning up [00:02:26] Unmounting file systems
Interesting. I can't reproduce this: $ sudo run-one-in-poudriere-13-amd64 -C devel/py-importlib-metadata security/py-keyring devel/py-wheel cp: /usr/ports/-C: No such file or directory [00:00:00] Creating the reference jail... done [00:00:00] Mounting system devices for 13amd64-local-workstation [00:00:00] Mounting ports/packages/distfiles [00:00:00] Stashing existing package repository [00:00:00] Mounting packages from: /usr/local/poudriere/data/packages/13amd64-local-workstation [00:00:00] Appending to make.conf: /usr/local/etc/poudriere.d/13amd64-make.conf /etc/resolv.conf -> /usr/local/poudriere/data/.m/13amd64-local-workstation/ref/etc/resolv.conf [00:00:00] Starting jail 13amd64-local-workstation [00:00:00] Will build as nobody: (65534:65534) [00:00:01] Logs: /usr/local/poudriere/data/logs/bulk/13amd64-local-workstation/2023-02-06_20h12m24s [00:00:01] Loading MOVED for /usr/local/poudriere/data/.m/13amd64-local-workstation/ref/usr/ports [00:00:03] Ports supports: FLAVORS SELECTED_OPTIONS [00:00:03] Gathering ports metadata [00:00:03] Calculating ports order and dependencies [00:00:03] (-C) Cleaning specified packages to build [00:00:03] (-C) Will delete existing package: py39-wheel-0.38.4.pkg [00:00:03] (-C) Will delete existing package: py39-importlib-metadata-6.0.0_1.pkg [00:00:03] (-C) Will delete existing package: py39-keyring-23.9.3_2,1.pkg [00:00:03] (-C) Flushing package deletions [00:00:04] Sanity checking the repository [00:00:04] Checking packages for incremental rebuild needs [00:00:07] Deleting stale symlinks... done [00:00:07] Deleting empty directories... done [00:00:07] Cleaning the build queue [00:00:07] Sanity checking build queue [00:00:07] Processing PRIORITY_BOOST [00:00:07] Balancing pool [00:00:07] Recording filesystem state for prepkg... done [00:00:07] Building 3 packages using 3 builders [00:00:07] Starting/Cloning builders [00:00:07] Hit CTRL+t at any time to see build progress and stats [00:00:07] [01] [00:00:00] Building devel/py-wheel@py39 | py39-wheel-0.38.4 [00:00:18] [01] [00:00:11] Finished devel/py-wheel@py39 | py39-wheel-0.38.4: Success [00:00:18] [01] [00:00:00] Building devel/py-importlib-metadata@py39 | py39-importlib-metadata-6.0.0_1 [00:00:29] [01] [00:00:11] Finished devel/py-importlib-metadata@py39 | py39-importlib-metadata-6.0.0_1: Success [00:00:29] [01] [00:00:00] Building security/py-keyring@py39 | py39-keyring-23.9.3_2,1 [00:00:43] [01] [00:00:14] Finished security/py-keyring@py39 | py39-keyring-23.9.3_2,1: Success [00:00:43] Stopping 3 builders 13amd64-local-workstation-job-01: removed 13amd64-local-workstation-job-02: removed 13amd64-local-workstation-job-01-n: removed 13amd64-local-workstation-job-02-n: removed 13amd64-local-workstation-job-03: removed 13amd64-local-workstation-job-03-n: removed [00:00:44] Committing packages to repository: /usr/local/poudriere/data/packages/13amd64-local-workstation/.real_1675743188 via .latest symlink [00:00:44] Removing old packages [00:00:44] Built ports: devel/py-wheel devel/py-importlib-metadata security/py-keyring [13amd64-local-workstation] [2023-02-06_20h12m24s] [committing:] Queued: 3 Built: 3 Failed: 0 Skipped: 0 Ignored: 0 Tobuild: 0 Time: 00:00:43 [00:00:44] Logs: /usr/local/poudriere/data/logs/bulk/13amd64-local-workstation/2023-02-06_20h12m24s [00:00:44] Cleaning up 13amd64-local-workstation: removed 13amd64-local-workstation-n: removed [00:00:44] Unmounting file systems What might be different for you?
Solved it by deleting the /usr/local/poudriere.d/options/ directories for those ports. My build is working again. The options were very old, from python37. Thank you for your patience, though.
The the circular dependency problem with poudriere is still an issue: [00:00:14] Error: Dependency loop detected: These packages depend on each other: py38-importlib-metadata-6.0.0_1 py38-wheel-0.38.4 py38-keyring-23.9.3_2,1 [00:00:14] Cleaning up [00:00:14] Unmounting file systems [tburns@repo2 /usr/local/etc/poudriere.d/131-options]$ cat devel_py-wheel/options # This file is auto-generated by 'make config'. # Options for py38-wheel-0.38.4 _OPTIONS_READ=py38-wheel-0.38.4 _FILE_COMPLETE_OPTIONS_LIST=PIP SIGNATURE OPTIONS_FILE_UNSET+=PIP OPTIONS_FILE_SET+=SIGNATURE It has something to do with the signature option in py-wheel. I unset the signature option and got it to build.
I am still experiencing this circular dependency after verifying SIGNATURE=off for devel/py-wheel and rebuilding it. What other diagnostic information shall I produce?
The devel/py-typing-extensions bit should be fixed with ports e7a9ba1fecd9. For this port, since generating and executing a fake/temporary setup.py is not optimal, the best course of action is to engage upstream in switching the build backend to flit, so that flit_core can build the wheel itself.
(In reply to Charlie Li from comment #14) Thank you, Charlie. I can confirm that I am now able to build the set of Python ports that are relevant to my needs against 3.7. For the purposes of this bug, I harbor lingering curiosity about why a circular dependency among three ports could not be solved by any one of them.
(In reply to tburns from comment #12) For those that are find a different circular dependency than the one originally described in this bug, please open a new bug. The py-importlib-metadata + py-wheel + py-keyring circular dependency described in comment 12, for instance, is different.