Skip to content

Commit

Permalink
server: fixup versioned prefix/node_modules path
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed Mar 29, 2023
1 parent 12643cd commit c1c5a42
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion server/python/plugin_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,11 +397,13 @@ def onProxySerialization(value: Any, proxyId: str):
python_versioned_directory = '%s-%s-%s' % (python_version, platform.system(), platform.machine())
SCRYPTED_BASE_VERSION = os.environ.get('SCRYPTED_BASE_VERSION')
if SCRYPTED_BASE_VERSION:
python_versioned_directory += SCRYPTED_BASE_VERSION
python_versioned_directory += '-' + SCRYPTED_BASE_VERSION

python_prefix = os.path.join(
plugin_volume, python_versioned_directory)

print('python prefix: %s' % python_prefix)

if not os.path.exists(python_prefix):
os.makedirs(python_prefix)

Expand Down
2 changes: 1 addition & 1 deletion server/src/plugin/plugin-npm-dependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function getPluginNodePath(name: string) {
let nodeVersionedDirectory = `node${nodeMajorVersion}-${process.platform}-${process.arch}`;
const scryptedBase = process.env.SCRYPTED_BASE_VERSION;
if (scryptedBase)
nodeVersionedDirectory += '-' + nodeVersionedDirectory;
nodeVersionedDirectory += '-' + scryptedBase;
const nodePrefix = path.join(pluginVolume, nodeVersionedDirectory);
return nodePrefix;
}
Expand Down
1 change: 1 addition & 0 deletions server/src/plugin/plugin-remote-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ export function startPluginRemote(mainFilename: string, pluginId: string, peerSe
const pluginConsole = getPluginConsole?.();
params.console = pluginConsole;
const pnp = getPluginNodePath(pluginId);
pluginConsole?.log('node modules', pnp);
params.require = (name: string) => {
if (name === 'fakefs' || (name === 'fs' && !packageJson.scrypted.realfs)) {
return volume;
Expand Down

0 comments on commit c1c5a42

Please sign in to comment.