You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to build rmfakecloud (a go app, with since the latest version a pnpm web ui component) in #358324 in a single derivation but that didn't go so well.
If you really must, you can set env.pnpmDeps and env.pnpmRoot, since IIRC env.* is always propagated. (or do some hacking around with adding pnpmConfigHook only to the main package and not the FOD).
This is very much just a hack. I agree that this should be more composable.
A part of #353526 might address this because it changes how the builder args are automatically inherited. It needs more work and maybe it needs to be split up into multiple PRs...
Yeah, changing buildGoModule to work with hooks like pnpm does is probably the most composable approach long term, I hadn't realized this already was in the pipes (just had a quick look at the PR and that does look like it was a lot of work, and as you said there probably is some more left -- thank you)
Short term, there really isn't any urgent need to move away from the current "build ui in a separate derivation" apart from elegance (and removing an intermediate step), so as far as I'm concerned it might make sense to just wait for this rework to finish on its own time.
I've also just tried env. and it seems to work, I agree it's a hack but it might be better than the current approach if it allows the update script to run on rmfakecloud (that was my motivation for bringing the UI in the same nix file, but I didn't actually get to try if it even works yet...)
I'll try to find some time to find how it's actually supposed to work on a simpler package first 😁
Ah, actually I was misunderstanding how buildGoModule works; the problem isn't so much that pnpmDeps/Root aren't inherited in the goModules it's that nativeBuildInputs all are inherited..
I'd "just" need some way to specify that pnpm_9.configHook is in nativeBuildInputs for the final package but not for goModules
With the current env workaround the build actually runs the pnpm hook twice (once when vendoring the module and once for the actual package build)
@TomaSajt do you know why nativeBuildInputs have to be propagated to the goModules? I'm not familiar with go but if it's just downloading deps and not actually building anything I don't see why it would require any special input (and in your new version I don't see it being propagated)
(and, no, I won't post that in the PR as it has nothing to do with that PR... It's a side effect that it happens to probably fix it)
(alternatively making pnpm config hook not error but just ignore executing if pnpmDeps isn't set, but that would be a downgrade of UX for "normal" folks trying to build a new package with pnpm...? sorry for back-to-back comment, I'll stop spamming for a bit)
Activity
TomaSajt commentedon Nov 25, 2024
If you really must, you can set
env.pnpmDepsandenv.pnpmRoot, since IIRCenv.*is always propagated. (or do some hacking around with addingpnpmConfigHookonly to the main package and not the FOD).This is very much just a hack. I agree that this should be more composable.
A part of #353526 might address this because it changes how the builder args are automatically inherited. It needs more work and maybe it needs to be split up into multiple PRs...
martinetd commentedon Nov 25, 2024
Thanks for the quick reply!
Yeah, changing buildGoModule to work with hooks like pnpm does is probably the most composable approach long term, I hadn't realized this already was in the pipes (just had a quick look at the PR and that does look like it was a lot of work, and as you said there probably is some more left -- thank you)
Short term, there really isn't any urgent need to move away from the current "build ui in a separate derivation" apart from elegance (and removing an intermediate step), so as far as I'm concerned it might make sense to just wait for this rework to finish on its own time.
I've also just tried env. and it seems to work, I agree it's a hack but it might be better than the current approach if it allows the update script to run on rmfakecloud (that was my motivation for bringing the UI in the same nix file, but I didn't actually get to try if it even works yet...)
I'll try to find some time to find how it's actually supposed to work on a simpler package first 😁
winterqt commentedon Nov 25, 2024
Closing, discussion should be moved to the PR. Thanks for contributing!
martinetd commentedon Nov 25, 2024
Ah, actually I was misunderstanding how buildGoModule works; the problem isn't so much that pnpmDeps/Root aren't inherited in the
goModulesit's that nativeBuildInputs all are inherited..I'd "just" need some way to specify that
pnpm_9.configHookis in nativeBuildInputs for the final package but not forgoModulesWith the current env workaround the build actually runs the pnpm hook twice (once when vendoring the module and once for the actual package build)
@TomaSajt do you know why nativeBuildInputs have to be propagated to the goModules? I'm not familiar with go but if it's just downloading deps and not actually building anything I don't see why it would require any special input (and in your new version I don't see it being propagated)
(and, no, I won't post that in the PR as it has nothing to do with that PR... It's a side effect that it happens to probably fix it)
martinetd commentedon Nov 25, 2024
(alternatively making pnpm config hook not error but just ignore executing if pnpmDeps isn't set, but that would be a downgrade of UX for "normal" folks trying to build a new package with pnpm...? sorry for back-to-back comment, I'll stop spamming for a bit)
martinetd commentedon May 26, 2026
Reopening this as it's still an issue a couple of years later (and the "hook based alternative to buildGoModule" draft PR has gone stale)
(This came up updating rmfakecloud again in #524309)
update_dependency_hashes: workaround goModules hash depending on othe…
dora: 1.24.3 -> 1.24.4
dora: 1.24.3 -> 1.24.4 (nix-community#1297)