Skip to content
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

Add vend support to go-modules #89453

Merged
merged 8 commits into from Jul 31, 2020
Merged

Add vend support to go-modules #89453

merged 8 commits into from Jul 31, 2020

Conversation

c00w
Copy link
Contributor

@c00w c00w commented Jun 4, 2020

Motivation for this change

Currently you have to manually patch vendor directories that distribute c code via the go package system. By adding the useVend option, this gets much simpler.

Fixes #89128

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@c00w
Copy link
Contributor Author

c00w commented Jun 4, 2020

Had to open
nomad-software/vend#9 so that vend wouldn't run go mod tidy which isn't deterministic.

Copy link
Member

@kalbasit kalbasit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be great if we can run this by default, assuming it does not affect the current hashes as @Mic92 mentioned. Thanks for working on this!

@Mic92
Copy link
Member

Mic92 commented Jun 4, 2020

What I am a bit worried about is that new versions of vend might include new files. For that reason might not want to include it for all packages.

@c00w
Copy link
Contributor Author

c00w commented Jun 5, 2020

Vend rejected my patch, so we're going to have to maintain a semi permanent fork of it anyway :( Everything else is updated.

@c00w
Copy link
Contributor Author

c00w commented Jun 11, 2020

@Mic92 Fixed formatting :)

@c00w
Copy link
Contributor Author

c00w commented Jun 20, 2020

@Mic92 - I think nothing else is outstanding here.

@marsam
Copy link
Contributor

marsam commented Jun 20, 2020

IMHO useVend could be slightly more fitting, so we could describe it as: "Whether to use vend instead of go mod vendor to vendorize the go module dependencies".
But I don't have a strong opinion about it.

@zowoq
Copy link
Contributor

zowoq commented Jul 27, 2020

gobetween can be dropped from this PR. #93972

@c00w
Copy link
Contributor Author

c00w commented Jul 29, 2020

gobetween is dropped - working on figuring out hugo (looks like a rebase broke it).

@c00w
Copy link
Contributor Author

c00w commented Jul 29, 2020

And hugo is fixed - should be g2g

@zowoq
Copy link
Contributor

zowoq commented Jul 29, 2020

go-ethereum builds but the vendorSha256 needs to be updated.

diff --git a/pkgs/applications/blockchains/go-ethereum.nix b/pkgs/applications/blockchains/go-ethereum.nix
index e2b308d88e2..0edeccf4003 100644
--- a/pkgs/applications/blockchains/go-ethereum.nix
+++ b/pkgs/applications/blockchains/go-ethereum.nix
@@ -12,7 +12,7 @@ buildGoModule rec {
   };
 
   runVend = true;
-  vendorSha256 = "0r08fayxpccjyr29g38wc0zvpqgma9inyvdwcama1fyiq0n8n39d";
+  vendorSha256 = "1744df059bjksvih4653nnvb4kb1xvzdhypd0nnz36m1wrihqssv";
 
   subPackages = [
     "cmd/abidump"

Can you push the changes in nomad-software/vend@24fdebf to nomad-software/vend#10 please?

Upstream seems to be responsive so I'll give them a day or two to comment on the new changes.

@c00w
Copy link
Contributor Author

c00w commented Jul 29, 2020

Updated go-ethereum.

Re: vend - somehow I updated the pr verbally but didn't push. I'd strongly prefer we don't block on vend upstream, since they're still not convinced that the PR is needed + they've literally rejected every PR I sent them related to nix functionality. If they do merge it I can flip the repos back, but it's not great odds.

@zowoq
Copy link
Contributor

zowoq commented Jul 29, 2020

Re: vend - somehow I updated the pr verbally but didn't push. I'd strongly prefer we don't block on vend upstream, since they're still not convinced that the PR is needed + they've literally rejected every PR I sent them related to nix functionality. If they do merge it I can flip the repos back, but it's not great odds.

If they are willing to accept the functionality but request changes we may need to update packages vendorSha256 again?

@Mic92
Copy link
Member

Mic92 commented Jul 30, 2020

Re: vend - somehow I updated the pr verbally but didn't push. I'd strongly prefer we don't block on vend upstream, since they're still not convinced that the PR is needed + they've literally rejected every PR I sent them related to nix functionality. If they do merge it I can flip the repos back, but it's not great odds.

If they are willing to accept the functionality but request changes we may need to update packages vendorSha256 again?

I wonder if we just should maintain our own fork anyway. The package is quite simple and we cannot have upstream breaking our hashes if @r-ryantm makes a PR and somebody merges it without knowing the consequences. It could be simplified a lot i.e. removing some dependencies like command-line coloring which is not showed in many cases anyway. @c00w what do you think about a fork maintained in https://github.com/nix-community?

@c00w
Copy link
Contributor Author

c00w commented Jul 30, 2020

@zowoq @Mic92 In what proves my prothetic abilities - they just rejected the PR :P

I can move this to nix-community (although I'd prefer if I could get admin permissions there on the vend repo).

@zowoq
Copy link
Contributor

zowoq commented Jul 31, 2020

@Mic92 Is this okay to merge or do you want to do the switch to nix-community in this PR?

@Mic92
Copy link
Member

Mic92 commented Jul 31, 2020

@zowoq @Mic92 In what proves my prothetic abilities - they just rejected the PR :P

I can move this to nix-community (although I'd prefer if I could get admin permissions there on the vend repo).

I sent you an invite to the organisation. Once you moved the project their, you will be the maintainer and marked as such. However it also allows to easily move over maintenance in case you are lacking time.

@Mic92
Copy link
Member

Mic92 commented Jul 31, 2020

@Mic92 Is this okay to merge or do you want to do the switch to nix-community in this PR?

Let's just move before. The process is just a few clicks away.

@zowoq
Copy link
Contributor

zowoq commented Jul 31, 2020

Checking darwin:

@ofborg build aerc blockbook go-ethereum hugo mautrix-whatsapp saml2aws

@zowoq zowoq merged commit e703f3f into NixOS:master Jul 31, 2020
matthewmazzanti added a commit to matthewmazzanti/nixpkgs that referenced this pull request Aug 1, 2020
Pull NixOS#89453 introduced a bug in the documentation that is preventing the
hydra build for nixpkgs-unstable from finishing. I have added the
additional option indroduced in that patch (runVend for go modules) and
added the callout tag so that the documenation can build again.
zowoq pushed a commit that referenced this pull request Aug 1, 2020
Pull #89453 introduced a bug in the documentation that is preventing the
hydra build for nixpkgs-unstable from finishing. I have added the
additional option indroduced in that patch (runVend for go modules) and
added the callout tag so that the documenation can build again.
braack pushed a commit to braack/nixpkgs that referenced this pull request Oct 29, 2020
Pull NixOS#89453 introduced a bug in the documentation that is preventing the
hydra build for nixpkgs-unstable from finishing. I have added the
additional option indroduced in that patch (runVend for go modules) and
added the callout tag so that the documenation can build again.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

buildGoModule: vendoring doesn't copy C sources
9 participants