Skip to content

Commit 82cf9e0

Browse files
committed
Fix shared libs loading
1 parent 74cd7e4 commit 82cf9e0

File tree

1 file changed

+9
-26
lines changed

1 file changed

+9
-26
lines changed

packages/xeus/src/worker.ts

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,12 @@ export abstract class EmpackedXeusRemoteKernel extends XeusRemoteKernelBase {
178178
}
179179

180180
// Load shared libs
181-
await this._maybeLoadSharedLibs();
181+
await loadSharedLibs({
182+
sharedLibs: this._sharedLibs,
183+
prefix: '/',
184+
Module: this.Module,
185+
logger: this.logger
186+
});
182187
}
183188

184189
/**
@@ -326,36 +331,14 @@ export abstract class EmpackedXeusRemoteKernel extends XeusRemoteKernelBase {
326331
this._paths = { ...newPath, ...paths };
327332
this._sharedLibs = sharedLibs;
328333

329-
await this._maybeLoadSharedLibs();
330-
331-
this._env = newEnv;
332-
}
333-
334-
private async _maybeLoadSharedLibs() {
335-
const toLoad: TSharedLibsMap = {};
336-
337-
// If we're running in the Python kernel, load all cpython shared libs beforehand,
338-
// otherwise load everything but cpython shared libs
339-
if (this._pythonVersion) {
340-
for (const pkgName of Object.keys(this._sharedLibs)) {
341-
toLoad[pkgName] = this._sharedLibs[pkgName].filter(sharedLib =>
342-
sharedLib.includes('cpython-3')
343-
);
344-
}
345-
} else {
346-
for (const pkgName of Object.keys(this._sharedLibs)) {
347-
toLoad[pkgName] = this._sharedLibs[pkgName].filter(
348-
sharedLib => !sharedLib.includes('cpython-3')
349-
);
350-
}
351-
}
352-
353334
await loadSharedLibs({
354-
sharedLibs: toLoad,
335+
sharedLibs: this._sharedLibs,
355336
prefix: '/',
356337
Module: this.Module,
357338
logger: this.logger
358339
});
340+
341+
this._env = newEnv;
359342
}
360343

361344
private _pythonVersion: number[] | undefined;

0 commit comments

Comments
 (0)