4848sys .path .append (".." )
4949from utils import GraalManager , parse_args , is_windows
5050
51+
5152def look_for_files_in_env (files : list [str ], env_var_name : str ) -> dict [str , str ] | None :
5253 """
5354 Look for required `files` in directories listed in the value of the
@@ -66,9 +67,10 @@ def look_for_files_in_env(files: list[str], env_var_name: str) -> dict[str, str]
6667 for file , dir in res .items ():
6768 if dir is None :
6869 one_not_found = True
69- print (f" Cannot find \ "{ file } \ " in { env_var_name } " )
70+ print (f' Cannot find "{ file } " in { env_var_name } ' )
7071 return None if one_not_found else res
7172
73+
7274if __name__ == "__main__" :
7375 # Create utils
7476 graal = GraalManager ()
@@ -93,29 +95,34 @@ def look_for_files_in_env(files: list[str], env_var_name: str) -> dict[str, str]
9395
9496 # We also need to provide rpath-links to the compiler to allow it to
9597 # find libraries during linking phase.
96- ld_library_path = os .environ .get (' LD_LIBRARY_PATH' )
98+ ld_library_path = os .environ .get (" LD_LIBRARY_PATH" )
9799 rpaths = (
98100 [f"-Wl,-rpath-link={ p } " for p in ld_library_path .split (os .pathsep )]
99- if ld_library_path else
100- []
101+ if ld_library_path
102+ else []
101103 )
102104
103- os_specific_options .extend ([
104- # The G1 garbage collector is only supported on Linux for now
105- "--gc=G1" ,
106-
107- # Then we add additional options for the C compiler
108- * [f"--native-compiler-options=-I{ dir } " for dir in headers_paths .values ()],
109- * [f"--native-compiler-options=-L{ dir } " for dir in libs_paths .values ()],
110- * [f"--native-compiler-options={ rp } " for rp in rpaths ],
111- ])
105+ os_specific_options .extend (
106+ [
107+ # The G1 garbage collector is only supported on Linux for now
108+ "--gc=G1" ,
109+ # Then we add additional options for the C compiler
110+ * [
111+ f"--native-compiler-options=-I{ dir } "
112+ for dir in headers_paths .values ()
113+ ],
114+ * [f"--native-compiler-options=-L{ dir } " for dir in libs_paths .values ()],
115+ * [f"--native-compiler-options={ rp } " for rp in rpaths ],
116+ ]
117+ )
112118
113119 # Run the Native-Image compiler if required by the build process
114120 if "lkql_cli" in args .native_components :
115121 # Create the base Native-Image command
116122 cmd = [
117123 graal .native_image ,
118- "-cp" , args .classpath ,
124+ "-cp" ,
125+ args .classpath ,
119126 "--no-fallback" ,
120127 "--initialize-at-build-time" ,
121128 * os_specific_options ,
0 commit comments