Skip to content

Commit

Permalink
Don't change LD_LIBRARY_PATH when running as an AppImage
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Dubois <jan.dubois@suse.com>
  • Loading branch information
jandubois committed Jan 9, 2025
1 parent 944c691 commit 18fb126
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions pkg/rancher-desktop/backend/lima.ts
Original file line number Diff line number Diff line change
Expand Up @@ -752,13 +752,18 @@ export default class LimaBackend extends events.EventEmitter implements VMBacken
const VMNETDir = path.join(VMNET_DIR, 'bin');
const pathList = (process.env.PATH || '').split(path.delimiter);
const newPath = [binDir, VMNETDir].concat(...pathList).filter(x => x);
const env = structuredClone(process.env);

// LD_LIBRARY_PATH is set for running from an extracted Linux zip file, that includes QEMU,
// to make sure QEMU dependencies are loaded from the bundled lib directory,
// LD_LIBRARY_PATH is ignored on macOS.
return {
...process.env, LIMA_HOME: paths.lima, LD_LIBRARY_PATH: libDir, PATH: newPath.join(path.delimiter),
};
env['LIMA_HOME'] = paths.lima;
env['PATH'] = newPath.join(path.delimiter);
if (!env['APPIMAGE']) {
// LD_LIBRARY_PATH is set for running from an extracted Linux zip file, that includes QEMU,
// to make sure QEMU dependencies are loaded from the bundled lib directory,
// LD_LIBRARY_PATH is ignored on macOS.
env['LD_LIBRARY_PATH'] = libDir;
}

return env;
}

protected static get qemuImgEnv() {
Expand Down

0 comments on commit 18fb126

Please sign in to comment.