Closed huonw closed 1 year ago
- It's unfortunate I didn't add this in Add 'bootstrap tools' (bootstrap-cache-key) via PANTS_BOOTSTRAP_TOOLS=1 #128, because there may be people who installed the script supporting
PANTS_BOOTSTRAP_TOOLS
but not supporting this versioning. Maybe the window is small enough that that doesn't matter?
I think it's fine - window is small.
- The checking could be packaged into the bootstrap script itself: the bootstrap script check that
SCRIPT_VERSION >= PANTS_BOOTSTRAP_TOOLS
, i.e. the example scenario above could be collapsed to just:PANTS_BOOTSTRAP_CACHE_KEY=$(PANTS_BOOTSTRAP_TOOLS=2 ./pants bootstrap-cache-key)
. Thoughts?
That could be neat! So the script runs if it's later than PANTS_BOOTSTRAP_TOOLS and fails otherwise?
That could be neat! So the script runs if it's later than PANTS_BOOTSTRAP_TOOLS and fails otherwise?
Yeah, exactly. I've implemented something along those lines.
Oops, thanks for that.
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_TOOLS
key.For instance, suppose the bootstrap tools already existed (at version 1), and then
bootstrap-cache-key
command was added, the version number would be bumped to 2, and then a consumer (such as https://github.com/pantsbuild/actions/pull/6) could run something like:Notes:
bootstrap-version
rather thanversion
to avoid conflict with the subcommand on real-pants
(i.e../pants version
withoutPANTS_BOOTSTRAP_TOOLS=1
works, and prints the underlying pants version like 2.13.0, whereas./pants bootstrap-version
errors out withUnknown goal: bootstrap-version
)PANTS_BOOTSTRAP_TOOLS
but not supporting this versioning. Maybe the window is small enough that that doesn't matter?