@@ -33,7 +33,9 @@ def preprocess(i):
3333 env ['MLC_GEEKBENCH_NEED_EXTRACT' ] = 'no'
3434 elif os_info ['platform' ] == 'linux' :
3535 if env .get ('MLC_GEEKBENCH_INSTALLED_PATH' , '' ) != '' :
36- build_path = os .path .join (env ['MLC_GEEKBENCH_INSTALLED_PATH' ], f"build.{ host_os_machine } " )
36+ build_path = os .path .join (
37+ env ['MLC_GEEKBENCH_INSTALLED_PATH' ],
38+ f"build.{ host_os_machine } " )
3739 if os .path .exists (build_path ):
3840 env ['MLC_GEEKBENCH_INSTALLED_PATH' ] = build_path
3941 if host_os_machine in ('aarch64' , 'arm64' ):
@@ -94,7 +96,8 @@ def postprocess(i):
9496 # Fallback: try to find in the install dir
9597 if install_dir and os .path .isdir (install_dir ):
9698 for f in os .listdir (install_dir ):
97- if f .lower ().startswith (f'geekbench{ env ["MLC_GEEKBENCH_VERSION_MAJOR" ]} ' ) and f .lower ().endswith ('.exe' ):
99+ if f .lower ().startswith (
100+ f'geekbench{ env ["MLC_GEEKBENCH_VERSION_MAJOR" ]} ' ) and f .lower ().endswith ('.exe' ):
98101 geekbench_bin = os .path .join (install_dir , f )
99102 break
100103
@@ -107,8 +110,11 @@ def postprocess(i):
107110
108111 else :
109112 # Linux / macOS: extracted archive
110- geekbench_dir = env .get ('MLC_GEEKBENCH_INSTALLED_PATH' , env .get ('MLC_GEEKBENCH_EXTRACTED_PATH' , '' ))
111- if geekbench_dir == '' and env .get ('MLC_GEEKBENCH_INSTALLED_PATH' , '' ) == '' :
113+ geekbench_dir = env .get (
114+ 'MLC_GEEKBENCH_INSTALLED_PATH' , env .get (
115+ 'MLC_GEEKBENCH_EXTRACTED_PATH' , '' ))
116+ if geekbench_dir == '' and env .get (
117+ 'MLC_GEEKBENCH_INSTALLED_PATH' , '' ) == '' :
112118 return {'return' : 1 ,
113119 'error' : 'MLC_GEEKBENCH_EXTRACTED_PATH not set - download-and-extract may have failed' }
114120
0 commit comments