-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
yarnInstallHook: init #328544
yarnInstallHook: init #328544
Conversation
Result of 5 packages built:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks for working on this!
6f0df32
to
9340305
Compare
I have no spoons for this, sorry. |
9340305
to
3e2d208
Compare
3e5e44c
to
0f8dff5
Compare
Result of 5 packages built:
|
Only now I noticed the code duplication (sorry for my lack of concentration). I wish we could avoid it, as I doubt we'd ever need to modify yarn packages' manual pages and binaries installation (based on Perhaps we can make this Another option would be to remove the diff --git i/pkgs/build-support/node/build-npm-package/default.nix w/pkgs/build-support/node/build-npm-package/default.nix
index 4bcbf3f14f2f..ca5df6f0f372 100644
--- i/pkgs/build-support/node/build-npm-package/default.nix
+++ w/pkgs/build-support/node/build-npm-package/default.nix
@@ -55,6 +55,8 @@
, npmBuildHook ? null
# Custom npmInstallHook
, npmInstallHook ? null
+ # Custom npmPruneHook
+, npmPruneHook ? null
, ...
} @ args:
@@ -74,6 +76,7 @@ stdenv.mkDerivation (args // {
(if npmConfigHook != null then npmConfigHook else npmHooks.npmConfigHook)
(if npmBuildHook != null then npmBuildHook else npmHooks.npmBuildHook)
(if npmInstallHook != null then npmInstallHook else npmHooks.npmInstallHook)
+ (if npmPruneHook != null then npmPruneHook else npmHooks.npmPruneHook)
nodejs.python
]
++ lib.optionals stdenv.isDarwin [ cctools ]; And add What do you think? |
One thing I still need to figure out is if we maybe need to use If we are to share code between
You know how sometimes it feels more like you are discovering a solution rather than creating it? Maybe we can create a "shared" set of these functions ( By now each hook would be tiny, and very specific, which is good I think. But there will be too many hooks for it to be reasonable for normal usage, I see a |
That sounds more correct, and it will also justify separating the hooks.
After speculating the idea suggested by me and implemented in #335504 , I was thinking of another option: Using Nix to share the code! Here's a draft: |
e04554f
to
b7e195a
Compare
Fixed two things:
|
Result of 5 packages built:
|
b7e195a
to
a20d9da
Compare
Result of 5 packages built:
|
There's a small merge conflict now BTW. |
I asked for help on Discourse. |
1dd7836
to
c75d7cd
Compare
Result of 6 packages built:
|
c75d7cd
to
feb1b53
Compare
@ofborg eval |
@NixOS/nixpkgs-vet something is wrong here I think. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would like to merge when CI is green - waiting for @NixOS/nixpkgs-vet 's response regarding the failure.
Could you try rebasing on master right now and seeing if the error persists? The tree had some evaluation failures checked in earlier today. |
So I understand there is no equivalent to |
Since it's "inside" GitHub actions instead of "outside" GitHub Actions, no, it gets fed a revision and it tests that revision only. It's not an active service or a bot in the same way that @ofborg is. It's just a tool that runs and reports. |
I validated that this PR, when rebased on master, passes |
It might be possible by clicking the "Re-run jobs" button in the workflow page. Can only be done by committers, and I'm only 90% convinced that it actually picks up fixed base branches. Please give it a try when you see it next time @philiptaron (too late for this PR though because the merge branch is already gone) :) |
Description of changes
When attempt to use
npmInstallHook
on a yarn project usingfetchYarnDeps
, npm frequently tries to connect to the internet during theprune
step.Turns out replacing
npm prune
withyarn install --production=true ...
resolves this issue.ping @doronbehar
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-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.