| 21 May 2023 |
hexa | hm ok | 21:39:38 |
Lily Foster | Now for what to do about it, idk | 21:39:46 |
Lily Foster | There's no comment in the buildGoModule code about why it propagates nativeBuildInputs to the fetcher -- do you know why it would be doing that? | 21:40:20 |
Lily Foster | That seems... counterintuitive. Stuff like buildRustPackage don't do that | 21:41:11 |
Lily Foster | * That seems... counterintuitive. Stuff like buildRustPackage doesn't do that | 21:41:24 |
Lily Foster | (and you can't override the fetcher with buildGoModule either since the fetcher is still not separately exposed...) | 21:41:53 |
Lily Foster | Apparently buildGoModule also doesn't propagate unpackPhase or its hooks to the fetcher despite propagating src, which seems sus... | 21:48:24 |
Lily Foster | It looks like the evcc derivation has the exact same issue and fixes it via buildGoModule's overrideModAttrs to set a slimmer nativeBuildInputs | 21:56:58 |
Lily Foster | Yeah, adding this to the derivation fixes building .go-modules and fixes the update script hexa:
overrideModAttrs = oldAttrs: {
nativeBuildInputs = lib.filter (drv: drv != npmHooks.npmConfigHook) oldAttrs.nativeBuildInputs;
preBuild = null;
};
| 22:03:18 |
hexa | In reply to @lily:lily.flowers There's no comment in the buildGoModule code about why it propagates nativeBuildInputs to the fetcher -- do you know why it would be doing that? no idea | 22:03:41 |
hexa | In reply to @lily:lily.flowers It looks like the evcc derivation has the exact same issue and fixes it via buildGoModule's overrideModAttrs to set a slimmer nativeBuildInputs oh, right 😲 | 22:04:10 |
Lily Foster | In reply to @hexa:lossy.network https://github.com/NixOS/nixpkgs/pull/230991#issuecomment-1552133508 I just realized that was before winter fixed the PR to actually work (which is why it ended up with a pushd/popd) | 22:05:11 |
Lily Foster | So yeah the npmRoot PR needs to a rebase and then I'll merge and deal with further changes in follow-ups, to unblock other stuff | 22:06:33 |
hexa | just the upper pushd hunk needs a massage | 22:11:08 |
Lily Foster | Yep, I've already done it locally. Was gonna get permission from winter before just pushing to the branch myself though | 22:11:34 |
| 22 May 2023 |
raitobezarius | is there a way with buildNpmPackage to just "install" the node_modules and be done? | 11:45:23 |
raitobezarius | is dontNpmInstall the option I am looking for? I tried it and I'm not sure I am holding it correctly | 11:45:40 |
Lily Foster | Is the default install hook over-copying or failing or something? | 11:48:19 |
raitobezarius | > Executing npmInstallHook
> npm ERR! Invalid package, must have name and version
| 11:58:22 |
raitobezarius | this is an invalid Node.js package per se | 11:58:26 |
raitobezarius | because they reuse it in some Makefile later on | 11:58:31 |
raitobezarius | And they really only need the node deps | 11:58:35 |
Lily Foster | If the project has custom install logic, just override installPhase and do what you need to do | 12:05:52 |
Lily Foster | Or if you want the default stdenv installPhase then dontNpmInstall does what you want | 12:07:42 |
raitobezarius | Okay, thank you! | 12:09:20 |
Lily Foster | You may need to prune node_modules first yourself though so you don't end up with dev deps in the output | 12:10:07 |
Lily Foster | If the makefile doesn't | 12:10:17 |
raitobezarius | is there a way to extract a nodejs from buildNpmPackage function? | 12:11:02 |
raitobezarius | or the result of the buildNpmPackage? | 12:11:06 |
Lily Foster | Like what nodejs that buildNpmPackage is using? | 12:16:48 |