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

go: Introduce environment variable GO_NO_VENDOR_CHECKS to relax go vendor checks #109127

Merged
merged 1 commit into from Jan 13, 2021

Conversation

adisbladis
Copy link
Member

@adisbladis adisbladis commented Jan 12, 2021

This is used in https://github.com/tweag/gomod2nix to reconstruct a
vendor metadata file.

With the vendor checks we need a lot more metadata which isn't
relevant for building packages, especially since we've already locked
the dependency graph ahead of time

This patch has been ported from FreeBSD: https://reviews.freebsd.org/D24122.
See golang/go#37948 for discussion.

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.

Acknowledgements

This work is done within the context of Trustix and has been sponsored by a NLNet Foundation NGI-0 PET grant.

…ndor checks

This is used in https://github.com/tweag/gomod2nix to reconstruct a
vendor metadata file.

With the vendor checks we need a lot more metadata which isn't
relevant for building packages, especially since we've already locked
the dependency graph ahead of time

This has been ported from FreeBSD: https://reviews.freebsd.org/D24122
@Mic92
Copy link
Member

Mic92 commented Jan 12, 2021

Should be fine. I was wondering though, how hard it would be to generate modules.txt manually?

@adisbladis
Copy link
Member Author

adisbladis commented Jan 13, 2021

@Mic92 The general structure is trivially generated, the problem is that modules.txt requires a lot of extra data we don't have inside the sandbox like where replace directives are pointing to and such, and some of these potentially require networking to figure out.

@adisbladis adisbladis merged commit 655c4b4 into NixOS:staging Jan 13, 2021
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