-
Notifications
You must be signed in to change notification settings - Fork 0
Add nitro-protocol dependency to packages/wasm-utils manifest during bootstrap #29
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
Conversation
What matters is the dependencies specified in the generated npm package, not this one. I had thought that specifying them here would result in them being in the manifest of the generated package. But that is not the case. Therefore it is unecessary to specify here.
Should we be bothering to keep |
This change is not about keeping
Yes it would be easy to do that. Reasons not to do that, and not to avoid this work:
So it seems preferable (to me) to fix the problem in this manner? |
This is is a higher level question that is not specific to this PR, but I've observed a bunch of extra work being done due to the circular dependency between
If we're spending a lot of cycles dealing with This is not an argument that we should remove |
I understand where you're coming from. I think the amount of work is actually pretty low at the moment, in fact. That said, I don't feel strongly about keeping How about we merge this PR, and then revisit that question? |
I'd lazily revisit that question the next time |
This should have the same effects as statechannels/native-utils#29 (when that eventually gets reviewed, merged, and published to a new version of wasm-utils)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes make enough sense to me, but the overall build and linking process here is pretty convoluted.
Attempts to build the generated package locally have failed (Thanks George!)
See #28 .
The generated npm package depends on
nitro-protocol
(you can see this by inspecting the gitignored file/packages/wasm-utils/wasm_utils.d.ts
). That dependency is missing from the manifest of the generated npm package, which causes an error to be thrown in consuming projects.Changes [Optional]
/native-utils/wasm-utils/package.json
. Ideally this would be sufficient to make it appear innative-utils/packages/wasm-utils/package.json
. I think in the end it is neither necessary no sufficient, so I undid this change.prepare
step in/native-utils/wasm-utils/package.json
, which has the desired effect of adding the missing dependency.wasm-pack
How Has This Been Tested?
I have performed a manual test that implies this fix works.
I have a branch in our main monorepo where
server-wallet
depends on a version ofnitro-protocol
pulled fromnpm
, whereas other packages such aswallet-core
depend on the local version. This leads to the npm version ofnitro-protocol
being installed under/packages/server-wallet/node_modules
(i.e. it is not hoisted byyarn
). On the other hand,wasm-utils
is hoisted and therefore resides at/node_modules
. In this scenario,wasm-utils
cannot findnitro-protocol
due to the missing dependency. Iyarn linked
that branch (locally) to this one, and was able toprepare
theserver-wallet
even when I had deleted the localnitro-protocol
build.nitro-protocol
was installed under/node_modules/@statechannels/wasm-utils/node_modules
.With an unlinked
wasm-utils
, this was not possible and I sawNote that doing
yarn prepare
from the top level of the monorepo can lead to a race condition where this problem wouldn't always show up. If the localnitro-protocol
was built before theserver-wallet
(it is not a dependency in this scenario), thenwasm-utils
would find that and fail to complain. Otherwise, we see the error https://app.circleci.com/pipelines/github/statechannels/statechannels/13764/workflows/a5c2d7a7-21ca-4773-a422-03cde87bf380/jobs/66998 .Checklist:
Code quality
Project management