Bug 264962 - ports-mgmt/pkg 1.18.2: 'pkg-static: pkg_checksum_hash_sha256_file(read failed): Is a directory' error when package contains .egg-info dir
Summary: ports-mgmt/pkg 1.18.2: 'pkg-static: pkg_checksum_hash_sha256_file(read failed...
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-python (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-30 14:56 UTC by nick.rozhkov
Modified: 2023-08-24 12:41 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (pkg)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nick.rozhkov 2022-06-30 14:56:33 UTC
Its impossible to create the package or install the port when it contains .egg-info dir. Faced with the same error for graphics/lensfun and sysutils/xen-tools
Error log (make package/make install in graphics/lensfun dir): 

DBG(3)[67579]> Pkg: add new file '/usr/local/share/lensfun/version_2/timestamp.txt'
DBG(1)[67579]> Parsing plist line: 'lib/python3.9/site-packages/lensfun-0.3.95-py3.9.egg-info'
pkg-static: pkg_checksum_hash_sha256_file(read failed): Is a directory

Same and for sysutils/xen-tools:
DBG(1)[11477]> Parsing plist line: 'lib/python3.9/site-packages/pygrub-0.6-py3.9.egg-info'
pkg-static: pkg_checksum_hash_sha256_file(read failed): Is a directory
DBG(1)[11477]> Parsing plist line: 'lib/python3.9/site-packages/xen-3.0-py3.9.egg-info'
pkg-static: pkg_checksum_hash_sha256_file(read failed): Is a directory
Comment 1 Baptiste Daroussin freebsd_committer freebsd_triage 2022-06-30 15:10:30 UTC
this is not a pkg issue, the ports are stating those egg-info are files, so pkg treat them as such, if they are not then they should not be marked as files.

I don't know why those files are directories and not files for you, but that is the issue that one should look at.

sounds like a python@ issue
Comment 2 Tatsuki Makino 2022-06-30 20:47:43 UTC
+ databases/rrdtool (option PYTHON turned on)
Comment 3 nick.rozhkov 2022-07-01 14:59:48 UTC
(In reply to Baptiste Daroussin from comment #1)
Thanks for reply. As it turned out new version of py-setuptools contains its own implementation of distutils, which generates egg-info in dir format. Solve the problem is possible by uninstall py-setuptools or setup env var SETUPTOOLS_USE_DISTUTILS=stdlib 
https://setuptools.pypa.io/en/latest/deprecated/distutils-legacy.html
Problem is solved
Comment 4 nick.rozhkov 2022-07-01 15:00:19 UTC
(In reply to Baptiste Daroussin from comment #1)
Thanks for reply. As it turned out new version of py-setuptools contains its own implementation of distutils, which generates egg-info in dir format. Solve the problem is possible by uninstall py-setuptools or setup env var SETUPTOOLS_USE_DISTUTILS=stdlib 
https://setuptools.pypa.io/en/latest/deprecated/distutils-legacy.html
Problem is solved
Comment 5 Tatsuki Makino 2023-01-02 21:27:01 UTC
(In reply to Tatsuki Makino from comment #2)

The difference between whether egginfo is a file or a directory seems to be generated by the group of files written in Bug 265203 Comment 6.
The difference is the installation of setuptools, with or without USE_PYTHON=distutils.

In other words, it appears that USE_PYTHON=distutils should always be defined whenever setup.py is present.
However, it would rewrite the do-* target as well, so it seems it could not be used for rrdtool (bug 265203).
Comment 6 Marcin Cieślak 2023-08-24 12:41:12 UTC
Just ran into this with sysutils/xen-tools

Is it possible to build a macro that expands


to either something like

%%PYTHON_SITELIBDIR%%/xen-3.0-py%%PYTHON_VER%%.egg-info

or multiple files in the ".egg-info" directory as generated by the newer setuptools?