Skip to content

Commit e2cb563

Browse files
committed
pkg.bzl: Fix install targets.
First, the labels used in this file need to be wrapped in `Label`, so that we can use the installer target from the internal repo. Second, when unpacking zips, the path passed to `ripunzip` included a trailing `\n`, which caused `ripunzip` to fail.
1 parent 61593ae commit e2cb563

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

misc/bazel/internal/install.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
for line in manifest:
5151
prefix, _, zip = line.partition(":")
5252
assert zip, f"missing prefix for {prefix}, you should use prefix:zip format"
53+
zip = zip.strip()
5354
dest = destdir / prefix
5455
dest.mkdir(parents=True, exist_ok=True)
5556
subprocess.run([ripunzip, "unzip-file", zip, "-d", dest], check=True)

misc/bazel/pkg.bzl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -367,14 +367,14 @@ def codeql_pack(
367367
)
368368
py_binary(
369369
name = internal("installer"),
370-
srcs = ["//misc/bazel/internal:install.py"],
371-
main = "//misc/bazel/internal:install.py",
370+
srcs = [Label("//misc/bazel/internal:install.py")],
371+
main = Label("//misc/bazel/internal:install.py"),
372372
data = [
373373
internal("build-file"),
374374
internal("script"),
375375
] + ([
376376
internal("zip-manifest"),
377-
"//misc/bazel/internal/ripunzip",
377+
Label("//misc/bazel/internal/ripunzip"),
378378
] if zips else []),
379379
deps = ["@rules_python//python/runfiles"],
380380
args = [
@@ -383,7 +383,7 @@ def codeql_pack(
383383
"--destdir",
384384
install_dest,
385385
] + ([
386-
"--ripunzip=$(rlocationpath //misc/bazel/internal/ripunzip)",
386+
"--ripunzip=$(rlocationpath " + str(Label("//misc/bazel/internal/ripunzip")) + ")",
387387
"--zip-manifest=$(rlocationpath %s)" % internal("zip-manifest"),
388388
] if zips else []),
389389
visibility = visibility,

0 commit comments

Comments
 (0)