17
17
18
18
* `--image`: Change the default build image
19
19
* `--output-dir`: Change the output directory, which contains caches and build
20
+ or Python packages
21
+ * `--artifact-dir`: Change the source artifacts/ directory to build Python
22
+ packages from
20
23
"""
21
24
22
25
import argparse
@@ -57,6 +60,14 @@ def do_build(args: argparse.Namespace, *, rest_args: list[str]):
57
60
]
58
61
)
59
62
63
+ if args .build_python_only :
64
+ cl .extend (
65
+ [
66
+ "--mount" ,
67
+ f"type=bind,src={ args .artifact_dir } ,dst=/therock/artifacts" ,
68
+ ]
69
+ )
70
+
60
71
if args .interactive :
61
72
cl .extend (
62
73
[
@@ -65,6 +76,15 @@ def do_build(args: argparse.Namespace, *, rest_args: list[str]):
65
76
"/bin/bash" ,
66
77
]
67
78
)
79
+ elif args .build_python_only :
80
+ cl .extend (
81
+ [
82
+ args .image ,
83
+ "/bin/bash" ,
84
+ "/therock/src/build_tools/detail/linux_python_package_in_container.sh" ,
85
+ ]
86
+ )
87
+ cl += rest_args
68
88
else :
69
89
cl .extend (
70
90
[
@@ -122,6 +142,18 @@ def main(argv: list[str]):
122
142
action = argparse .BooleanOptionalAction ,
123
143
help = "Enter interactive shell vs invoking the build" ,
124
144
)
145
+ p .add_argument (
146
+ "--build-python-only" ,
147
+ action = "store_true" ,
148
+ default = False ,
149
+ help = "Build only Python packages" ,
150
+ )
151
+ p .add_argument (
152
+ "--artifact-dir" ,
153
+ default = Path (REPO_DIR / "output-linux-portable" / "build" / "artifacts" ),
154
+ type = Path ,
155
+ help = "Source artifacts/ dir from a build" ,
156
+ )
125
157
126
158
args = p .parse_args (argv )
127
159
do_build (args , rest_args = rest_args )
0 commit comments