endojs / endo

Endo is a distributed secure JavaScript sandbox, based on SES
Apache License 2.0
761 stars 68 forks source link

compartment-mapper build fails with pnpm #2328

Open turadg opened 1 week ago

turadg commented 1 week ago

Describe the bug

I tried out Yarn’s pnpm-linker in https://github.com/endojs/endo/pull/2327 It’s failing at,

lerna ERR! yarn run build exited 1 in '@endo/test262-runner'
lerna ERR! yarn run build stderr:
Error running main: Error: Cannot find dependency eshost for file:///home/runner/work/endo/endo/packages/test262-runner/node_modules/test262-harness/
    at gatherDependency (file:///home/runner/work/endo/endo/packages/compartment-mapper/src/node-modules.js:485:11)

I thought it might be a missing dependency declaration, but the lockfile shows

"test262-harness@npm:^10.0.0":
  version: 10.0.0
  resolution: "test262-harness@npm:10.0.0"
  dependencies:
    eshost: "npm:^9.0.0"
    minimatch: "npm:^3.0.4"
    rxjs: "npm:^6.4.0"
    test262-stream: "npm:^1.3.0"
    yargs: "npm:^13.2.2"

node_modules/test262-harness has no node_modules inside it. I take it gatherDependency is making some assumption that doesn't hold with pnpm-style linking

https://github.com/endojs/endo/blob/96b01404cc2d82d6fc74d723032b128732d5c633/packages/compartment-mapper/src/node-modules.js#L137-L144

Steps to reproduce

  1. gh pr checkout 2327
  2. yarn install
  3. yarn build

Expected behavior

Builds

Platform environment