moonrepo / moon

A build system and monorepo management tool for the web ecosystem, written in Rust.
https://moonrepo.dev/moon
MIT License
2.91k stars 157 forks source link

[bug] 1.29.4 and 1.29.3 incompatibility #1710

Open CluEleSsUK opened 1 week ago

CluEleSsUK commented 1 week ago

Describe the bug

There appears to be an incompatibilty in the docker setup step of 1.29.4

In my package.json devDependencies I have ^1.29.3. Locally I'm running 1.29.2 Inside my dockerfile I curlpipebash the latest version (1.29.4 at present) when running RUN moon docker setup in my dockerfile, I get the following error:

   npm error Error: Cannot find module '@moonrepo/core-linux-x64-gnu/package.json'
  npm error Require stack:
  npm error - /home/runner/_work/myrepo/myproject/node_modules/@moonrepo/cli/postinstall.js
  npm error     at Module._resolveFilename (node:internal/modules/cjs/loader:1212:15)
  npm error     at Function.resolve (node:internal/modules/helpers:133:19)
  npm error     at Object.<anonymous> (/home/runner/_work/myrepo/myproject/node_modules/@moonrepo/cli/postinstall.js:41:38)
  npm error     at Module._compile (node:internal/modules/cjs/loader:1460:14)
  npm error     at Module._extensions..js (node:internal/modules/cjs/loader:1544:10)
  npm error     at Module.load (node:internal/modules/cjs/loader:1275:32)
  npm error     at Module._load (node:internal/modules/cjs/loader:1091:12)
  npm error     at wrapModuleLoad (node:internal/modules/cjs/loader:212:19)
  npm error     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:158:5)
  npm error     at node:internal/main/run_main_module:30:49 ***
  npm error   code: 'MODULE_NOT_FOUND',
  npm error   requireStack: [
  npm error     '/home/runner/_work/myrepo/myproject/node_modules/@moonrepo/cli/postinstall.js'
  npm error   ]

Expected behavior

It could be that the docker packages move around, but I wouldn't expect a patch upgrade to break compat

Screenshots

Environment

  System:
    OS: macOS 14.5
    CPU: (10) arm64 Apple M1 Max
    Memory: 996.50 MB / 32.00 GB
    Shell: 3.7.1 - /usr/local/bin/fish
  Binaries:
    Node: 22.3.0 - ~/.nvm/versions/node/v22.3.0/bin/node
    Yarn: 1.22.22 - ~/.nvm/versions/node/v22.3.0/bin/yarn

Additional context

CluEleSsUK commented 6 days ago

Also since updating everything to 1.29.4 I’ve been getting occasional core dumps from tokio which seems suspicious:

RUN moon docker scaffold some-module
client-js:integration | 1.175 ▪▪▪▪ installing proto 0.42.0
client-js:integration | 8.001 ▪▪▪▪ installing node 22.3.0
client-js:integration | 1171.8 
client-js:integration | 1171.8 thread 'tokio-runtime-worker' has overflowed its stack
client-js:integration | 1171.8 fatal runtime error: stack overflow
client-js:integration | 1172.7 Aborted (core dumped)

update on this one: seems I had a circular dependsOn in my moon files :| though weirdly moon ci works fine for this. Is it worth raising a separate issue for docker scaffold allowing to start with circular dependencies?

milesj commented 6 days ago

@CluEleSsUK Is the cycle the problem for the original post? If so, you can edit the post/title to mention the cycle instead and I can look into it.

CluEleSsUK commented 6 days ago

No, cycle is just for the tokio stack overflow

milesj commented 6 days ago

I don't see anything in the diff that would cause this: https://github.com/moonrepo/moon/compare/7d3702984e9774e2dc0a9d42d49977fd165585e1..ac8fa57f2b35b746e16df6d756fc44e74bbd64fe

Did npm install run and succeed? The error seems like @moonrepo/cli wasn't installed into node modules correctly.