Add version bootstrap tool subcommand, for capability checking#129
Merged
benjyw merged 4 commits intopantsbuild:gh-pagesfrom Oct 7, 2022
Merged
Add version bootstrap tool subcommand, for capability checking#129benjyw merged 4 commits intopantsbuild:gh-pagesfrom
benjyw merged 4 commits intopantsbuild:gh-pagesfrom
Conversation
Contributor
I think it's fine - window is small.
That could be neat! So the script runs if it's later than PANTS_BOOTSTRAP_TOOLS and fails otherwise? |
kaos
reviewed
Oct 6, 2022
kaos
approved these changes
Oct 6, 2022
Contributor
Author
Yeah, exactly. I've implemented something along those lines. |
benjyw
approved these changes
Oct 7, 2022
Contributor
benjyw
left a comment
There was a problem hiding this comment.
LGTM mod the best-practice of bracing vars.
Co-authored-by: Benjy Weinberger <benjy@toolchain.com>
Contributor
Author
|
Oops, thanks for that. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This expands on #128 to add another bootstrap tool subcommand:
bootstrap-version. This is designed to just be a simple number that's bumped whenever there's a feature scripts might need to query for. The version number is also automatically checked against the (numeric) value of thePANTS_BOOTSTRAP_TOOLSkey.For instance, suppose the bootstrap tools already existed (at version 1), and then
bootstrap-cache-keycommand was added, the version number would be bumped to 2, and then a consumer (such as pantsbuild/actions#6) could run something like:PANTS_BOOTSTRAP_CACHE_KEY=$(PANTS_BOOTSTRAP_TOOLS=2 ./pants bootstrap-cache-key)Notes:
bootstrap-versionrather thanversionto avoid conflict with the subcommand on real-pants(i.e../pants versionwithoutPANTS_BOOTSTRAP_TOOLS=1works, and prints the underlying pants version like 2.13.0, whereas./pants bootstrap-versionerrors out withUnknown goal: bootstrap-version)PANTS_BOOTSTRAP_TOOLSbut not supporting this versioning. Maybe the window is small enough that that doesn't matter?