electrum icon indicating copy to clipboard operation
electrum copied to clipboard

Produce packager-friendly tarballs

Open yanmaani opened this issue 4 years ago • 9 comments

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 file paymentrequest_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.

yanmaani avatar Dec 10 '21 12:12 yanmaani

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).

JeremyRand avatar Dec 10 '21 13:12 JeremyRand

It would be desirable for sdist/build.sh to support this. Ditto for Cirrus.

JeremyRand avatar Dec 10 '21 13:12 JeremyRand

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...

yanmaani avatar Dec 10 '21 13:12 yanmaani

@JeremyRand Ready for review.

yanmaani avatar Dec 10 '21 13:12 yanmaani

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.

JeremyRand avatar Dec 15 '21 22:12 JeremyRand

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.

JeremyRand avatar Dec 15 '21 22:12 JeremyRand

Review comments have been addressed.

yanmaani avatar Jan 18 '22 10:01 yanmaani

Needs rebase.

JeremyRand avatar May 24 '22 02:05 JeremyRand

Sorry I didn't see this earlier. Anyway the necessary changes have been made and I have rebased on top of master.

yanmaani avatar Jul 04 '22 12:07 yanmaani

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.

yanmaani avatar Aug 15 '22 23:08 yanmaani

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.

SomberNight avatar Aug 16 '22 17:08 SomberNight

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.

SomberNight avatar Aug 17 '22 20:08 SomberNight