2929PLATFORM_CONFIGS = {
3030 "linux/amd64" : {
3131 "build_script" : "clp-env-base-manylinux_2_28_x86_64/build.sh" ,
32- "docker_image" : "clp-core-dependencies-manylinux_2_28_x86_64"
32+ "docker_image" : "clp-core-dependencies-manylinux_2_28_x86_64" ,
3333 },
3434 "linux/arm64" : {
3535 "build_script" : "clp-env-base-manylinux_2_28_aarch64/build.sh" ,
36- "docker_image" : "clp-core-dependencies-manylinux_2_28_aarch64"
37- }
36+ "docker_image" : "clp-core-dependencies-manylinux_2_28_aarch64" ,
37+ },
3838}
3939
4040
@@ -63,9 +63,7 @@ def _find_project_root() -> Path:
6363
6464
6565def _build_clp_manylinux_2_28_binaries (
66- output_path : Path ,
67- target_platform : str ,
68- use_shared_libs : bool = False
66+ output_path : Path , target_platform : str , use_shared_libs : bool = False
6967) -> None :
7068 """
7169 Builds the CLP-core binaries for the specified target platform
@@ -80,14 +78,21 @@ def _build_clp_manylinux_2_28_binaries(
8078 build_script = Path ("/clp/components/core/tools/scripts/utils/build.py" )
8179
8280 cmd = [
83- "docker" , "run" ,
84- "--user" , f"{ os .getuid ()} :{ os .getgid ()} " ,
85- "--platform" , target_platform ,
86- "-v" , f"{ project_root } :/clp" ,
87- "-v" , f"{ output_path } :/output" ,
81+ "docker" ,
82+ "run" ,
83+ "--user" ,
84+ f"{ os .getuid ()} :{ os .getgid ()} " ,
85+ "--platform" ,
86+ target_platform ,
87+ "-v" ,
88+ f"{ project_root } :/clp" ,
89+ "-v" ,
90+ f"{ output_path } :/output" ,
8891 f"{ config ['docker_image' ]} :dev" ,
89- "python3" , str (build_script ),
90- "--build-dir" , "/output"
92+ "python3" ,
93+ str (build_script ),
94+ "--build-dir" ,
95+ "/output" ,
9196 ]
9297 if use_shared_libs :
9398 cmd .append ("--use-shared-libs" )
@@ -101,24 +106,20 @@ def _build_clp_manylinux_2_28_binaries(
101106
102107
103108def main (argv : List [str ]) -> int :
104- args_parser = argparse .ArgumentParser (
105- description = "Builds the CLP-core's binaries"
106- )
109+ args_parser = argparse .ArgumentParser (description = "Builds the CLP-core's binaries" )
107110 args_parser .add_argument (
108- "--output-dir" ,
109- required = True ,
110- help = "Directory to put the compiled CLP-core binaries in."
111+ "--output-dir" , required = True , help = "Directory to put the compiled CLP-core binaries in."
111112 )
112113 args_parser .add_argument (
113114 "--use-shared-libs" ,
114115 action = "store_true" ,
115- help = "Build targets by linking against shared libraries."
116+ help = "Build targets by linking against shared libraries." ,
116117 )
117118 args_parser .add_argument (
118119 "--target-platform" ,
119120 default = "linux/amd64" ,
120121 choices = ["linux/amd64" , "linux/arm64" ],
121- help = "Target platform of the compiled binary: linux/amd64 or linux/arm64"
122+ help = "Target platform of the compiled binary: linux/amd64 or linux/arm64" ,
122123 )
123124
124125 parsed_args = args_parser .parse_args (argv [1 :])
@@ -130,9 +131,7 @@ def main(argv: List[str]) -> int:
130131
131132 _build_clp_env_base_image (parsed_args .target_platform )
132133 _build_clp_manylinux_2_28_binaries (
133- output_dir ,
134- parsed_args .target_platform ,
135- parsed_args .use_shared_libs
134+ output_dir , parsed_args .target_platform , parsed_args .use_shared_libs
136135 )
137136
138137 logger .info ("Build process completed successfully." )
0 commit comments