Bug 270788 - devel/libgusb-0.3.10_1: Build failure on FreeBSD 13.2 - ModuleNotFoundError: No module named 'pkg_resources'
Summary: devel/libgusb-0.3.10_1: Build failure on FreeBSD 13.2 - ModuleNotFoundError: ...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-12 14:22 UTC by Fredrik Eriksson
Modified: 2023-04-12 18:25 UTC (History)
2 users (show)

See Also:


Attachments
build log for libgusb-0.3.10_1 (35.89 KB, text/plain)
2023-04-12 14:22 UTC, Fredrik Eriksson
no flags Details
Patch (698 bytes, patch)
2023-04-12 17:06 UTC, Matthew Wener
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fredrik Eriksson 2023-04-12 14:22:40 UTC
Created attachment 241438 [details]
build log for libgusb-0.3.10_1

When i let poudriere build packages for 13.2 (amd64) the build for devel/libgusb fails with the following message:

[ 52% 13/25] /usr/local/bin/python3.9 /wrkdirs/usr/ports/devel/libgusb/work/libgusb-0.3.10/contrib/generate-version-script.py LIBGUSB gusb/GUsb-1.0.gir gusb/libgusb.ver
FAILED: gusb/libgusb.ver
/usr/local/bin/python3.9 /wrkdirs/usr/ports/devel/libgusb/work/libgusb-0.3.10/contrib/generate-version-script.py LIBGUSB gusb/GUsb-1.0.gir gusb/libgusb.ver
Traceback (most recent call last):
  File "/wrkdirs/usr/ports/devel/libgusb/work/libgusb-0.3.10/contrib/generate-version-script.py", line 10, in <module>
    from pkg_resources import parse_version
ModuleNotFoundError: No module named 'pkg_resources'
ninja: build stopped: subcommand failed.
*** Error code 1

A quick search tells me pkg_resources is related to python setuptools, but I don't know more than that. Other python packages seems to build fine.
Comment 1 Matthew Wener 2023-04-12 17:06:11 UTC
Created attachment 241440 [details]
Patch

I'm getting the same issue. Adding python and setuptools to build depends resolves the issue.
Comment 2 commit-hook freebsd_committer freebsd_triage 2023-04-12 18:21:59 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=153e827b5f030a6349a54e75f2b331185405ba81

commit 153e827b5f030a6349a54e75f2b331185405ba81
Author:     Adam Weinberger <adamw@FreeBSD.org>
AuthorDate: 2023-04-12 18:17:31 +0000
Commit:     Adam Weinberger <adamw@FreeBSD.org>
CommitDate: 2023-04-12 18:17:31 +0000

    devel/libgusb: Unbreak build

    Register a dependency on py-setuptools. Somewhere in the dependency
    chain a hard dep on it probably got dropped.

    While here, use OPTIONS helpers, and adjust some build dependencies.
    gtk-doc is only needed when DOCS is enabled, and vala is only needed
    when VAPI is enabled.

    Based on a patch from Matthew Wener.
    PR:             270788
    Reported by:    Fredrik Eriksson

 devel/libgusb/Makefile | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)
Comment 3 Adam Weinberger freebsd_committer freebsd_triage 2023-04-12 18:25:17 UTC
Thanks for submitting this bug report, and for the patch! The patch needed a small tweak: USES=python creates a runtime dependency on python too. USES=ptyhon:build is what I think you were going for there.