!NhAsaYbbgmzHtXTPQJ:funklause.de

Nix NodeJS

211 Members
60 Servers

Load older messages


SenderMessageTime
10 Jul 2023
@janne.hess:helsinki-systems.de@janne.hess:helsinki-systems.de Since people actually commit the version for me, I don't actually use yarn set version. I just noticed that since I need it at runtime so it has to be copied to $out as well 10:06:58
@janne.hess:helsinki-systems.de@janne.hess:helsinki-systems.deSo the fact that .yarn has to be copied affects me between build and run, not between the FOD and the build10:07:26
@janne.hess:helsinki-systems.de@janne.hess:helsinki-systems.de(Also kind of related, turborepo and next.js is possibly the worst garbage I have seen in a long time)10:07:54
13 Jul 2023
@aktaboot:tchncs.deaktaboot changed their profile picture.06:56:51
14 Jul 2023
@janne.hess:helsinki-systems.de@janne.hess:helsinki-systems.deUmm, is this intended? https://github.com/NixOS/nixpkgs/blob/release-23.05/pkgs/build-support/node/build-npm-package/hooks/default.nix#L915:00:20
@janne.hess:helsinki-systems.de@janne.hess:helsinki-systems.de This causes (buildNpmPackage.override { nodejs = nodejs_14; }) to fail horribly 15:00:37
@lily:lily.flowersLily FosterYes it's intended. Can you share build log?15:00:51
@lily:lily.flowersLily FosterOh, 1415:00:59
@lily:lily.flowersLily FosterUhhh one sec while I check15:01:02
@lily:lily.flowersLily FosterThat15:01:03
@janne.hess:helsinki-systems.de@janne.hess:helsinki-systems.de Workaround that is even worse: (buildNpmPackage.override { nodejs = nodejs_14; npmHooks = npmHooks.override { buildPackages = buildPackages.extend (self: super: { nodejs = super.nodejs_14; }); }; }) 15:01:07
@lily:lily.flowersLily FosterOh I see what you're saying is unintended15:01:23
@janne.hess:helsinki-systems.de@janne.hess:helsinki-systems.de
In reply to @lily:lily.flowers
Oh I see what you're saying is unintended
Yeah sorry that was super unclear
15:01:37
@lily:lily.flowersLily FosterWe should probably just fish out the correct one from spliced attrs15:01:49
@lily:lily.flowersLily FosterI guess15:01:52
@janne.hess:helsinki-systems.de@janne.hess:helsinki-systems.de or some extra arg like nodeVersion that gets fed into getAttrByPath pkgs? 15:02:12
@janne.hess:helsinki-systems.de@janne.hess:helsinki-systems.de * or some extra arg like nodePackage that gets fed into getAttrByPath pkgs? 15:02:35
@lily:lily.flowersLily FosterI'd rather keep the ability to specify a whole nodejs derivation and also since you linked 23.05, we want something backwards compatible so it is eligible for backport15:02:39
@lily:lily.flowersLily FosterUgh this sucks, though. Maybe we can have the nodejs derivation itself expose the node-gyp location15:04:24
@lily:lily.flowersLily FosterIn passthru15:04:27
@lily:lily.flowersLily FosterHold on one sec. I'm wondering if that code is platform-independent15:06:09
@lily:lily.flowersLily Foster(probably a bad idea, but I'm gonna have to think on this to come up with a better solution)15:06:32
@lily:lily.flowersLily Foster

Just to confirm, does this do better for you Janne Heß?

diff --git a/pkgs/build-support/node/build-npm-package/hooks/default.nix b/pkgs/build-support/node/build-npm-package/hooks/default.nix
index c34709335ff..1e6d82dc8df 100644
--- a/pkgs/build-support/node/build-npm-package/hooks/default.nix
+++ b/pkgs/build-support/node/build-npm-package/hooks/default.nix
@@ -6,7 +6,7 @@
       name = "npm-config-hook";
       substitutions = {
         nodeSrc = srcOnly nodejs;
-        nodeGyp = "${buildPackages.nodejs}/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js";
+        nodeGyp = "${nodejs.__spliced.buildHost or buildPackages.nodejs}/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js";
 
         # Specify `diff`, `jq`, and `prefetch-npm-deps` by abspath to ensure that the user's build
         # inputs do not cause us to find the wrong binaries.
15:09:19
@janne.hess:helsinki-systems.de@janne.hess:helsinki-systems.detbh, I have no idea how __spliced works15:09:40
@janne.hess:helsinki-systems.de@janne.hess:helsinki-systems.debut probably?15:09:43
@lily:lily.flowersLily Foster
In reply to @janne.hess:helsinki-systems.de
tbh, I have no idea how __spliced works
Dark magic mostly. There's a reason a lot of people consider splicing to have been a bit of a mistake...
15:10:10
@janne.hess:helsinki-systems.de@janne.hess:helsinki-systems.deso I have to check spliceReal → mash → merge → value?15:10:55
@janne.hess:helsinki-systems.de@janne.hess:helsinki-systems.de * so I have to check spliceReal → mash → merge → value in splice.nix??15:11:01
@janne.hess:helsinki-systems.de@janne.hess:helsinki-systems.dewhat the…15:11:30
@lily:lily.flowersLily Foster
In reply to @janne.hess:helsinki-systems.de
but probably?
If that diff does work for your particular use-case, let me know and I may just go ahead and PR it, unless I or someone else comes up with something better
16:49:44

Show newer messages


Back to Room ListRoom Version: 6