File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,14 @@ def __init__(self):
109
109
install_kclvm (env_install_path )
110
110
self .lib = ctypes .CDLL (os .path .join (env_install_path , lib_full_name ()))
111
111
else :
112
- self .lib = ctypes .CDLL (os .path .join (lib_path (), lib_full_name ()))
112
+ # Set the kcl lib and open it.
113
+ path = lib_path ()
114
+ path_env = os .environ .get ("PATH" , "" )
115
+ bin_path_str = str (path )
116
+ new_path_env = f"{ path_env } { os .pathsep } { bin_path_str } "
117
+ os .environ ["PATH" ] = new_path_env
118
+ os .environ [KCLVM_CLI_BIN_PATH_ENV_VAR ] = bin_path_str
119
+ self .lib = ctypes .CDLL (os .path .join (path , lib_full_name ()))
113
120
# Assuming the shared library exposes a function `kclvm_service_new`
114
121
self .lib .kclvm_service_new .argtypes = [ctypes .c_uint64 ]
115
122
self .lib .kclvm_service_new .restype = ctypes .c_void_p
You can’t perform that action at this time.
0 commit comments