Produce packager-friendly tarballs
This PR adds a series of changes that are necessary to produce "clean" tarballs, without generated files, dependencies, etc.
To make_sdist.sh, three options (passed by environment variable) are added:
NO_INSTALL_PACKAGES(do not run the scripts for installation of packages)NO_BUILD_LOCALE(omit the compiled locale files)OMIT_PB2_GENERATED(omit the filepaymentrequest_pb2.py)
By default, nothing changes. If the options are unset, make_sdist.sh behaves exactly as before. This is all opt-in.
There is also a slight refactor of the same script, where some locale generation code moves into contrib/build_locale.sh. This is necessary to be able to invoke this script separately, e.g. after unpacking a tarball.
Finally, a script is added to generate the file paymentrequest_pb2.py. This replaces the manual advice in electrum/paymentrequest.py.
Closes #7479.
I would recommend collapsing the new environment variables into a single one. I'm not aware of any use case for only using a subset of them, and using a single one will be easier for downstream projects that have additional steps (e.g. Namecoin's Qt form build step).
It would be desirable for sdist/build.sh to support this. Ditto for Cirrus.
What do you mean by adding support to Cirrus? Should it be a default option? The whole idea of Cirrus is it runs unattended, right?
The rest should be fine, give me 5 minutes...
@JeremyRand Ready for review.
What do you mean by adding support to Cirrus? Should it be a default option? The whole idea of Cirrus is it runs unattended, right?
@yanmaani I'd suggest adding a matrix clause to the tarball build Cirrus task, similar to what the Flake8 task does.
Also I'd suggest adding this to contrib/release.sh, i.e. running the release.sh script should produce both a source-only tarball and a regular tarball.
Review comments have been addressed.
Needs rebase.
Sorry I didn't see this earlier. Anyway the necessary changes have been made and I have rebased on top of master.
Right, the necessary changes have been made, should be ready for review. It now produces a distinctly named tarball without the use of any gross hacks.
I hope the use of sed when renaming isn't gratuitous, I couldn't think of a better way.
I hope the use of sed when renaming isn't gratuitous, I couldn't think of a better way.
I've replaced that with a similarly convoluted python script, but I find that easier to understand than the regex.
merged in https://github.com/spesmilo/electrum/commit/d0de44a794be43572fce73cdbe18e60c07a3274d including follow-up in https://github.com/spesmilo/electrum/commit/7d36f2ba3ab603044556b9548bea9893520747e1
Thank you for the PR.
The 4.3.1 release now includes source-only tarballs. We have decided not to link to them directly from the website (html table), but they are available on the download server.