Add support for binary builds with PyInstaller #421
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds support for building portable, self-contained
tahoe
binary distributions for all major desktop platforms (GNU/Linux, Mac, and Windows) via PyInstaller, partly resolving trac ticket 2729. This is implementation is similar to what I've used elsewhere (and extensively tested) for the Gridsync project but with a some minor cleanups and additions that I thought might be useful for integrating with Tahoe-LAFS' own buildbot/CI/deployment pipeline (like exporting artifacts in platform-prefered archive-formats, labeling their bitness in the resultant filename, and printing out their SH256 hash digests along the way).Although probably not strictly necessary, I've decided to implement this using a
tox
testenv in order to provide stronger isolation during the build process (since I setPYTHONHASHSEED=1
to provide partial reproducibility and patch thesetuptools
check out of_auto_deps.py
at buildtime to prevent a runtime exception -- either of which could lead to issues if you're parallelizing your test run withdetox
or similar); to make a binary distribution, simply run the following command (withtox
installed):tox -e pyinstaller
Assuming all goes well, when the build process completes, you'll find an appropriately-labeled archive inside of
dist/
(e.g., "Tahoe-LAFS-Windows-32bit.zip", "Tahoe-LAFS-MacOS-64bit.tar.gz") containing everything needed to run Tahoe-LAFS on that target platform. The end-user need only extract the archive somewhere on their system and run thetahoe
executable contained therein (tahoe.exe
on Windows); nopython2
installation is required to be present on the host system.Please note, however, that the various caveats listed in trac ticket 2729 still apply. In particular, PyInstaller's binaries are not guaranteed to be backwards-compatible and, in some cases, are certainly not (as one example, binaries built with Travis-CI's
osx
images -- which run Mac OS X 10.10 -- will not run on the old iMac in my office -- which runs OS X 10.9 -- however, binaries built on my iMac will run without issue on Travis and other machines that I've tested running 10.10). Accordingly, it is recommended to distribute artifacts that were built on older operating systems so as to increase the likelihood of them running on as many systems as possible.On that note, once this PR lands -- or even if it doesn't -- I would be happy to donate some Mac and Windows VMs/buildslaves to tahoe-lafs.org's buildbot fleet (which I'm already running for Gridsync anyway) and/or help streamline deployments through Travis-CI/AppVeyor (the latter of which, I think, we already depend on for building wheels?).