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

Ensure the release works before uploading the tarballs #25

Merged
merged 3 commits into from
Nov 3, 2020

Conversation

pietroalbini
Copy link
Member

This PR adds a section to the release process to make sure the release we're about to upload can be installed and can run "Hello world". This is mainly meant to prevent a bug in build-manifest making the release impossible to install, and could give us more confidence in making changes to it.

The steps executed during the smoke test are:

  • A local web server (built with hyper) is started on a random port, and is configured to serve the release files.
  • The manifests are generated by build-manifest pointing to the HTTP address of the server created earlier, and the checksums it generated are cached to allow the following build-manifest execution to complete in just a couple of seconds.
  • Followup on pruning unused files #23: files not included in the "shipped files" list are removed.
  • The release tarballs are signed, and in a separate directory the smoke test manifests are signed too.
  • Rustup is invoked with RUSTUP_DIST_SERVER pointing to the local webserver, first removing the existing toolchain and then installing the release we're about to upload to production. This ensures installing the toolchain works.
  • Cargo is invoked with the toolchain previously installed with rustup, running cargo init --bin . and cargo run in a temporary directory. This ensures the toolchain is not incredibly broken.
  • The smoke test manifests and their signatures are discarded, and new manifests with the right URL are generated and signed. Generating those manifests is going to be quick since they're going to reuse the tarball checksums generated earlier.

Fixes #15
This PR can be reviewed commit-by-commit.
r? @Mark-Simulacrum

This commit starts to use build-manifest's new checksum cache feature,
which stores all the checksums it calculated in a JSON file before
exiting. This allows to avoid duplicate calculations.
This commit changes how build-manifest is invoked, stopping it from
generating the manifests directly into the downloads directory. Instead,
the files are generated in a separate directory and then merged back.

While there is not much point in doing so *right now*, this will be
crucial to implement smoke tests for the release, as we need to generate
a separate set of manifests with a different download URL to be able to
perform the smoke test. Having the generated output in a separate
directory will allow to easily discard those temporary manifests and
their signatures in a clean way.
This commit changes the release process to execute a "smoke test" before
uploading the release to the destination buckets, by generating another
set of manifests pointing to a localhost server serving the files we're
about to upload.

After the localhost web server is up then rustup is invoked to download
the toolchain, and cargo is invoked to create a binary project and run
the hello world in it. If any of this fails the release is aborted.
@Mark-Simulacrum
Copy link
Member

r=me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test with rustup before deploying to production
2 participants