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

yarn install fails in dapp frontends because of @agoric/xsnap #8288

Closed
anilhelvaci opened this issue Aug 31, 2023 · 8 comments · Fixed by #9262
Closed

yarn install fails in dapp frontends because of @agoric/xsnap #8288

anilhelvaci opened this issue Aug 31, 2023 · 8 comments · Fixed by #9262
Assignees
Labels
bug Something isn't working devex developer experience xsnap the XS execution tool

Comments

@anilhelvaci
Copy link
Collaborator

Describe the bug

I've observed in multiple dapps(dapp-inter included) that when I add a dependency that depends on agoric/xsnap to my dapp frontend's package.json and then call yarn install, the operation fails. Here's the dependencies from my dapp frontend;

//...
"dependencies": {
    "@agoric/rpc": "^0.5.0",
    "@agoric/smart-wallet": "^0.5.4-dev-f581a7e.0",
    "@agoric/ertp": "^0.16.3-u11.0",
    "@agoric/web-components": "0.11.1-dev-f8674ce.0",
    "@emotion/react": "^11.11.1",
    "@emotion/styled": "^11.11.0",
    "@endo/eventual-send": "^0.17.2",
    "@mui/material": "^5.14.7",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "sass": "^1.66.1",
    "zustand": "^4.4.1"
  },

I tried to isolate packages and here's the list of packages that cause the error;

  • "@agoric/smart-wallet": "^0.5.4-dev-f581a7e.0"
  • "@agoric/ertp": "^0.16.3-u11.0",
  • "@agoric/web-components": "0.11.1-dev-f8674ce.0",

All these packages have dependencies that depends on agoric/xsnap.

Here's the error message I get:

error /Users/anil/WebstormProjects/agoric-samples/crabble-ui/node_modules/@agoric/ertp/node_modules/@agoric/xsnap, /Users/anil/WebstormProjects/agoric-samples/crabble-ui/node_modules/@agoric/notifier/node_modules/@agoric/xsnap, /Users/anil/WebstormProjects/agoric-samples/crabble-ui/node_modules/@agoric/smart-wallet/node_modules/@agoric/xsnap: Command failed.
Exit code: 1
Command: yarn build:from-env
Arguments: 
Directory: /Users/anil/WebstormProjects/agoric-samples/crabble-ui/node_modules/@agoric/smart-wallet/node_modules/@agoric/xsnap
Output:
yarn run v1.22.19
$ { cat build.env; echo node src/build.js; } | xargs env
cat: build.env: No such file or directory
Error: make error Error: spawn make ENOENT
    at ChildProcess.<anonymous> (file:///Users/anil/WebstormProjects/agoric-samples/crabble-ui/node_modules/@agoric/smart-wallet/node_modules/@agoric/xsnap/src/build.js:40:16)
    at ChildProcess.emit (node:events:513:28)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
    at onErrorNT (node:internal/child_process:485:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
error Command failed with exit code 1.

When I do cd /Users/anil/WebstormProjects/agoric-samples/crabble-ui/node_modules/@agoric/ertp/node_modules/@agoric/xsnap && ls here's the list of files/directories I see:

  • CHANGELOG.md
  • README.md
  • node_modules
  • src
  • LICENSE
  • api.js
  • package.json

As you can see there's no build.env. When I copy the build.env from a local cloned version of the agoric-sdk and paste it to /Users/anil/WebstormProjects/agoric-samples/crabble-ui/node_modules/@agoric/ertp/node_modules/@agoric/xsnap and then do;

cd  /Users/anil/WebstormProjects/agoric-samples/crabble-ui/node_modules/@agoric/ertp/node_modules/@agoric/xsnap
yarn build:from-env

The yarn build:from-env succeeds.

Are you aware of any issues like this? @samsiegart

cc @dckc

To Reproduce

Steps to reproduce the behavior:

  1. Add one of below packages to the dependencies of your dapp frontend
  2. Do yarn install

Expected behavior

yarn install should not fail

Platform Environment

  • OS: Mac OS Monterey v12.6.2
  • Node 16 LTS
@anilhelvaci anilhelvaci added the bug Something isn't working label Aug 31, 2023
@dckc
Copy link
Member

dckc commented Aug 31, 2023

@turadg does your recent work cleaning up the agoric-sdk dependency structure prompt any thoughts on this?

@samsiegart
Copy link
Contributor

I'm seeing the same issue myself now, trying to add @agoric/rpc to https://github.com/samsiegart/simple-game

@turadg turadg mentioned this issue Sep 1, 2023
@turadg
Copy link
Member

turadg commented Sep 1, 2023

There are two problems.

One is that packages had dependencies declared on swingset-vat (and transitively xsnap) that weren't necessary. #8294 prunes as much could be done with just package.json changes.

The other is that xsnap fails to build. It should always build, even when it's imported unnecessarily. I see that its package.json in master has build.env in the files list but that's from 2 months ago and the version was last bumped 3 months ago. So I'll leave this issue open until 0.14.2 or later is published.

Incidentally, reporting this in the changelog is something that commit-based changelogs are not well suited for. We have identified a bug that will be fixed in the next release, but there's no code change to make to log it.

@samsiegart
Copy link
Contributor

So I'll leave this issue open until 0.14.2 or later is published

When can we do that @turadg? I need to get it building to deploy https://github.com/samsiegart/simple-game so that Keplr can be reviewed. Sounds like the way forward is deploy 0.14.2+, bump the version in ui-kit, redeploy ui-kit, then bump the version in the dapps.

@dckc
Copy link
Member

dckc commented Sep 1, 2023

There's always patch-package. :-/

@turadg
Copy link
Member

turadg commented Sep 1, 2023

A little cleaner than patch-package is using this resolution to get the latest xsnap (which builds):

  },
  "resolutions": {
    "**/@agoric/xsnap": "0.14.3-dev-9f085d3.0"
  }

ca530f8#diff-107c870fd7db7b3ad4045eae0b56a52d690254cd2a9d2e7ebb4e82d027ae4a9d adds a test ot make sure the build doesn't break again. That commit also fixed the breakage with ca530f8#diff-107c870fd7db7b3ad4045eae0b56a52d690254cd2a9d2e7ebb4e82d027ae4a9d , though it's not noted so won't be in the changelog. Another reason to adopt Changesets imo :-)

@dckc
Copy link
Member

dckc commented Sep 1, 2023

I can see lots of ways to get the relevant info regarding these few exceptions into changelogs short of repeating everything for all normal fixes/enhancements in changesets.

@michaelfig
Copy link
Member

For those using agoric-upgrade-11 packages, you can do:

  "resolutions": {
    "**/@agoric/xsnap": "agoric-upgrade-11"
  }

@dckc dckc added devex developer experience xsnap the XS execution tool labels Nov 23, 2023
@mergify mergify bot closed this as completed in #9262 Apr 23, 2024
@mergify mergify bot closed this as completed in 3f2b479 Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working devex developer experience xsnap the XS execution tool
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants