Skip to content

Commit 931d70f

Browse files
authored
chore: add back env paths setting so cortex engine can load libraries properly (#4625)
* chore: add back env paths setting so cortex engine can load libraries properly * chore: bump cortex
1 parent 1fe1523 commit 931d70f

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.10-rc1
1+
1.0.10-rc3

extensions/inference-cortex-extension/src/node/index.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ function run(): Promise<any> {
2727
const binPath = path.join(__dirname, '..', 'bin')
2828

2929
const executablePath = path.join(binPath, binaryName)
30+
31+
addEnvPaths(binPath)
32+
3033
const sharedPath = path.join(appResourcePath(), 'shared')
3134
// Execute the binary
3235
log(`[CORTEX]:: Spawn cortex at path: ${executablePath}`)
@@ -75,6 +78,22 @@ function dispose() {
7578
watchdog?.terminate()
7679
}
7780

81+
/**
82+
* Set the environment paths for the cortex subprocess
83+
* @param dest
84+
*/
85+
function addEnvPaths(dest: string) {
86+
// Add engine path to the PATH and LD_LIBRARY_PATH
87+
if (process.platform === 'win32') {
88+
process.env.PATH = (process.env.PATH || '').concat(path.delimiter, dest)
89+
} else {
90+
process.env.LD_LIBRARY_PATH = (process.env.LD_LIBRARY_PATH || '').concat(
91+
path.delimiter,
92+
dest
93+
)
94+
}
95+
}
96+
7897
/**
7998
* Cortex process info
8099
*/

0 commit comments

Comments
 (0)