brash-baker-91190
10/18/2022, 6:14 PMpants.toml
, particularly default ones that haven't been explicitly set or overridden? In particular, I'm looking to programmatically find out the currently-configured protoc
version (https://www.pantsbuild.org/docs/reference-protoc#version). I know I can set a value concretely and then just process the TOML myself, but I was wondering if Pants already had some built-in capabilities along these lines. Thanks! 🙏fast-nail-55400
10/18/2022, 6:18 PMhelp
goal will output the current and default values for configuration options.fast-nail-55400
10/18/2022, 6:19 PMbrash-baker-91190
10/18/2022, 6:21 PMpants help tools
, but not protoc
, which we're definitely using (albeit with default configurations at the moment).fast-nail-55400
10/18/2022, 6:23 PM./pants help protoc
?brash-baker-91190
10/18/2022, 6:23 PMUnknown entity: protoc
happy-kitchen-89482
10/18/2022, 6:55 PM./pants help-all
gives a lot of info in JSON form, including the derivation of the value of every optionhappy-kitchen-89482
10/18/2022, 6:58 PMpants.backend.codegen.protobuf.python
in your backend_packages
in pants.toml?happy-kitchen-89482
10/18/2022, 6:58 PM./pants help protoc
should work, and it should appear in help-all
brash-baker-91190
10/18/2022, 7:07 PMpants.backend.codegen.protobuf.python
in backend_packages
... and I just realized I was running ./pants help protoc
in the wrong repository (🤦 ... sorry, it's one of those days).
It looks like I could maybe use something like ./pants help-all | jq -r '.scope_to_help_info.protoc.advanced[0].default'
to grab the value for protoc
🤔brash-baker-91190
10/18/2022, 7:08 PMpants.toml
, though... I haven't quite grokked the data that's being returned.brash-baker-91190
10/18/2022, 7:11 PMbrash-baker-91190
10/19/2022, 8:58 PM./pants help-all |
jq --raw-output \
'.scope_to_help_info.protoc.advanced |
.[] |
select(.config_key == "version") |
.value_history.ranked_values[-1].value'