-
-
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
Various buildNpmPackage fixes #200470
Various buildNpmPackage fixes #200470
Conversation
Running into that new check, even though
I think the config hook runs before the fetcher. |
@lilyinstarlight What do you think of 4e730bbe4d567bbb65cc946fdbbadab0f4d99546, as opposed to having a separate |
I assume But I also still think it would probably be good to otherwise keep both How do you feel about that? Keeping the change in 4e730bb but also adjusting the diagnostic to suggest |
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.
Transcribing comments over from #200475.
integrity: Option<String>, | ||
} | ||
|
||
#[derive(Debug, Deserialize, PartialEq, Eq)] | ||
#[serde(untagged)] | ||
enum UrlOrString { |
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.
Nit: I personally like naming this UrlLike
to emphasize that it's still a URL, just maybe not a valid one.
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.
Not sure on this one. I'm talking about URLs like github:NixOS/nixpkgs
here, which technically are valid URLs, but... not.
Maybe yours is best, hm.
4e730bb
to
1612525
Compare
@lilyinstarlight Done in 1612525f97d2101963833ba5f1aa1ef7b01df64c. @tjni How do you feel about the commit progression here, with your changes applied throughout? It took... a fair bit amount of time to do the rebasing required for this, so let me know if anything seems weird. |
Looks great! Thank you for addressing my comments. |
My main concern is doing too much in 83d240907a69684436ca82df80675a3b0c81e260, specifically referring to the Am I overthinking this? 😅 |
I think you should do whatever makes you feel best about the change. If it feels unrelated, feel free to pull it out or leave it out. None of my comments ever need to be addressed, I like and can iterate on code all day, but I almost always prefer to commit something instead of nothing. |
Saw this mentioned on Discourse and thought I would try converting the FoundryVTT flake I maintain over to
The revised flake is available at the buildNpmPackage-PoC branch of my repo for reference. |
@reckenrode I can't look further into this right now, but as for the second point, can you please test if changing the lockfile is required when using this branch? |
I was was referencing the PR in my flake ( |
Yup, you're right. (I think.) I'll take a look when I can and see what's up, on both fronts. Thanks for reporting! |
@reckenrode Please test the latest commits, which fix the issue by working around what might be an npm bug. I've marked this PR as a draft until I can file an issue with npm about this and note it in the code. |
I rebased my etherpad WIP on top of the latest changes here and
Haven't debugged this yet since I'm fighting with other stuff. |
That's strange -- will look into it when I can. |
A `package-lock.json` file can contain multiple instances of the same dependency, which caused unnecessary downloads and duplicate index entries in the generated cache.
718616f
to
0c84200
Compare
6b32f82
to
155bc54
Compare
Previously, we stored the tarballs from the hosted Git providers directly in the cache. However, as we've seen with `fetchFromGitHub` etc, these files may change subtly. Given this, this commit repacks the dependencies before storing them in the cache.
155bc54
to
7e81e81
Compare
Switched to packing with |
@@ -96,6 +107,8 @@ npmConfigHook() { | |||
rm node_modules/.meow | |||
fi | |||
|
|||
patchShebangs node_modules |
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.
patchShebangs node_modules | |
patchShebangs node_modules/.bin |
Would that already be enough? Searching through everyfile in the blackhole could take a bit.
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.
It could be enough, but who knows what files packages add in their install scripts that have hardcoded shebangs...
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.
If patchShebangs would be free, we would just run it on every source file and patch everything we can. node_modules is notorious for being very big and with lots of files.
How about we just search for executable files and patch those?
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.
Maybe?
find node_modules -executable -exec patchShebangs {} \;
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.
We'll get this in without addressing this for now.
One last sanity check. @ofborg eval |
Time is something we don't have right now, so let's just land this. |
This was created before NixOS#200470, but wasn't tested after it was merged, leading to the hash being incorrect.
This was written before NixOS#200470, but wasn't tested after it was merged, leading to the hash being incorrect.
This was written before #200470, but wasn't tested after it was merged, leading to the hash being incorrect.
Description of changes
Things done
sandbox = true
set 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/
)nixos/doc/manual/md-to-db.sh
to update generated release notes