Skip to content

compartment-mapper build fails with pnpm #2328

Open
@turadg

Description

@turadg

Describe the bug

I tried out Yarn’s pnpm-linker in #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

/**
* findPackage behaves as Node.js to find third-party modules by searching
* parent to ancestor directories for a `node_modules` directory that contains
* the name.
* Node.js does not actually require these to be packages, but in practice,
* these are the locations that pakcage managers drop a package so Node.js can
* find it efficiently.
*

Steps to reproduce

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

Expected behavior

Builds

Platform environment

  • MacOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions