bitwarden-cli: build from source#218923
Conversation
pkgs/build-support/node/build-npm-package/hooks/npm-install-hook.sh
Outdated
Show resolved
Hide resolved
SuperSandro2000
left a comment
There was a problem hiding this comment.
good idea to make updates easy but can't help you with npm workspaces :(
60e4541 to
ba22689
Compare
|
@winterqt I added a pretty rough way of handling workspace in |
|
One problem: This increases the output size from 85 MiB to 211 MiB. Running |
|
I inspected the node_module directory of inside bitwarden/cli and the biggest directory, angular, was not there before. I think the cli is not using that at all and out vendoring just picks up everything in the repo, not just the dependencies of the workspace. Maybe you also need to adjust the vendoring part? Not sure if that happens in https://github.com/dotlambda/nixpkgs/blob/bitwarden-cli-source/pkgs/build-support/node/build-npm-package/hooks/npm-config-hook.sh |
There was a problem hiding this comment.
Overall I think adding an npmWorkspace arg can be workable for now to deal with workspaces. Please add it to the documentation too, if you can
I've also noticed npm sometimes tries to reach out to the registry even when the entire lockfile is cached when workspaces are involved, so if doing it like this avoids that, then great! I was dreading eventually having to look into that
pkgs/build-support/node/build-npm-package/hooks/npm-install-hook.sh
Outdated
Show resolved
Hide resolved
|
#233804 has been merged adding |
ba22689 to
8d2ea61
Compare
Running |
8d2ea61 to
f7babb9
Compare
Yeah the prune step should be handled by install hook now anyway. The fact that it leaves root-level project deps in that aren't necessary definitely seems like an npm bug, but I'm not sure how to coerce it to Do The Right Thing and also not quite sure in the npm sources where the bug is I'll assume the closure increase is okay enough for now, but I'll try to either fix the npm bug or come up with a workaround for the install hook to successfully prune workspace deps (now whether I'll end up needing to temporarily rename the root-level packages.json or what, we'll see) |
lilyinstarlight
left a comment
There was a problem hiding this comment.
Quick nit to fix darwin build, then this PR looks good to me
Thank you so much for this work and the work on npm workspaces in our tooling!
f7babb9 to
2995a89
Compare
lilyinstarlight
left a comment
There was a problem hiding this comment.
Looks good to me now, thank you so much!
I'll open a new issue to separately investigate why npm is buggy and not removing top-level deps when pruning (there is an upstream bug about it, but we should be able to work around it, since the npm folks generally aren't interested in fixing these sorts of bugs...)
|
Should we add an alias for |
|
Yes and remove it from the nodePackage generation. There are some prior example of aliases in that same directory. |
That already happened in this PR. It was just left in |
Description of changes
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)