Convert elm-review from node2nix to buildNpmPackage#351767
Convert elm-review from node2nix to buildNpmPackage#351767zupo wants to merge 2 commits intoNixOS:masterfrom
Conversation
|
@hsjobeki: here's the diff we worked on today. As I was preparing the commit I noticed some elm packages have already been ported to buildNpmPackage, so I have re-written our stuff to look like the existing packages. Funnily enough, now I get a different error: Which is strange, as I don't see what the problem is with |
| "create-elm-app", | ||
| "elm-optimize-level-2", | ||
| "elm-pages", | ||
| "elm-review", |
There was a problem hiding this comment.
Use ./pkgs/development/node-packages/remove-attr.py elm-review to also remove it from node-packages.nix.
And you should add an entry to pkgs/development/node-packages/aliases.nix.
There was a problem hiding this comment.
I ran this, and it doesn't seem to do anything. No output, no error, no changes.
There was a problem hiding this comment.
I checked pkgs/development/node-packages/aliases.nix and I don't see other elm packages listed there (besides elm-test)? Why does elm-review need to be listed and others not? Should I add others as well?
There was a problem hiding this comment.
We want nodePackages.elm-review to remain an alias after we remove it.
There was a problem hiding this comment.
I ran this, and it doesn't seem to do anything.
Maybe the entry still needs to exist in node-packages.json for the script to work? I'm sure the Python script isn't too hard to read.
| dontNpmBuild = true; | ||
|
|
||
| meta = { | ||
| changelog = "https://github.com/jfmengels/node-elm-review/blob/v${src.rev}/CHANGELOG.md"; |
There was a problem hiding this comment.
| changelog = "https://github.com/jfmengels/node-elm-review/blob/v${src.rev}/CHANGELOG.md"; | |
| changelog = "https://github.com/jfmengels/node-elm-review/blob/${src.rev}/CHANGELOG.md"; |
There was a problem hiding this comment.
This packages seems to use the v prefix: https://github.com/jfmengels/node-elm-review/releases
https://github.com/jfmengels/node-elm-review/blob/2.12.0/CHANGELOG.md returns 404.
There was a problem hiding this comment.
that is correct. ignore this recommendation
There was a problem hiding this comment.
src.rev already contains the leading v
turboMaCk
left a comment
There was a problem hiding this comment.
Please squash the commits into a single one with usual commit message. After that I think we can merge this change.
Thanks a lot for revisiting it.
fd650e2 to
af4690b
Compare
|
Suggested fixes applied. @hsjobeki the error is now the same as during NixCon hackday: |
I'd love it for this to be the case, but the package doesn't build (yet!). I'll squash when it does. Also, I'm happy to apply the things I learn in this PR to other elm packages too. |
I'll try to debug this tomorrow. |
The yocto-queue entry in upstream's package-lock.json is missing values for |
Is there a workaround if they don't do it? |
Vendor the lock file. |
|
@zupo I validated the ca-cache. It seems not all packages are installed. Maybe due to missing integrity hashes as mentioned. (Didn't dive into the rust code there.) Workaround without vendoring in my mind: Create a fixed output derivation for node_modules? You could try to install dependencies with npm natively and pass the generated node_modules to your package. But this might be potentially unstable? But could also be fine. There are cases where the registry randomly gives u other reponses, in which case both methods should fail. Both solutions have pro and cons so it might be up for the node ecosystem maintainers to decide what they prefer. |
|
The first step is opening an upstream issue or PR for regenerating the lock file. |
|
I would first check if it's not fixed already in HEAD upstream. Using commit like this or later jfmengels/node-elm-review@de899d2 |
|
Work continues in #382294. |
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.