Skip to content

Commit 1498800

Browse files
committed
Address review.
1 parent e43b773 commit 1498800

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

misc/bazel/pkg.bzl

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -284,19 +284,19 @@ def codeql_pack(
284284
install_dest = "extractor-pack",
285285
compression_level = None,
286286
arch_overrides = None,
287-
prefix_override = None,
287+
zip_prefix = None,
288288
**kwargs):
289289
"""
290290
Define a codeql pack. This macro accepts `pkg_files`, `pkg_filegroup` or their `codeql_*` counterparts as `srcs`.
291291
`zips` is a map from `.zip` files to prefixes to import.
292292
* defines a `<name>-generic-zip` target creating a `<zip_filename>-generic.zip` archive with the generic bits,
293-
prefixed with `name`
293+
prefixed with `zip_prefix`
294294
* defines a `<name>-arch-zip` target creating a `<zip_filename>-<codeql_platform>.zip` archive with the
295-
arch-specific bits, prefixed with `name`
295+
arch-specific bits, prefixed with `zip_prefix`
296296
* defines a runnable `<name>-installer` target that will install the pack in `install_dest`, relative to where the
297297
rule is used. The install destination can be overridden appending `-- --destdir=...` to the `bazel run`
298-
invocation. This installation _does not_ prefix the contents with `name`.
299-
The prefix for the zip files can be overriden with `prefix_override`.
298+
invocation. This installation _does not_ prefix the contents with `zip_prefix`.
299+
The prefix for the zip files can be set with `zip_prefix`, it is `name` by default.
300300
301301
The distinction between arch-specific and generic contents is made based on whether the paths (including possible
302302
prefixes added by rules) contain the special `{CODEQL_PLATFORM}` placeholder, which in case it is present will also
@@ -310,9 +310,8 @@ def codeql_pack(
310310
internal = _make_internal(name)
311311
zip_filename = zip_filename or name
312312
zips = zips or {}
313-
prefix = name
314-
if prefix_override != None:
315-
prefix = prefix_override
313+
if zip_prefix == None:
314+
zip_prefix = name
316315
pkg_filegroup(
317316
name = internal("all"),
318317
srcs = srcs,
@@ -350,15 +349,15 @@ def codeql_pack(
350349
name = internal(kind, "zip"),
351350
srcs = [internal(kind, "zip-base"), internal(kind, "zip-info")],
352351
out = _get_zip_filename(name, kind),
353-
prefix = prefix,
352+
prefix = zip_prefix,
354353
visibility = visibility,
355354
)
356355
else:
357356
pkg_zip(
358357
name = internal(kind, "zip"),
359358
srcs = [internal(kind)],
360359
visibility = visibility,
361-
package_dir = prefix,
360+
package_dir = zip_prefix,
362361
package_file_name = _get_zip_filename(name, kind),
363362
compression_level = compression_level,
364363
)

0 commit comments

Comments
 (0)