`download_utils@template` bug when used with `pre-commit`.
Using rules_labgrid after 7f8f546a makes bazelisk run hooks on a downstream project fail with:
ERROR: /home/matt-clarkson/.cache/bazel/_bazel_matt-clarkson/027531265d81431aefe131e3e1653ff9/external/download_utils+/download/template/substitution.bzl:115:31: Traceback (most recent call last):
File "/home/matt-clarkson/.cache/bazel/_bazel_matt-clarkson/027531265d81431aefe131e3e1653ff9/external/download_utils+/download/template/extension.bzl", line 83, column 36, in implementation
names, repro = rule(ctx, attrs, substitutions)
File "/home/matt-clarkson/.cache/bazel/_bazel_matt-clarkson/027531265d81431aefe131e3e1653ff9/external/download_utils+/download/template/archive.bzl", line 79, column 27, in implementation
return _implementation(ctx, _rule, attrs, data)
File "/home/matt-clarkson/.cache/bazel/_bazel_matt-clarkson/027531265d81431aefe131e3e1653ff9/external/download_utils+/download/template/repository.bzl", line 133, column 27, in implementation
resolved = resolve(data, product)
File "/home/matt-clarkson/.cache/bazel/_bazel_matt-clarkson/027531265d81431aefe131e3e1653ff9/external/download_utils+/download/template/substitutions.bzl", line 110, column 32, in resolve
resolved = _resolve(substitution, substitutions, no_key_error = None, no_match_error = no_match_error)
File "/home/matt-clarkson/.cache/bazel/_bazel_matt-clarkson/027531265d81431aefe131e3e1653ff9/external/download_utils+/download/template/substitution.bzl", line 125, column 20, in resolve
value = _select(match, substitution.select, no_match_error)
File "/home/matt-clarkson/.cache/bazel/_bazel_matt-clarkson/027531265d81431aefe131e3e1653ff9/external/download_utils+/download/template/substitution.bzl", line 115, column 31, in _select
fail(no_match_error.format(key = key, select = select))
Error in format: Missing argument 'variable'
ERROR: Analysis of target '//hooks:config' failed; build aborted: error evaluating module extension @@download_utils+//download/template:defs.bzl%download_template
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target
This is an (bad) error from download_utils. I assume this is happening because 7290a01d is using download_utils#template and there is an untested interaction happening with that extension.
Root causing this will likely be a bug on download_utils but the failure happens when using rules_labgrid in a downstream project so posting it here for tracking and visibility.
That error message is awful: we should fix that up in download_utils somewhere.
Edited by Matthew Clarkson