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

cri-o: switch to buildGoModule #86378

Merged
merged 1 commit into from May 14, 2020
Merged

Conversation

saschagrunert
Copy link
Member

Motivation for this change

This is just a cleanup to switch from buildGoPackage to buildGoModule.

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
    • [ x 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.

cc @NixOS/podman

@zowoq
Copy link
Contributor

zowoq commented Apr 30, 2020

These sorts of switches are currently being debated.

See #84826, #86282

I'd suggest holding off on this for now.

@saschagrunert
Copy link
Member Author

Okay sounds good, thank you for the hint.

@saschagrunert
Copy link
Member Author

Rebased on top of the latest master branch to resolve the conflict.

@zowoq
Copy link
Contributor

zowoq commented May 14, 2020

Now that #86376 has been merged we can use buildGoModule with a vendor folder.

diff --git a/pkgs/applications/virtualization/cri-o/default.nix b/pkgs/applications/virtualization/cri-o/default.nix
index 0851f1f716b..d662441a6dc 100644
--- a/pkgs/applications/virtualization/cri-o/default.nix
+++ b/pkgs/applications/virtualization/cri-o/default.nix
@@ -1,6 +1,6 @@
 { stdenv
 , btrfs-progs
-, buildGoPackage
+, buildGoModule
 , fetchFromGitHub
 , glibc
 , gpgme
@@ -14,11 +14,11 @@
 , pkg-config
 }:
 
-buildGoPackage rec {
+buildGoModule rec {
   pname = "cri-o";
   version = "1.18.0";
 
-  goPackagePath = "github.com/cri-o/cri-o";
+  vendorSha256 = null;
 
   src = fetchFromGitHub {
     owner = "cri-o";
@@ -44,8 +44,6 @@ buildGoPackage rec {
 
   BUILDTAGS = "apparmor seccomp selinux containers_image_ostree_stub";
   buildPhase = ''
-    pushd go/src/${goPackagePath}
-
     sed -i '/version.buildDate/d' Makefile
 
     make binaries docs BUILDTAGS="$BUILDTAGS"

This is just a cleanup to switch from buildGoPackage to buildGoModule.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
@saschagrunert
Copy link
Member Author

Rebased and changed as suggested. 👍

@marsam marsam merged commit 2c83124 into NixOS:master May 14, 2020
@saschagrunert saschagrunert deleted the crio-buildgomodule branch May 14, 2020 13:30
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