Skip to content

Commit 9c1efb9

Browse files
committed
Bazel: expose compression_level in codeql_pack
1 parent 00ed00e commit 9c1efb9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

misc/bazel/pkg.bzl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ def codeql_pack(
228228
zip_filename = None,
229229
visibility = None,
230230
install_dest = "extractor-pack",
231+
compression_level = None,
231232
**kwargs):
232233
"""
233234
Define a codeql pack. This macro accepts `pkg_files`, `pkg_filegroup` or their `codeql_*` counterparts as `srcs`.
@@ -243,6 +244,9 @@ def codeql_pack(
243244
The distinction between arch-specific and generic contents is made based on whether the paths (including possible
244245
prefixes added by rules) contain the special `{CODEQL_PLATFORM}` placeholder, which in case it is present will also
245246
be replaced by the appropriate platform (`linux64`, `win64` or `osx64`).
247+
248+
`compression_level` can be used to tweak the compression level used when creating archives. Consider that this
249+
does not affect the contents of `zips`, only `srcs`.
246250
"""
247251
internal = _make_internal(name)
248252
zip_filename = zip_filename or name
@@ -265,6 +269,7 @@ def codeql_pack(
265269
name = internal(kind + "-zip-base"),
266270
srcs = [internal(kind)],
267271
visibility = ["//visibility:private"],
272+
compression_level = compression_level,
268273
)
269274
_zipmerge(
270275
name = internal(kind + "-zip"),
@@ -282,6 +287,7 @@ def codeql_pack(
282287
visibility = ["//visibility:private"],
283288
package_dir = name,
284289
package_file_name = name + "-" + (_detect_platform() if kind == "arch" else "generic") + ".zip",
290+
compression_level = compression_level,
285291
)
286292
if zips:
287293
_imported_zips_manifest(

0 commit comments

Comments
 (0)