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

saschagrunert commented Apr 30, 2020

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

@saschagrunert saschagrunert force-pushed the saschagrunert:crio-buildgomodule branch from e818e1b to 509601d Apr 30, 2020
@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 saschagrunert force-pushed the saschagrunert:crio-buildgomodule branch from 509601d to d606e54 Apr 30, 2020
@saschagrunert
Copy link
Member Author

saschagrunert commented Apr 30, 2020

Okay sounds good, thank you for the hint.

@saschagrunert
Copy link
Member Author

saschagrunert commented May 7, 2020

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

@saschagrunert saschagrunert force-pushed the saschagrunert:crio-buildgomodule branch from 2901456 to 08f85b5 May 7, 2020
@saschagrunert saschagrunert force-pushed the saschagrunert:crio-buildgomodule branch from 08f85b5 to 8307bfa May 8, 2020
@ofborg ofborg bot requested a review from zowoq May 8, 2020
@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 saschagrunert force-pushed the saschagrunert:crio-buildgomodule branch from 8307bfa to 006e6b0 May 14, 2020
@saschagrunert
Copy link
Member Author

saschagrunert commented May 14, 2020

Rebased and changed as suggested. 👍

@zowoq
zowoq approved these changes May 14, 2020
@marsam marsam merged commit 2c83124 into NixOS:master May 14, 2020
16 checks passed
16 checks passed
Evaluation Performance Report Evaluator Performance Report
Details
cri-o, cri-o.passthru.tests on aarch64-linux Success
Details
cri-o, cri-o.passthru.tests on x86_64-linux Success
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="006e6b0"; rev="006e6b052f04b36d79651397725bb3359ac61198"; } ./pkgs/t
Details
grahamcofborg-eval-lib-tests nix-build --arg pkgs import ./. {} ./lib/tests/release.nix
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="006e6b0"; rev="006e6b052f04b36d79651397725bb3359ac61198"; } ./nixos/
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="006e6b0"; rev="006e6b052f04b36d79651397725bb3359ac61198"; } ./nixos/
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="006e6b0"; rev="006e6b052f04b36d79651397725bb3359ac61198"; } ./nixos/
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="006e6b0"; rev="006e6b052f04b36d79651397725bb3359ac61198"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="006e6b0"; rev="006e6b052f04b36d79651397725bb3359ac61198"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="006e6b0"; rev="006e6b052f04b36d79651397725bb3359ac61198"; } ./pkgs/t
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
@saschagrunert saschagrunert deleted the saschagrunert:crio-buildgomodule branch May 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.