Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Node binary incompatibility #155

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

fix Node binary incompatibility #155

wants to merge 1 commit into from

Conversation

turadg
Copy link
Member

@turadg turadg commented Apr 23, 2024

closes: #151

Test plan

I ran the updated doctor locally and confirmed there's no .node file.

I haven't yet tested with test --debug because my env is running into a different problem missing --no-validate. @Chris-Hibbert can you confirm this fixes #151? (e.g. copy this change a3p-integration/node_modules/@agoric/synthetic-chain/dist/cli/cli.js then run yarn doctor and then yarn test --debug -m upgrade-next)

Copy link
Member

@dckc dckc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only have intel CPUs, so I'm not in a good position to verify this.

@@ -35,7 +35,11 @@ const fixupProposal = (proposal: ProposalInfo) => {

// refresh install
execSync('rm -rf node_modules', { cwd: proposalPath });
execSync('yarn install', { cwd: proposalPath });
// install to update yarn.lock and get importable typed modules but
// skip building because the proposal never runs on the local filesystem.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my mental model is missing something...

What provides the binaries when the proposal runs?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

node_modules in the Docker image. It's already there. I had hoped that the mount would only be an overlay, but that was wrong. With mounting there's no way around running yarn install inside the container. I'll try to automate that so the developer doesn't have to remember/know.

@Chris-Hibbert
Copy link
Contributor

I replaced one yarn install line with another in cli.js as instructed, then ran yarn doctor. It said

WARN ignoring non-package in proposal directory: min.sh
WARN ignoring non-package in proposal directory: slog-2024-03-05-A.slog
WARN ignoring non-package in proposal directory: slog-2024-03-20-A.slog
Running doctor...
enabling corepack
/private/var/folders/xh/wrgn7krj0xg45wx7dclfrgbh0000gn/T/xfs-5cd75c4e/yarn

Verifying the CLI runs and create the Dockerfiles
WARN ignoring non-package in proposal directory: min.sh
WARN ignoring non-package in proposal directory: slog-2024-03-05-A.slog
WARN ignoring non-package in proposal directory: slog-2024-03-20-A.slog
Verifying the install Docker Buildx is new enough to handle the Bake file

checking proposal upgrade-next ...
found "yarn" packageManager, processing...
passed

checking proposal localchain ...
found "yarn" packageManager, processing...
passed

checking proposal stake-bld ...
found "yarn" packageManager, processing...
passed

I then ran yarn test --debug -m upgrade-next, which complained 'Could not locate the bindings file.'

details

  Ensure Network Vat was installed

  post.test.js:6

   5: test(`Ensure Network Vat was installed`, async t => { 
   6:   const incarnation = await getIncarnation('network');
   7:   t.is(incarnation, 0);                               

  Rejected promise returned by test. Reason:

  Error {
    tries: [
      '/usr/src/proposals/a:upgrade-next/node_modules/better-sqlite3/build/better_sqlite3.node',
      '/usr/src/proposals/a:upgrade-next/node_modules/better-sqlite3/build/Debug/better_sqlite3.node',
      '/usr/src/proposals/a:upgrade-next/node_modules/better-sqlite3/build/Release/better_sqlite3.node',
      '/usr/src/proposals/a:upgrade-next/node_modules/better-sqlite3/out/Debug/better_sqlite3.node',
      '/usr/src/proposals/a:upgrade-next/node_modules/better-sqlite3/Debug/better_sqlite3.node',
      '/usr/src/proposals/a:upgrade-next/node_modules/better-sqlite3/out/Release/better_sqlite3.node',
      '/usr/src/proposals/a:upgrade-next/node_modules/better-sqlite3/Release/better_sqlite3.node',
      '/usr/src/proposals/a:upgrade-next/node_modules/better-sqlite3/build/default/better_sqlite3.node',
      '/usr/src/proposals/a:upgrade-next/node_modules/better-sqlite3/compiled/18.19.1/linux/arm64/better_sqlite3.node',
      '/usr/src/proposals/a:upgrade-next/node_modules/better-sqlite3/addon-build/release/install-root/better_sqlite3.node',
      '/usr/src/proposals/a:upgrade-next/node_modules/better-sqlite3/addon-build/debug/install-root/better_sqlite3.node',
      '/usr/src/proposals/a:upgrade-next/node_modules/better-sqlite3/addon-build/default/install-root/better_sqlite3.node',
      '/usr/src/proposals/a:upgrade-next/node_modules/better-sqlite3/lib/binding/node-v108-linux-arm64/better_sqlite3.node',
    ],
    message: `Could not locate the bindings file. Tried:␊
     → /usr/src/proposals/a:upgrade-next/node_modules/better-sqlite3/build/better_sqlite3.node␊
     → /usr/src/proposals/a:upgrade-next/node_modules/better-sqlite3/build/Debug/better_sqlite3.node␊
     → /usr/src/proposals/a:upgrade-next/node_modules/better-sqlite3/build/Release/better_sqlite3.node␊
     → /usr/src/proposals/a:upgrade-next/node_modules/better-sqlite3/out/Debug/better_sqlite3.node␊
     → /usr/src/proposals/a:upgrade-next/node_modules/better-sqlite3/Debug/better_sqlite3.node␊
     → /usr/src/proposals/a:upgrade-next/node_modules/better-sqlite3/out/Release/better_sqlite3.node␊
     → /usr/src/proposals/a:upgrade-next/node_modules/better-sqlite3/Release/better_sqlite3.node␊
     → /usr/src/proposals/a:upgrade-next/node_modules/better-sqlite3/build/default/better_sqlite3.node␊
     → /usr/src/proposals/a:upgrade-next/node_modules/better-sqlite3/compiled/18.19.1/linux/arm64/better_sqlite3.node␊
     → /usr/src/proposals/a:upgrade-next/node_modules/better-sqlite3/addon-build/release/install-root/better_sqlite3.node␊
     → /usr/src/proposals/a:upgrade-next/node_modules/better-sqlite3/addon-build/debug/install-root/better_sqlite3.node␊
     → /usr/src/proposals/a:upgrade-next/node_modules/better-sqlite3/addon-build/default/install-root/better_sqlite3.node␊
     → /usr/src/proposals/a:upgrade-next/node_modules/better-sqlite3/lib/binding/node-v108-linux-arm64/better_sqlite3.node`,
  }

  › → node_modules/better-sqlite3/lib/binding/node-v108-linux-arm64/better_sqlite3.node
  › bindings (node_modules/bindings/bindings.js:126:9)
  › new Database (node_modules/better-sqlite3/lib/database.js:48:64)
  › Database (node_modules/better-sqlite3/lib/database.js:11:10)
  › getVatDetails (node_modules/@agoric/synthetic-chain/src/lib/vat-status.js:74:33)
  › getIncarnation (node_modules/@agoric/synthetic-chain/src/lib/vat-status.js:88:25)
  › file://post.test.js:6:29

@Chris-Hibbert
Copy link
Contributor

If I do yarn install first, the test passes.

DOCKER  a:upgrade-next   2> pushd /usr/src/proposals/a\:upgrade-next/
/usr/src/proposals/a:upgrade-next /usr/src/upgrade-test-scripts
DOCKER  a:upgrade-next   3 > yarn install
➤ YN0000: · Yarn 4.1.0
➤ YN0000: ┌ Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0013: │ 250 packages were added to the project (+ 22.89 MiB).
➤ YN0000: └ Completed in 1s 958ms
➤ YN0000: ┌ Link step
➤ YN0007: │ better-sqlite3@npm:9.4.0 must be built because it never has been before or the last one failed
➤ YN0000: └ Completed in 0s 606ms
➤ YN0000: · Done in 2s 668ms
DOCKER  a:upgrade-next   4 > yarn ava post.test.js

{"vatName":"network","vatID":"v62","incarnation":0,"bundleID":"b1-8627f3ca1b8fa3f0e710f6988d764c7b7b6dd0c05662022c7c26cec089770d6a5e07ce5ca70b96244bdb024f5536ff3db452a223b48c5c88b1327579973e6c40"}
  ✔ Ensure Network Vat was installed
  ✔ Ensure IBC Vat was installed
  ✔ Ensure Local Chain Vat was installed
  ✔ Smart Wallet vat was upgraded
  ✔ Zoe vat was upgraded
{"vatName":"ibc","vatID":"v63","incarnation":0,"bundleID":"b1-9765ec9b2c6b8ceb503a5c771d533dff3722e2d6fe3007fa28ed989b6d7757601fb5ab3a8eee35f0e81664a84181eeb39df79e43148b83eb7f5035bf9f883d81"}
{"vatName":"localchain","vatID":"v64","incarnation":0,"bundleID":"b1-4536deaf064d3d02e0ac6508de46e22a1bc61b3b45f1336ab0a6734b1b75695a6e246bb8d2721bdcee0fd0a9b42a4218101279f0f695742d1e52e14c6a41b259"}
{"vatName":"walletFactory","vatID":"v43","incarnation":2,"bundleID":"b1-039c67a6e86acfc64c3d8bce9a8a824d5674eda18680f8ecf071c59724798945b086c4bac2a6065bed7f79ca6ccc23e8f4a464dfe18f2e8eaa9719327107f15b"}
{"vatName":"zoe","vatID":"v9","incarnation":1,"bundleID":"b1-7f4f6367959a55d283506428cb84c458f1ca4056854ad0b4465e4cc6711e20401ee4a6c2c368cfde86d3a0fea23255cb55b0a1ad89381fd9f2a7b9c729697637"}
  ─

  5 tests passed

@turadg turadg marked this pull request as draft April 24, 2024 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test debug mode can break sqlite3
3 participants