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

Manually generate distribution archives #1032

Merged
merged 9 commits into from
Jan 31, 2023
Merged

Manually generate distribution archives #1032

merged 9 commits into from
Jan 31, 2023

Conversation

rickeylev
Copy link
Collaborator

@rickeylev rickeylev commented Jan 30, 2023

PR Checklist

Please check if your PR fulfills the following requirements:

  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix

What is the current behavior?

Right now, we use the automatically generated GitHub source archives. These have had issues with GitHub changing how they're generated, which affects the checksums, which then breaks users.

Issue Number: #1031

What is the new behavior?

A tar.gz is manually generated using git export. Some online sources indicate this is the underlying mechanism github uses for generate their archives. We also use this for computing the checksum, so that comports.

Does this PR introduce a breaking change?

  • No

Though note that base filename changes

Other information

This happened previously a year to so ago, too.

TAG=${GITHUB_REF_NAME}
PREFIX="rules_python-${TAG}"
ARCHIVE="rules_python-$TAG.tar.gz"
git archive --format=tar --prefix=${PREFIX}/ ${TAG} | gzip > $ARCHIVE
Copy link
Contributor

Choose a reason for hiding this comment

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

Adding a prefix here and asking users to add strip_prefix in http_archive seem unnecessary?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm guessing it was done that way to match the github-generated archives? I'm just leaving it as is for now so that it's less config people need to change.

Copy link
Contributor

Choose a reason for hiding this comment

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

Because of today's incident, there is no point of matching the sha256 of github-generated archives. FYI: rules_go and Gazelle's release archives are independent from github-generated ones too:
https://github.com/bazelbuild/rules_go/releases/tag/v0.38.1
https://github.com/bazelbuild/bazel-gazelle/releases/tag/v0.29.0

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I know. I'm not trying to match the sha256. I'm just keeping the structure the same, because it's a nicety to not have to change both url and the strip_prefix setting.

Copy link
Collaborator

Choose a reason for hiding this comment

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

+1 for keeping it the same

Copy link
Collaborator

@groodt groodt left a comment

Choose a reason for hiding this comment

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

LGTM

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.

4 participants