Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release tarball script #4837

Merged
merged 1 commit into from
Mar 24, 2020
Merged

Conversation

dvzrv
Copy link
Member

@dvzrv dvzrv commented Mar 22, 2020

Purpose and Motivation

This script creates a source tarball from a valid tag in this repository by checking out the SuperCollider sources recursively in a temporary working directory. Optionally, this script can also provide a detached PGP signature. The naming scheme of the tarball and the contained directory follows the current naming scheme.
The script automatically removes its working directory on exit or fail and is tested on Linux and macOS.

Eventually I think this should run in CI, but it can also be done manually by whoever is in charge of the release process (to be able to provide a detached PGP signature).

To create a source tarball:

./package/create_source_tarball.sh -v Version-3.11.0

To create a source tarball with detached PGP signature:

./package/create_source_tarball.sh -v Version-3.11.0 -s my-pgp-keyid-or-mail-address

Fixes #4545 #4818.

Types of changes

  • Bug fix
  • New feature

To-do list

  • Code is tested
  • All tests are passing
  • Updated documentation
  • This PR is ready for review

@joshpar
Copy link
Member

joshpar commented Mar 22, 2020 via email

Copy link
Contributor

@mossheim mossheim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! couple things:

  • let's hook this into the build system proper by adding a target via add_custom_target
  • the resulting artefact should go in $BUILD_DIR/package (preferably) or $BUILD_DIR
  • please indent at 4 spaces per our style guidelines

package/create_source_tarball.sh Outdated Show resolved Hide resolved
package/create_source_tarball.sh Outdated Show resolved Hide resolved
@dvzrv
Copy link
Member Author

dvzrv commented Mar 22, 2020

* let's hook this into the build system proper by adding a target via `add_custom_target`

Do you mean the cmake setup by that?
Wouldn't it make more sense to directly call this script in the CI upon tagging?

* the resulting artefact should go in `$BUILD_DIR/package` (preferably) or `$BUILD_DIR`

I guess an optional $BUILD_DIR environment variable could be made use of in there. Need to play with this a little.

@mossheim
Copy link
Contributor

I guess an optional $BUILD_DIR environment variable could be made use of in there. Need to play with this a little.

oh, all i mean by that is that if you are building in supercollider/build then this artefact should go somewhere in supercollider/build.

Do you mean the cmake setup by that?

yes

Wouldn't it make more sense to directly call this script in the CI upon tagging?

for developers working with this repo i think it's easiest to both explain and use a system where all commands that produce executables, redistributable packages, etc. can be invoked through CMake.

@dvzrv
Copy link
Member Author

dvzrv commented Mar 23, 2020

oh, all i mean by that is that if you are building in supercollider/build then this artefact should go somewhere in supercollider/build.

I understand. However, how exactly would this work? How do we derive the tag that is supposed to be built ( -v flag to the script)? How do we handle potential user input (when potentially signing)?

I guess the tag string could be assembled using Version-SC_VERSION. This however doesn't help in the case where we're not building the exact commit a tag points to (e.g. someone executing cmake on a random commit post the Version-3.11.0 tag will still generate the tarball for Version-3.11.0).
I have the feeling the use-case is not in development of SuperCollider, but its release process.

@mossheim
Copy link
Contributor

ah you're right, the design of the script makes it a bit unusual compared to other build targets. the command-line arguments could become interactive user input, ehh.. forget the build system integration.

everything looks fine, can either you or @joshpar document how this fits into the release process in the wiki (https://github.com/supercollider/supercollider/wiki/git-workflow-and-guidelines) please? and then i am good to approve this.

also, it would be very helpful if you rebased this on 3.11 instead of develop.

Copy link
Member

@joshpar joshpar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please point to the 3.11 branch. After merge, I'll run this on the 3.11 release to package the new tarballs.

@dvzrv dvzrv changed the base branch from develop to 3.11 March 24, 2020 08:00
@dvzrv
Copy link
Member Author

dvzrv commented Mar 24, 2020

everything looks fine, can either you or @joshpar document how this fits into the release process in the wiki (https://github.com/supercollider/supercollider/wiki/git-workflow-and-guidelines) please? and then i am good to approve this.

Will do

@dvzrv dvzrv force-pushed the release_tarball_script branch 4 times, most recently from 5e17bc9 to ee8048f Compare March 24, 2020 08:36
package/create_source_tarball.sh:

This script accepts two parameters:
* v: The version (aka. the tag) the source tarball is supposed to be
  created for (mandatory).

* s: The signing entity (an e-mail address or key ID) to sign the source
  tarball with a PGP private key.

The script creates a tarball of the form
SuperCollider-X.Y.Z-Source.tar.bz2, which extracts to a directory of the
form SuperCollider-X.Y.Z-Source/ (here X.Y.Z denote a version without
the conventional Version- prefix, used for the tags).
Optionally, this script creates a detached PGP signature (tarball name +
.asc).

If the BUILD_DIR environment variable is set it will be used as the
output_dir.
In this case the source tarball (and the optional detached signature)
are moved to BUILD_DIR/package and the output_dir is created
on-the-fly.
If BUILD_DIR is not provided the script defaults back to its own
location (the directory the script resides in) as output_dir.

The script utilizes a trap to cleanup temporary working directories
(even if unsuccessful).

.gitignore: Adding ignores for source tarball and detached signature
creation.

Signed-off-by: David Runge <dave@sleepmap.de>
@dvzrv dvzrv force-pushed the release_tarball_script branch from ee8048f to 7d7c801 Compare March 24, 2020 08:45
Copy link
Contributor

@mossheim mossheim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@mossheim mossheim merged commit f849619 into supercollider:3.11 Mar 24, 2020
@dvzrv dvzrv deleted the release_tarball_script branch March 24, 2020 11:32
@dvzrv
Copy link
Member Author

dvzrv commented Mar 24, 2020

I guess as a follow-up the scripts previously used could be removed.

@joshpar how do you currently generate the binary release assets (e.g. .dmg for macOS and .exe for Windows)? Are you using binaries created in CI in that case? I'm trying to figure out, if any of the scripts in package/* are involved in that (it seems not).

Also: Please add the source tarball for Version-3.11.0 to the assets at your earliest convenience, so that it can be updated downstream.

@joshpar
Copy link
Member

joshpar commented Mar 24, 2020 via email

@dvzrv dvzrv mentioned this pull request Mar 25, 2020
4 tasks
@dvzrv
Copy link
Member Author

dvzrv commented Apr 1, 2020

@joshpar can you please generate and upload the tarball? Currently 3.11.0 can not be built by downstreams relying on the tarball and the reproducible build on Arch Linux is broken due to it missing.

@joshpar
Copy link
Member

joshpar commented Apr 1, 2020

@dvzrv - working on this now. If I run this:
./create_source_tarball.sh -v 3.11.0

I get an error about there being no branch on the remote (which is fine - I can change it to 3.11) - but I have a concern with this... 3.11's branch has changes POST 3.11 release. Is this pulling the branch? Would pointing to a tag be better?

@dvzrv
Copy link
Member Author

dvzrv commented Apr 1, 2020

@joshpar you need to reference the tag:

./create_source_tarball.sh -v Version-3.11.0

Otherwise git will probably use the branch. Maybe I can make the wiki more clear about this?

@dvzrv
Copy link
Member Author

dvzrv commented Apr 1, 2020

@joshpar I've updated the documentation to be more explicit:
https://github.com/supercollider/supercollider/wiki/git-workflow-and-guidelines#releasing

@joshpar
Copy link
Member

joshpar commented Apr 1, 2020

@dvzrv - thanks! please see https://github.com/supercollider/supercollider/releases/tag/Version-3.11.0 to see if this looks right to you

@dvzrv
Copy link
Member Author

dvzrv commented Apr 3, 2020

@joshpar looks all fine! I've used it in this package in version 3.11.0-4.

Thanks a lot! :)

dvzrv added a commit to dvzrv/supercollider.github.io that referenced this pull request May 7, 2020
_includes/download.md:
The source tarball name has been generalized with
supercollider/supercollider#4837 and is now not
Linux specific anymore.
The naming scheme is now 'SuperCollider-<version>-Source.tar.bz2'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve our source tarball packaging process
3 participants