Skip to content

Commit cdd9338

Browse files
authored
fix: don't call Args.add() with an integer (#3259)
The documentation for Bazel's Args states that standard conversion rules are only specified for strings, Files, and Labels. For all other types the conversion to a string is done in an unspecified manner, which is why it should be avoided. Let's stay away from this unspecified behaviour by explicitly converting the precompile optimization level to a string before calling Args.add().
1 parent d91401c commit cdd9338

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python/private/precompile.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def _precompile(ctx, src, *, use_pycache):
182182
# have the repo name, which is likely to contain extraneous info.
183183
precompile_request_args.add("--src_name", src.short_path)
184184
precompile_request_args.add("--pyc", pyc)
185-
precompile_request_args.add("--optimize", ctx.attr.precompile_optimize_level)
185+
precompile_request_args.add("--optimize", str(ctx.attr.precompile_optimize_level))
186186

187187
version_info = target_toolchain.interpreter_version_info
188188
python_version = "{}.{}".format(version_info.major, version_info.minor)

0 commit comments

Comments
 (0)