MacPlatform: running install_name_tool with System.runCommand() works better than new Process()

new Process() was crashing before the process could start for some reason
This commit is contained in:
Josh Tynjala
2024-05-29 15:57:38 -07:00
parent d3d476a1f5
commit ae941e7442

View File

@@ -710,23 +710,13 @@ class MacPlatform extends PlatformTarget
if (isLibrary)
{
var newId = "@executable_path/" + fileName;
var process = new Process("install_name_tool", ["-id", newId, absoluteFilePath]);
var exitCode = process.exitCode(true);
if (exitCode != 0)
{
Log.error('install_name_tool -id process exited with code: <${exitCode}> for file <${fileName}>');
}
System.runCommand("", "install_name_tool", ["-id", newId, absoluteFilePath]);
}
for (homebrewPath in homebrewDependencyPaths)
{
var newPath = "@executable_path/" + Path.withoutDirectory(homebrewPath);
var process = new Process("install_name_tool", ["-change", homebrewPath, newPath, absoluteFilePath]);
var exitCode = process.exitCode(true);
if (exitCode != 0)
{
Log.error('install_name_tool -change process exited with code: <${exitCode}> for file <${Path.withoutDirectory(homebrewPath)}>');
}
System.runCommand("", "install_name_tool", ["-change", homebrewPath, newPath, absoluteFilePath]);
}
}
}