@@ -2366,17 +2366,18 @@ def run_cbuildrt(
23662366 environ = None ,
23672367 host_environ = None ,
23682368 ):
2369- workspace = _util .find_cbuildrt_workspace ()
2370- _util .try_mkdir (workspace , recursive = True )
2369+ workspace = _util .ensure_cbuildrt_workspace ()
23712370
23722371 cbuild_json = {
23732372 "user" : {"uid" : 0 , "gid" : 0 },
23742373 "process" : {
23752374 "args" : list (args ),
23762375 "environ" : environ or {},
23772376 },
2378- "subUid" : {"auto" : True , "self" : site_container_yml ["uid" ]},
2379- "subGid" : {"auto" : True , "self" : site_container_yml ["gid" ]},
2377+ "mapCurrentUserTo" : {
2378+ "uid" : site_container_yml ["uid" ],
2379+ "gid" : site_container_yml ["gid" ],
2380+ },
23802381 "bindMounts" : bind_mounts or [],
23812382 "volumes" : volumes or [],
23822383 }
@@ -2399,7 +2400,7 @@ def run_cbuildrt(
23992400 )
24002401
24012402 result = subprocess .call (
2402- ["cbuildrt" , "--workspace" , workspace , f .name ],
2403+ ["cbuildrt" , "run" , " --workspace" , workspace , f .name ],
24032404 env = host_environ ,
24042405 )
24052406 if result != 0 :
@@ -2842,8 +2843,10 @@ def run_program(
28422843 ],
28432844 }
28442845 if is_xbstrap_rootfs :
2845- cbuild_json ["subUid" ] = {"auto" : True , "self" : container_yml ["uid" ]}
2846- cbuild_json ["subGid" ] = {"auto" : True , "self" : container_yml ["gid" ]}
2846+ cbuild_json ["mapCurrentUserTo" ] = {
2847+ "uid" : container_yml ["uid" ],
2848+ "gid" : container_yml ["gid" ],
2849+ }
28472850 if sysroot is not None :
28482851 if verbosity :
28492852 _util .log_info (f"Bind mounting { sysroot } as sysroot" )
@@ -2868,10 +2871,9 @@ def run_program(
28682871 environ , "PATH" , prepend = [os .path .join (_util .find_home (), "bin" )]
28692872 )
28702873
2871- workspace = _util .find_cbuildrt_workspace ()
2872- _util .try_mkdir (workspace , recursive = True )
2874+ workspace = _util .ensure_cbuildrt_workspace ()
28732875 proc = subprocess .Popen (
2874- ["cbuildrt" , "--workspace" , workspace , f .name ],
2876+ ["cbuildrt" , "run" , " --workspace" , workspace , f .name ],
28752877 env = environ ,
28762878 )
28772879 proc .wait ()
0 commit comments