| 31 Jul 2023 |
Lily Foster | In reply to @robert:funklause.de
Actually glob does exist in packages/pyright/package-lock.json so I'm not sure why I get
[webpack-cli] Failed to load '/build/source/packages/pyright/webpack.config.js' config
[webpack-cli] Error: Cannot find module 'glob'
Require stack:
- /build/source/build/lib/webpack.js
- /build/source/packages/pyright/webpack.config.js
- /build/source/packages/pyright/node_modules/webpack-cli/lib/webpack-cli.js
- /build/source/packages/pyright/node_modules/webpack-cli/lib/bootstrap.js
- /build/source/packages/pyright/node_modules/webpack-cli/bin/cli.js
- /build/source/packages/pyright/node_modules/webpack/bin/webpack.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
at Module._load (node:internal/modules/cjs/loader:922:27)
at Module.require (node:internal/modules/cjs/loader:1143:19)
at require (node:internal/modules/cjs/helpers:110:18)
at Object.<anonymous> (/build/source/build/lib/webpack.js:3:14)
at Module._compile (node:internal/modules/cjs/loader:1256:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
at Module.load (node:internal/modules/cjs/loader:1119:32)
at Module._load (node:internal/modules/cjs/loader:960:12)
at Module.require (node:internal/modules/cjs/loader:1143:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/build/source/build/lib/webpack.js',
'/build/source/packages/pyright/webpack.config.js',
'/build/source/packages/pyright/node_modules/webpack-cli/lib/webpack-cli.js',
'/build/source/packages/pyright/node_modules/webpack-cli/lib/bootstrap.js',
'/build/source/packages/pyright/node_modules/webpack-cli/bin/cli.js',
'/build/source/packages/pyright/node_modules/webpack/bin/webpack.js'
]
}
Hmm it's trying to require it without installing it first. When is it trying to call webpack? Do you have a derivation I can play with? | 21:06:12 |
dotlambda | In reply to @lily:lily.flowers Hmm it's trying to require it without installing it first. When is it trying to call webpack? Do you have a derivation I can play with? https://github.com/dotlambda/nixpkgs/tree/pyright-buildNpmPackage | 21:08:42 |
dotlambda | It happens after Executing npmBuildHook so it should be installed | 21:09:48 |
Lily Foster | Yeah it's correctly trying in build phase | 21:10:08 |
Lily Foster | Hmmm | 21:10:11 |
dotlambda | I think I got it | 21:11:15 |
Lily Foster | Oh I bet doing the cd in the postPatch is too late | 21:13:43 |
dotlambda | The problem is this line: https://github.com/microsoft/pyright/blob/1.1.319/packages/pyright/webpack.config.js#L8 | 21:14:00 |
Lily Foster | Oh. Or that | 21:14:11 |
dotlambda | In reply to @lily:lily.flowers Oh I bet doing the cd in the postPatch is too late also tried sourceRoot | 21:14:14 |
dotlambda | Now I get Error: Cannot find module 'jsonc-parser' and would need /package-lock.json though I can patch out the dependency on jsonc-parser. Doing so leads to lots of missing modules required from packages/pyright-internal :( | 21:21:18 |
gdamjan | In reply to @hexa:lossy.network
ERROR:CLI Error: Could not find package.json up from /nix/store/qvpjwskw6j9n4g8749snwj5b6nk9xsb1-matrix-appservice-irc-1.0.1/bin/matrix-appservice-irc
why didn't I see this though?! | 21:22:12 |
hexa | i havent got the feintest idea | 21:23:13 |
Lily Foster | In reply to @robert:funklause.de Now I get Error: Cannot find module 'jsonc-parser' and would need /package-lock.json though I can patch out the dependency on jsonc-parser. Doing so leads to lots of missing modules required from packages/pyright-internal :( Yeah I figured if they were using lerna you'd run into issues with intra-repo dependencies. Which lerna does custom handling for :/ | 21:24:32 |
Lily Foster | And splits them across package-lock.json files because they hate nice things | 21:25:19 |
dotlambda | I pushed all my changes, feel free to play around with it. I'll stop investing time in pyright for now | 21:26:06 |
Lily Foster | In reply to @robert:funklause.de I pushed all my changes, feel free to play around with it. I'll stop investing time in pyright for now I may. The problem is lerna is gonna need work on our side to be actually usable instead of being able to hack around it | 21:27:29 |
Lily Foster | And I was going to say you could maybe get away with packaging the tarball for pyright in the npm registry, but it looks like that doesn't contain a lockfile | 21:27:56 |
dotlambda | In reply to @lily:lily.flowers I may. The problem is lerna is gonna need work on our side to be actually usable instead of being able to hack around it Then I guess there are more important things to work on | 21:28:01 |
Lily Foster | * And I was going to say you could maybe get away with packaging the tarball for pyright from the npm registry, but it looks like that doesn't contain a lockfile | 21:28:03 |
Lily Foster | In reply to @robert:funklause.de Then I guess there are more important things to work on If you want to work on that, feel free to, but it'll be a while before we get there. We really should come up with at least some workarounds though for packaging lerna apps since they keep popping up (even though npm has native monorepo support with workspaces now which we do support since it didn't actually take that much extra effort) | 21:29:30 |
Lily Foster | (I'm not even sure what's the best way to handle lerna tbh. I've never used it and it's been rather annoying when toying with trying to build lerna repos with npm) | 21:30:58 |
Lily Foster | * (I'm not even sure what's the best way to handle lerna tbh. I've never used it and it's been rather annoying when toying with trying to build lerna repos with npm alone) | 21:31:07 |
Lily Foster | (if you really want though, you could use the npm registry tarball as src and then copy in a vendored lockfile in postPatch. But I really don't want to vendor any more lockfiles than we have to in nixpkgs.....) | 21:31:47 |
Lily Foster | (especially with how big npm ones get) | 21:32:04 |
gdamjan | In reply to @gdamjan:spodeli.org why didn't I see this though?! I did run the tests too 😱 | 21:54:04 |
| 1 Aug 2023 |
gdamjan | how exactly did you get this? just running the CLI doesn't error out for me | 07:59:03 |
hexa | so did I | 10:54:28 |
hexa | ofborg also ran them and they were green before merge | 10:54:40 |
gdamjan | what's the game plan now? add the package.json file back, and perhaps add strictDeps=true? | 11:11:09 |