mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
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.
This commit is contained in:
@@ -50,6 +50,7 @@ if opts.zip_manifest:
|
|||||||
for line in manifest:
|
for line in manifest:
|
||||||
prefix, _, zip = line.partition(":")
|
prefix, _, zip = line.partition(":")
|
||||||
assert zip, f"missing prefix for {prefix}, you should use prefix:zip format"
|
assert zip, f"missing prefix for {prefix}, you should use prefix:zip format"
|
||||||
|
zip = zip.strip()
|
||||||
dest = destdir / prefix
|
dest = destdir / prefix
|
||||||
dest.mkdir(parents=True, exist_ok=True)
|
dest.mkdir(parents=True, exist_ok=True)
|
||||||
subprocess.run([ripunzip, "unzip-file", zip, "-d", dest], check=True)
|
subprocess.run([ripunzip, "unzip-file", zip, "-d", dest], check=True)
|
||||||
|
|||||||
@@ -367,14 +367,14 @@ def codeql_pack(
|
|||||||
)
|
)
|
||||||
py_binary(
|
py_binary(
|
||||||
name = internal("installer"),
|
name = internal("installer"),
|
||||||
srcs = ["//misc/bazel/internal:install.py"],
|
srcs = [Label("//misc/bazel/internal:install.py")],
|
||||||
main = "//misc/bazel/internal:install.py",
|
main = Label("//misc/bazel/internal:install.py"),
|
||||||
data = [
|
data = [
|
||||||
internal("build-file"),
|
internal("build-file"),
|
||||||
internal("script"),
|
internal("script"),
|
||||||
] + ([
|
] + ([
|
||||||
internal("zip-manifest"),
|
internal("zip-manifest"),
|
||||||
"//misc/bazel/internal/ripunzip",
|
Label("//misc/bazel/internal/ripunzip"),
|
||||||
] if zips else []),
|
] if zips else []),
|
||||||
deps = ["@rules_python//python/runfiles"],
|
deps = ["@rules_python//python/runfiles"],
|
||||||
args = [
|
args = [
|
||||||
@@ -383,7 +383,7 @@ def codeql_pack(
|
|||||||
"--destdir",
|
"--destdir",
|
||||||
install_dest,
|
install_dest,
|
||||||
] + ([
|
] + ([
|
||||||
"--ripunzip=$(rlocationpath //misc/bazel/internal/ripunzip)",
|
"--ripunzip=$(rlocationpath " + str(Label("//misc/bazel/internal/ripunzip")) + ")",
|
||||||
"--zip-manifest=$(rlocationpath %s)" % internal("zip-manifest"),
|
"--zip-manifest=$(rlocationpath %s)" % internal("zip-manifest"),
|
||||||
] if zips else []),
|
] if zips else []),
|
||||||
visibility = visibility,
|
visibility = visibility,
|
||||||
|
|||||||
Reference in New Issue
Block a user