Skip to content

Commit c808953

Browse files
authored
Merge pull request github#16723 from github/criemen/codeql-pack-group
`pkg.bzl`: Significantly restructure `codeql_pack` rule.
2 parents 3525967 + 58f69c9 commit c808953

File tree

5 files changed

+292
-208
lines changed

5 files changed

+292
-208
lines changed

javascript/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,5 @@ codeql_pack(
3333
"//javascript/extractor:tools-extractor",
3434
"//javascript/resources",
3535
],
36-
visibility = ["//visibility:public"],
3736
zips = {"//javascript/extractor/lib/typescript": "tools"},
3837
)

misc/bazel/internal/install.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
help="Desination directory, relative to `--build-file`")
2222
parser.add_argument("--pkg-install-script", required=True,
2323
help="The wrapped `pkg_install` installation script rlocation")
24-
parser.add_argument("--build-file", required=True,
24+
parser.add_argument("--build-file",
2525
help="BUILD.bazel rlocation relative to which the installation should take place")
2626
parser.add_argument("--ripunzip",
2727
help="ripunzip executable rlocation. Must be provided if `--zip-manifest` is.")
@@ -33,9 +33,13 @@
3333
if opts.zip_manifest and not opts.ripunzip:
3434
parser.error("Provide `--ripunzip` when specifying `--zip-manifest`")
3535

36-
build_file = runfiles.Rlocation(opts.build_file)
36+
if opts.build_file:
37+
build_file = runfiles.Rlocation(opts.build_file)
38+
destdir = pathlib.Path(build_file).resolve().parent / opts.destdir
39+
else:
40+
destdir = pathlib.Path(opts.destdir)
41+
assert destdir.is_absolute(), "Provide `--build-file` to resolve destination directory"
3742
script = runfiles.Rlocation(opts.pkg_install_script)
38-
destdir = pathlib.Path(build_file).resolve().parent / opts.destdir
3943

4044
if destdir.exists() and opts.cleanup:
4145
shutil.rmtree(destdir)

0 commit comments

Comments
 (0)