Skip to content

Commit 6b1c91c

Browse files
committed
pretty
1 parent ed2d5e0 commit 6b1c91c

3 files changed

Lines changed: 14 additions & 26 deletions

File tree

bazel/rules/macos/pkg/BUILD.bazel

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"""Macos packaging rules."""
2+
13
load("@rules_pkg//pkg:mappings.bzl", "pkg_filegroup", "pkg_files", "pkg_mklink")
24
load("@rules_python//python:py_binary.bzl", "py_binary")
35
load(":pkg_mac_pkg.bzl", "pkg_mac_pkg")
@@ -11,11 +13,6 @@ py_binary(
1113
visibility = ["//visibility:public"],
1214
)
1315

14-
exports_files([
15-
"pkg_mac_pkg.bzl",
16-
"materialize_root.py",
17-
])
18-
1916
# Manual smoke test: exercises the full materialize+pkgbuild pipeline against
2017
# real pkg_files srcs. Not wired into any real package yet.
2118
pkg_files(

bazel/rules/macos/pkg/build_mac_pkg.py

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@
2626
import tempfile
2727

2828

29-
def parse_args():
29+
def _install_script(src, dst):
30+
shutil.copyfile(src, dst)
31+
os.chmod(dst, 0o755)
32+
33+
34+
def main():
3035
parser = argparse.ArgumentParser(description=__doc__)
3136
parser.add_argument("--materialize-root-py", required=True, help="Path to materialize_root.py.")
3237
parser.add_argument("--root", required=True, help="pkg_install-materialized root directory (symlink farm).")
@@ -38,16 +43,8 @@ def parse_args():
3843
parser.add_argument("--preinstall", default="", help="Optional path to a preinstall script.")
3944
parser.add_argument("--postinstall", default="", help="Optional path to a postinstall script.")
4045
parser.add_argument("--signing-identity", default="", help="Optional pkgbuild --sign identity name.")
41-
return parser.parse_args()
42-
4346

44-
def _install_script(src, dst):
45-
shutil.copyfile(src, dst)
46-
os.chmod(dst, 0o755)
47-
48-
49-
def main():
50-
args = parse_args()
47+
args = parser.parse_args()
5148

5249
real_root_dir = tempfile.mkdtemp()
5350
scripts_dir = tempfile.mkdtemp()
@@ -57,16 +54,13 @@ def main():
5754
check=True,
5855
)
5956

57+
# fmt: off
6058
pkgbuild_args = [
6159
args.pkgbuild,
62-
"--root",
63-
real_root_dir,
64-
"--identifier",
65-
args.identifier,
66-
"--version",
67-
args.version,
68-
"--install-location",
69-
args.install_location,
60+
"--root", real_root_dir,
61+
"--identifier", args.identifier,
62+
"--version", args.version,
63+
"--install-location", args.install_location,
7064
]
7165

7266
if args.preinstall or args.postinstall:

bazel/rules/macos/pkg/pkg_mac_pkg.bzl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ bespoke manifest interpreter.
1515
load("@rules_pkg//pkg:install.bzl", "pkg_install")
1616

1717
def _pkg_mac_pkg_impl(ctx):
18-
# This is a temporary solution. In the future, we'll write the payload
19-
# directly from the source inputs, like pkg_tar
2018
# `pkg_install` produces a `bazel run`-able installer whose CLI insists on
2119
# an absolute --destdir (or BUILD_WORKSPACE_DIRECTORY for resolving a
2220
# relative one), since it's normally invoked interactively. Inside a
@@ -144,7 +142,6 @@ def pkg_mac_pkg(
144142
pkg_install(
145143
name = name + "_installer",
146144
srcs = srcs,
147-
tags = ["manual"],
148145
visibility = ["//visibility:private"],
149146
)
150147

0 commit comments

Comments
 (0)