Skip to content

Commit 9c05cf6

Browse files
authored
Convert the compression level to a string before calling Args.add() (#975)
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 compression level to a string before calling Args.add().
1 parent 8c7c2cf commit 9c05cf6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pkg/private/tar/tar.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def _pkg_tar_impl(ctx):
115115
"%s=%s" % (_quote(key), ctx.attr.ownernames[key]),
116116
)
117117
if ctx.attr.compression_level:
118-
args.add("--compression_level", ctx.attr.compression_level)
118+
args.add("--compression_level", str(ctx.attr.compression_level))
119119

120120
# Now we begin processing the files.
121121
path_mapper = None

toolchains/rpm/rpmbuild_configure.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def _build_repo_for_rpmbuild_toolchain_impl(rctx):
8282
fail("debuginfo_type must be one of", DEBUGINFO_VALID_VALUES)
8383

8484
debuginfo_type = rctx.attr.debuginfo_type
85-
if debuginfo_type == DEBUGINFO_TYPE_AUTODETECT:
85+
if debuginfo_type == DEBUGINFO_TYPE_AUTODETECT:
8686
if rctx.path(RELEASE_PATH).exists:
8787
rctx.watch(RELEASE_PATH)
8888
os_name, _ = _parse_release_info(rctx.read(RELEASE_PATH))

0 commit comments

Comments
 (0)