-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
Problematic behavior of buildGoModule
in conjunction with vendorSha256
#89310
Comments
Maybe you'd be interested in https://discourse.nixos.org/t/creating-vendor-directories-directly-in-srcs-of-go-and-rust-packages-so-fixed-output-derivations-wont-be-needed/7367/6 |
Derp just saw this - I dropped a massive response in #86376 (comment)
I think I wrote almost all of those patches and it wasn't too bad. Mostly we're copying a couple more files into the vendor directories (which would have been impossible with the go module approach). tinygo, jenkinsx and one other package (that I can't remember) were really painful. Most packages (300+ I think) were actually automatically migrated + mostly just worked. Most overrideModAttrs options are pretty small (and maybe I should go see if I can make them top line options).
They shouldn't be? I thought @Mic92 had me drop almost all of these. My memory is that one binary used gomock which didn't build, so I did a patch on the source. When I get some time I'll see if I can go find the vendor patches and see what the big ones are + why they are present. I don't think anyone has objections to deps.nix, just a lack of time to implement it :)
In general these patches are needed because go mod vendor doesn't work cleanly on upstream :) |
I'm not seeing vendor.patch files?
|
Thanks a lot for taking the time to respond to my criticism, I read both of your comments. Please be patient until tomorrow, I'll need to sleep now :) |
With #89453 we now have 4 instances of overrideModAttrs out of 465 packages, which is pretty good
|
@nlewo also made some progress on getting vgo2nix to work nicely with |
Hi! First of all sorry for the delay, I really intended to respond earlier. I'll try to respond to the statements made during the last week in a more or less chronological order.
Can you elaborate this, please? Can't you patch e.g. the
We still have the issue with the fixed-output derivation here (but we discussed about this in the past IIRC and I acknowledge that we have different opinions - also, we should discuss this in the corresponding PR then).
That's right: I'm talking about convenience: I only observed the need to fix some packages manually in a post-fetch hook after your patch which reminded me of the
I see. My posts weren't meant as complaint or something, I mainly want to understand the motivation and technical reasons :)
That's true, but it still means that you have to dive into the dependency tree in some cases.
Yeah, I removed the last one from
Oh that's nice! Apart from that, thanks a lot for working so hard on this. As far as I understand this now, with some pending PRs getting merged, we have a fairly stable improvement for |
No one patched the results of downloading go modules because it was ... hard enough to be functionally impossible without writing code. We also had a gloriously hard time making it deterministic (I think it took 3 passes and an upstream go issue). People are patching the sources within vendor, which is great :) I should probably do a review of people using this besides me, to see what they're doing. |
I marked this as stale due to inactivity. → More info |
Can we close this? |
Yep |
Describe the bug
I figured that it may be better to move further discussion about the recent
buildGoModule
-changes (#86376 (comment)) to a new issue.I see the following problems with the switch to
-mod=vendor
:A lot of packages[1] now have to override dependencies using
overrideModAttrs
. In my opinion this is a serious regression since we now push the task of solving dependency problems to our package maintainers, previously the build-script was able to do this automatically.I also don't understand why those huge
vendor.patch
-files are needed, in that case I think that it's even easier to just use a generateddeps.nix
. To be fair, this seems to be only relevant fordocumize-community
atm where I was able to remove it during the last update[2].I'd like to know why those hacks are even needed and discuss about better alternatives (AFAICS
modSha256
will be removed in the upcoming release and we now seem to preferbuildGoModule
overbuildGoPackage
).Also relevant: #86282, #89128, #52469 & #84826
Notify folks who are probably interested/involved into this topic
cc @Mic92 @c00w @nlewo @zimbatm @doronbehar @kalbasit @emilazy
[1] When grepping for
overrideModAttrs
, I found the following packages:mautrix-whatsapp
tailscale
blockbook
go-ethereum
gobetween
tinygo
saml2aws
hugo
aerc
[2] 7857634
The text was updated successfully, but these errors were encountered: