[tahoe-lafs-trac-stream] [Tahoe-LAFS] #3259: The switch to use pkg_resources breaks frozen builds
Tahoe-LAFS
trac at tahoe-lafs.org
Thu Oct 3 17:56:40 UTC 2019
#3259: The switch to use pkg_resources breaks frozen builds
------------------------+------------------------
Reporter: cypher | Owner: daira
Type: defect | Status: new
Priority: normal | Milestone: 1.14.0
Component: packaging | Version: n/a
Keywords: regression | Launchpad Bug:
------------------------+------------------------
[https://github.com/tahoe-lafs/tahoe-lafs/pull/646 PR #646] introduced a
change that broke "frozen" builds of Tahoe-LAFS (i.e., standalone
executables generated by PyInstaller, cx_Freeze, and the like).
Specifically, because "frozen" python interpreters run outside of and
without a traditional setuptools-based packaging environment, the
[https://github.com/tahoe-lafs/tahoe-
lafs/blob/eb751baeef935f02bbdc1b1ed7ce8774d5e47be1/src/allmydata/version_checks.py#L29
pkg_resources.get_distribution(__appname__)] call will fail as follows
when running under a "frozen" interpreter:
{{{
Traceback (most recent call last):
File "tahoe.py", line 23, in <module>
from twisted.python.procutils import which
File "/tmp/pip-install-
Om4he9/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 395, in
load_module
File "site-packages/allmydata/scripts/runner.py", line 9, in <module>
File "/tmp/pip-install-
Om4he9/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 395, in
load_module
File "site-packages/allmydata/version_checks.py", line 29, in <module>
File "site-packages/pkg_resources/__init__.py", line 481, in
get_distribution
File "site-packages/pkg_resources/__init__.py", line 357, in
get_provider
File "site-packages/pkg_resources/__init__.py", line 900, in require
File "site-packages/pkg_resources/__init__.py", line 786, in resolve
pkg_resources.DistributionNotFound: The 'tahoe-lafs' distribution was not
found and is required by the application
[23457] Failed to execute script tahoe
}}}
Conditionally skipping this call when running under a frozen interpreter
will allow the execution of the application to continue as intended (as is
already being done elsewhere in the `version_checks` module -- e.g.,
[https://github.com/tahoe-lafs/tahoe-
lafs/blob/eb751baeef935f02bbdc1b1ed7ce8774d5e47be1/src/allmydata/version_checks.py#L324
here]).
--
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/3259>
Tahoe-LAFS <https://Tahoe-LAFS.org>
secure decentralized storage
More information about the tahoe-lafs-trac-stream
mailing list