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

Use a prebuilt copy of build-manifest #14

Merged
merged 8 commits into from
Oct 15, 2020
Merged

Conversation

pietroalbini
Copy link
Member

This PR changes promote-release to use a copy of build-manifest prebuilt by CI, and stops it from cloning rust-lang/rust or invoking ./x.py at all when the prebuilt copy is detected. The PR applies the following changes:

  • The channel is now represented with an enum instead of a string, which avoids having the default case in matches everywhere.
  • The PROMOTE_RELEASE_OVERRIDE_BRANCH environment variable was replaced with PROMOTE_RELEASE_OVERRIDE_COMMIT, which gives more flexibility to the person starting the release. Along with that, ./run.sh added support for running a local build with a specific commit.
  • A clone of rust-lang/rust is not needed anymore to detect which commit needs to be released. Instead of updating the repository and looking at the tip of the branch we're interested in, promote-release now uses git2 to connect to GitHub and list the refs available on the server, without ever receiving any git object. This is the equivalent of git ls-remote.
  • The current date is now fetched with chrono instead of shelling out to the date command, since we're depending on it anyway.
  • The prebuilt copy of build-manifest is now used when available, and on the channels without it the legacy invocation through ./x.py is used instead. This removes the need to clone rust-lang/rust or invoke the build system at all, speeding up releases.

This PR is best reviewed commit-by-commit.
r? @Mark-Simulacrum

Copy link
Member

@Mark-Simulacrum Mark-Simulacrum left a comment

Choose a reason for hiding this comment

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

r=me. I am not too happy with constantly re-fetching the whole Rust repository but I don't know that we have better options. I definitely don't want to use github API here, for example, or use the non-rate limited alternatives.

@pietroalbini
Copy link
Member Author

I am not too happy with constantly re-fetching the whole Rust repository but I don't know that we have better options.

@Mark-Simulacrum oh, to be clear, we're not fetching the whole Rust repository. git ls-remote (which I recreated with git2) just connects to GitHub and returns the list of available branches. No object data is downloaded:

pietro@january: ~/tmp/demo$ git init
Initialized empty Git repository in /home/pietro/tmp/demo/.git/
pietro@january: ~/tmp/demo (master)$ du -sh .git
104K    .git
pietro@january: ~/tmp/demo (master)$ git ls-remote https://github.com/rust-lang/rust.git | head -n 5
93deabce03dc10a80244f5da3e3819452744da2a        HEAD
fe604c5ee8fb9665e8fc4d73515a6d87f05997ab        refs/heads/LeSeulArtichaut-patch-1
bbea1a1f7b4a32a15259becce7800bf7e0cad423        refs/heads/auto
212e76c31d461462544b5d516d3bdc99fc8f016e        refs/heads/beta
93deabce03dc10a80244f5da3e3819452744da2a        refs/heads/master
pietro@january: ~/tmp/demo (master)$ du -sh .git
104K    .git
pietro@january: ~/tmp/demo (master)$ 

@pietroalbini pietroalbini merged commit d76a471 into master Oct 15, 2020
@pietroalbini pietroalbini deleted the build-manifest-component branch October 15, 2020 08:07
@Mark-Simulacrum
Copy link
Member

Hm, I recall seeing a git rev-parse which I wouldn't expect to work in that case.

ehuss added a commit to ehuss/rust that referenced this pull request Jun 17, 2024
compiler-errors added a commit to compiler-errors/rust that referenced this pull request Jun 23, 2024
…k-Simulacrum

Update outdated README in build-manifest.

I believe this was changed a while ago in rust-lang/promote-release#14.
compiler-errors added a commit to compiler-errors/rust that referenced this pull request Jun 23, 2024
…k-Simulacrum

Update outdated README in build-manifest.

I believe this was changed a while ago in rust-lang/promote-release#14.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jun 23, 2024
…k-Simulacrum

Update outdated README in build-manifest.

I believe this was changed a while ago in rust-lang/promote-release#14.
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jun 23, 2024
Rollup merge of rust-lang#126612 - ehuss:build-manifest-readme, r=Mark-Simulacrum

Update outdated README in build-manifest.

I believe this was changed a while ago in rust-lang/promote-release#14.
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Jun 24, 2024
Update outdated README in build-manifest.

I believe this was changed a while ago in rust-lang/promote-release#14.
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.

2 participants