Skip to content

Commit f22ae66

Browse files
authored
Silence "canonical reproducible form" warning from repo rule (#468)
Prior to this fix, when using Bazel 8.1.1 then this kind of stanza in a MODULE file ... ```bzl bazel_dep(name = "toolchains_llvm", version = "1.3.0") llvm = use_repo_rule("@toolchains_llvm//toolchain:rules.bzl", "llvm") llvm( name = "llvm", llvm_version = "19.1.3", ... ) ``` ... would generate this irrelevant suggestion ... ``` DEBUG: Rule '+_repo_rules4+llvm' indicated that a canonical reproducible form can be obtained by modifying arguments _action_listener = <unknown object com.google.devtools.build.lib.packages.Attribute$LabelListLateBoundDefault>, _config_dependencies = [], _configure = False, _environ = [], _original_name = "llvm" DEBUG: Repository +_repo_rules4+llvm instantiated at: <builtin>: in <toplevel> Repository rule llvm defined at: .../external/toolchains_llvm+/toolchain/rules.bzl:27:23: in <toplevel> ``` With this fix, the message no longer appears.
1 parent ca7ea77 commit f22ae66

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

toolchain/internal/common.bzl

+3
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,9 @@ def attr_dict(attr):
231231
for key in dir(attr):
232232
if not hasattr(attr, key):
233233
fail("key %s not found in attributes" % key)
234+
if key[0] == "_":
235+
# Don't update private attrs.
236+
continue
234237
val = getattr(attr, key)
235238

236239
# Make mutable copies of frozen types.

0 commit comments

Comments
 (0)