Agoric / agoric-3-proposals

Proposals run or planned for Mainnet (agoric-3)
Apache License 2.0
0 stars 2 forks source link

test debug mode can break sqlite3 #151

Open turadg opened 2 months ago

turadg commented 2 months ago

Problem

better_sqlite3.node is a binary dependency of many proposals. It's built with node-gyp and links to the Node binary.

The --debug option for the test command mounts the local filesystem on top of the Docker container's. If the local fs has a node_modules with an incompatible sqlite3 binary then you'll see an error like,

  Error {
    code: 'ERR_DLOPEN_FAILED',
    message: '/usr/src/proposals/a:upgrade-next/node_modules/better-sqlite3/build/Release/better_sqlite3.node: invalid ELF header',
  }

Workaround

Run yarn install within the Docker container to rebuild deps.

Long term fix

TBD. The local fs should have a node_modules so that types resolve. Ideally we could ignore node_modules through the mount. I don't know yet whether that's possible. @toliaqat ?

mhofman commented 2 months ago

Ideally we could ignore node_modules through the mount. I don't know yet whether that's possible. @toliaqat ?

A mount is what it says, a direct mount of the whole directory. There is no filtering.