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

wtf: No longer use vendored dependencies #68189

Merged
merged 1 commit into from Sep 6, 2019

Conversation

avdv
Copy link
Member

@avdv avdv commented Sep 6, 2019

Motivation for this change

The project once could not be build because a dependency disappeared.(see here: wtfutil/wtf#501)

That's why the project's maintainer included vendored dependencies right in the upstream project. Those dependencies are apparently not updated alongside the main go.mod dependencies.

The go modules utilized by the project and the vendored dependencies already
diverged, so the nix build of wtf was slightly out-of-date regarding the
official binary.

The gocenter proxy provides "immutable re-usable Go modules" which should avoid the problem of any dependency suddenly vanishing.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • 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 nix-review --run "nix-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.
Notify maintainers

cc @marsam @kalbasit

The go modules utilized by the project and the vendored dependencies already
diverged, so the nix build of `wtf` was slightly out-of-date regarding the
official binary.

The gocenter proxy provides "immutable re-usable Go modules" which should avoid
the problem of any dependency suddenly vanishing.
@avdv
Copy link
Member Author

avdv commented Sep 6, 2019

Also, the wtf project renamed the binary from wtf to wtfutil. I could not easily see how I can change the binary too, short of just renaming it in the postBuild.

@peterhoeg
Copy link
Member

How will it work with the proxy and building in a sandbox?

@@ -9,28 +9,23 @@ buildGoModule rec {
pname = "wtf";
version = "0.21.0";

overrideModAttrs = _oldAttrs : _oldAttrs // {
preBuild = ''export GOPROXY="https://gocenter.io"'';
Copy link
Member

Choose a reason for hiding this comment

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

Should we have this for all packages?

Copy link
Member Author

@avdv avdv Sep 19, 2019

Choose a reason for hiding this comment

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

I am not sure, but I am also a bit out of my element here; not really using Go and not knowing its best practices.

At least, this is what the wtf project's build instructions advice. And the "immutable re-usable Go modules" part sounds quite interesting. But, I also hear that with newer Go versions, there will be an official proxy / modules server... ?!

@Mic92
Copy link
Member

Mic92 commented Sep 6, 2019

How will it work with the proxy and building in a sandbox?

Network access is allowed in fixed-input derivations, which is what we use to fetch go packages.

@Mic92 Mic92 merged commit ff969fe into NixOS:master Sep 6, 2019
@Mic92
Copy link
Member

Mic92 commented Sep 6, 2019

Also, the wtf project renamed the binary from wtf to wtfutil. I could not easily see how I can change the binary too, short of just renaming it in the postBuild.

Renaming it in postBuild should work.

@avdv avdv deleted the wtf-no-vendored-deps branch September 19, 2019 06:12
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.

None yet

3 participants