Make sure the plugin runs with LD_LIBRARY_PATH

Not sure why the environment isn't taken over.

Contribute to CURA-11356
This commit is contained in:
Jelle Spijker 2024-02-26 11:18:10 +01:00
parent 524a31f02b
commit f9ad274e28
No known key found for this signature in database
GPG Key ID: 0E9129B3096F4E72

View File

@ -92,10 +92,13 @@ class BackendPlugin(AdditionalSettingDefinitionsAppender, PluginObject):
"stderr": subprocess.STDOUT, # Combine stderr and stdout
"env": os.environ
}
run_prep_cmd = ""
if Platform.isWindows():
popen_kwargs["creationflags"] = subprocess.CREATE_NO_WINDOW
else:
run_prep_cmd = f"LD_LIBRARY_PATH={os.environ['LD_LIBRARY_PATH']}:$LD_LIBRARY_PATH "
Logger.info(f"Starting plugin with: {popen_kwargs}")
self._process = subprocess.Popen(self._validatePluginCommand(), **popen_kwargs)
self._process = subprocess.Popen(f"{run_prep_cmd}{self._validatePluginCommand()}", **popen_kwargs)
self._is_running = True
return True
except PermissionError: