Conversation
0358bb2 to
1df6123
Compare
|
NOTE: I'll try running it again! EDIT: Same result. Result of 2 packages failed to build:
12 packages built:
|
authored mostly by @domenkozar
1df6123 to
47c0dbd
Compare
|
I pushed a fix for elm-pages. |
|
Result of 1 package failed to build:
13 packages built:
|
|
Actually, ╰─λ ./results/elmPackages.elm-pages/bin/elm-pages --help
/nix/store/11kh8s407rr06vqb47adra26wmgcgjlh-elm-pages-3.0.16/lib/node_modules/elm-pages/node_modules/rollup/dist/native.js:59
throw new Error(
^
Error: Cannot find module @rollup/rollup-linux-x64-gnu. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.
at requireWithFriendlyError (/nix/store/11kh8s407rr06vqb47adra26wmgcgjlh-elm-pages-3.0.16/lib/node_modules/elm-pages/node_modules/rollup/dist/native.js:59:9)
at Object.<anonymous> (/nix/store/11kh8s407rr06vqb47adra26wmgcgjlh-elm-pages-3.0.16/lib/node_modules/elm-pages/node_modules/rollup/dist/native.js:68:76)
... 3 lines matching cause stack trace ...
at Module._load (node:internal/modules/cjs/loader:1104:12)
at cjsLoader (node:internal/modules/esm/translators:346:17)
at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:286:7)
at ModuleJob.run (node:internal/modules/esm/module_job:234:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:473:24) {
[cause]: Error: Cannot find module '@rollup/rollup-linux-x64-gnu'
Require stack:
- /nix/store/11kh8s407rr06vqb47adra26wmgcgjlh-elm-pages-3.0.16/lib/node_modules/elm-pages/node_modules/rollup/dist/native.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1225:15)
at Module._load (node:internal/modules/cjs/loader:1051:27)
at Module.require (node:internal/modules/cjs/loader:1311:19)
at require (node:internal/modules/helpers:179:18)
at requireWithFriendlyError (/nix/store/11kh8s407rr06vqb47adra26wmgcgjlh-elm-pages-3.0.16/lib/node_modules/elm-pages/node_modules/rollup/dist/native.js:41:10)
at Object.<anonymous> (/nix/store/11kh8s407rr06vqb47adra26wmgcgjlh-elm-pages-3.0.16/lib/node_modules/elm-pages/node_modules/rollup/dist/native.js:68:76)
at Module._compile (node:internal/modules/cjs/loader:1469:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
at Module.load (node:internal/modules/cjs/loader:1288:32)
at Module._load (node:internal/modules/cjs/loader:1104:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/nix/store/11kh8s407rr06vqb47adra26wmgcgjlh-elm-pages-3.0.16/lib/node_modules/elm-pages/node_modules/rollup/dist/native.js'
]
}
} |
|
Seems to be #294183 |
| nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ makeWrapper old.nodejs.pkgs.node-gyp-build ]; | ||
|
|
||
| preRebuild = '' | ||
| sed -i 's/"esbuild": "0\.19\.12"/"esbuild": "0.21.5"/' package.json |
There was a problem hiding this comment.
This should use substituteInPlace with --replace-fail
| -c node-composition.nix \ | ||
| --no-copy-node-env -e ../../../../node-packages/node-env.nix | ||
| # well, elm-pages requires two different version of esbuild so we twist it's wrist to only use one | ||
| sed -i 's/sources."esbuild-0.19.12"/sources."esbuild-0.21.5"/' node-packages.nix |
There was a problem hiding this comment.
Not sure how to do this, since this is a shell script and it doesn't have substituteInPlace.
| inherit (pkgs) stdenv lib python2 runCommand writeTextFile writeShellScript; | ||
| inherit pkgs nodejs; | ||
| libtool = if pkgs.stdenv.hostPlatform.isDarwin then pkgs.cctools or pkgs.darwin.cctools else null; | ||
| libtool = if pkgs.stdenv.isDarwin then pkgs.cctools or pkgs.darwin.cctools else null; |
There was a problem hiding this comment.
Why was this changed back?
There was a problem hiding this comment.
Maybe because we used my mac to run the generation script. Could probably be reverted?
SuperSandro2000
left a comment
There was a problem hiding this comment.
elm-packages should also eventually stop using node2nix but that's something for another PR
| ESBUILD_BINARY_PATH = lib.getExe ( | ||
| pkgs.esbuild.override { | ||
| buildGoModule = args: pkgs.buildGoModule (args // rec { | ||
| version = "0.20.2"; | ||
| src = pkgs.fetchFromGitHub { | ||
| owner = "evanw"; | ||
| repo = "esbuild"; | ||
| rev = "v${version}"; | ||
| hash = "sha256-h/Vqwax4B4nehRP9TaYbdixAZdb1hx373dNxNHvDrtY="; | ||
| }; | ||
| vendorHash = "sha256-+BfxCyg0KkDQpHt/wycy/8CTG6YBA/VJvJFhhzUnSiQ="; | ||
| }); | ||
| } | ||
| ); |
There was a problem hiding this comment.
I wonder - did you try to just use esbuild that is already available in nixpkgs? I think this might not be that version sensitive.
There was a problem hiding this comment.
It seemed very version sensitive when we tried. Had to provide the exact version.
There was a problem hiding this comment.
uh that will be a bit painful to maintain. Maybe it would make sense to port these away from node2nix to buildNpmPackage right away to prevent potential regression with future bulk updates.
There was a problem hiding this comment.
Agree on it being painful. A slight condolence is the fact that Elm packages are usually quite slow to release new updates.
I tried porting to buildNpmPackage but got lost. I'd need some hand-holding to get it done.
There was a problem hiding this comment.
sure not a blocker. Thanks for giving it a try.
There was a problem hiding this comment.
Tried again today during NixCon Hack Day: #351767
| ESBUILD_BINARY_PATH = lib.getExe ( | ||
| pkgs.esbuild.override { | ||
| buildGoModule = args: pkgs.buildGoModule (args // rec { | ||
| version = "0.21.5"; |
There was a problem hiding this comment.
so I see we even need 2 different version of esbuild. I guess there was an issue with version of ES build when you tried to share the same one?
|
Note that the binary still fails to run because we need to also patch up |
|
ah right. I also ran into this issue in my quick spike - that's where I gave up. Forgot to test it in this PR. Anyway lets try fix these issues one by one now when this is merged. I also think we can start decoupling these problematic packages away from node2nix to buildNpmPackage. |
|
I tried using buildNpmPackage, but build from source is quite complicated as it needs to build parts using elm. Going to try to patch @rollup/wasm-node to be used in place of rollup. |
Current elm-land in master is actually broken. It does build, but it doesn't run. This commit rewrites it from node2nix to buildNpmPackage and adds a test to confirm it runs. Previus work: * NixOS#344866 * NixOS#304198 * NixOS#267725 Refs Thaigersprint/thaigersprint-2025#1
|
I have gotten a bit further with |
Note that elm-verify-examples is still broken.
Fixes #320127 #267454 #304198