| 22 Nov 2023 |
Wanja Hentze | right, and npmlock2nix et al. compute that hash instead | 16:46:15 |
Lily Foster | i'm not sure i follow but also idk what npmlock2nix is, so i'll take your word for it | 16:47:12 |
Wanja Hentze | it parses package-lock.json in pure nix code and can thus create its own FODs | 16:48:04 |
Wanja Hentze | no need to maintain a separate hash out of band | 16:48:13 |
Lily Foster | oh, yeah i was gonna have that too for the nixpkgs stuff soon. someone called it terrible though so i haven't, uh, come back and pushed it yet | 16:49:13 |
Wanja Hentze | napalm, floco and the new buildNpmModule stuff do it as well | 16:49:32 |
Wanja Hentze | as does (I believe) dream2niz | 16:49:51 |
Wanja Hentze | * as does (I believe) dream2nix | 16:49:58 |
Lily Foster | it was part of a bigger restructure of lockfile parsing and fixup, which will also allow dealing with busted lockfiles in nixpkgs without just having to generate your own and vendor it | 16:50:04 |
Wanja Hentze | I see, nice ☺️ | 16:50:36 |
Wanja Hentze | if you could use any help with that let me know | 16:50:54 |
Lily Foster | i mean if you know rust and want to help, i wish i had someone to collab with, because it's hard when it's just me and most people like shitting on node stuff anyway and calling reproducibility "terrible" | 16:51:31 |
Wanja Hentze | I do know Rust and I halfway know the lockfile format from working on npmlock2nix | 16:52:51 |
Wanja Hentze | that was all v1 though | 16:53:00 |
Lily Foster | yeah we support all v1-3 lockfiles rn (which v1 is shit though and often has incomplete dep graphs store in their lockfiles....) | 16:53:38 |
Wanja Hentze | yes, v1 is shit | 16:53:59 |
Wanja Hentze | npmlock2nix only barely supports v2 and does not support v3 at all | 16:54:25 |
Lily Foster | idk i'd rather work on pnpm stuff at this point, but that's because the more i look into it, the more actually sane it looks (yaml lockfiles aside) | 16:54:45 |
Wanja Hentze | I think it's dead or dying now because of this | 16:54:45 |
Wanja Hentze | well, my usecase is packaging already existing stuff. and that stuff usually has package.json and package-lock.json | 16:55:24 |
Wanja Hentze | if yarn or pnpm can work with those, then sure why not | 16:55:57 |
hexa | what prevents projects from moving from a yarn v1 to a v2 lockfile? | 19:51:18 |
hexa | at the moment I feel like yarn projects are at risk in nixpkgs | 19:52:01 |
@keiichi:matrix.org | I packaged a custom package with buildNpmPackage and the package.json has a main entry.
➜ result/bin/jkops --help
Error: Cannot find module '/nix/store/9x13vrsbm8rb78x8mhrcb72ysza14llz-jkops-1.0.0/lib/node_modules/jkops/node_modules/@aws-sdk/util-utf8-browser/dist-cjs/index.js'. Please verify that the package.json has a valid "main" entry
at tryPackage (node:internal/modules/cjs/loader:438:19)
at Function.Module._findPath (node:internal/modules/cjs/loader:680:18)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1063:27)
at Function.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:119:18)
at Object.<anonymous> (/nix/store/9x13vrsbm8rb78x8mhrcb72ysza14llz-jkops-1.0.0/lib/node_modules/jkops/node_modules/@aws-crypto/util/src/convertToBuffer.ts:5:1)
at Module._compile (node:internal/modules/cjs/loader:1256:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
at Module.load (node:internal/modules/cjs/loader:1119:32)
the first path /nix/store/9x13vrsbm8rb78x8mhrcb72ysza14llz-jkops-1.0.0/lib/node_modules/jkops/node_modules/@aws-sdk/util-utf8-browser/dist-cjs/index.js does not exist in nix store but /nix/store/9x13vrsbm8rb78x8mhrcb72ysza14llz-jkops-1.0.0/lib/node_modules/jkops/node_modules/@aws-sdk/util-utf8-browser/package.json does . It contains a line "main": "./dist-cjs/index.js"which is the non-existing file in the store. Is that a nix side effect or is this normal in the npm world ? (still discovering)
| 22:34:22 |
Lily Foster | In reply to @keiichi:matrix.org
I packaged a custom package with buildNpmPackage and the package.json has a main entry.
➜ result/bin/jkops --help
Error: Cannot find module '/nix/store/9x13vrsbm8rb78x8mhrcb72ysza14llz-jkops-1.0.0/lib/node_modules/jkops/node_modules/@aws-sdk/util-utf8-browser/dist-cjs/index.js'. Please verify that the package.json has a valid "main" entry
at tryPackage (node:internal/modules/cjs/loader:438:19)
at Function.Module._findPath (node:internal/modules/cjs/loader:680:18)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1063:27)
at Function.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:119:18)
at Object.<anonymous> (/nix/store/9x13vrsbm8rb78x8mhrcb72ysza14llz-jkops-1.0.0/lib/node_modules/jkops/node_modules/@aws-crypto/util/src/convertToBuffer.ts:5:1)
at Module._compile (node:internal/modules/cjs/loader:1256:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
at Module.load (node:internal/modules/cjs/loader:1119:32)
the first path /nix/store/9x13vrsbm8rb78x8mhrcb72ysza14llz-jkops-1.0.0/lib/node_modules/jkops/node_modules/@aws-sdk/util-utf8-browser/dist-cjs/index.js does not exist in nix store but /nix/store/9x13vrsbm8rb78x8mhrcb72ysza14llz-jkops-1.0.0/lib/node_modules/jkops/node_modules/@aws-sdk/util-utf8-browser/package.json does . It contains a line "main": "./dist-cjs/index.js"which is the non-existing file in the store. Is that a nix side effect or is this normal in the npm world ? (still discovering)
can you share derivation? | 22:35:24 |
Lily Foster | something's probably not getting built and i would like to find out if it's because of our npm hell or npm's own hell | 22:35:45 |