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

zabbix.agent2: init at 5.0.5 #117538

Merged
merged 2 commits into from Mar 28, 2021
Merged

zabbix.agent2: init at 5.0.5 #117538

merged 2 commits into from Mar 28, 2021

Conversation

aanderse
Copy link
Member

Motivation for this change

There is a drop in replacement for zabbix.agent: zabbix.agent2. While zabbix.agent was written in c, zabbix.agent2 is mostly written in go with a bit of c glue.

A massive thank you to @tomberek who packaged this with me. I was really lost on how to package this and he led me through the whole process. What a champion! 🚀

I ran a full set of tests on this today on a server that was running zabbix.agent, so testing was thorough 👍

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.

@tomberek tomberek merged commit d6fd7c6 into NixOS:master Mar 28, 2021
@aanderse
Copy link
Member Author

Thanks again @tomberek 🎉

@aanderse aanderse deleted the zabbix-agent2 branch March 28, 2021 17:40
'';

# run `go mod vendor` from the correct directory
overrideModAttrs = (_oldAttrs : {
Copy link
Contributor

Choose a reason for hiding this comment

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

Just setting modRoot = "src/go" instead of overrideModAttrs should work.

Copy link
Member Author

Choose a reason for hiding this comment

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

Unfortunately not because source code outside of this directory is needed.

Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to work?

diff --git a/pkgs/servers/monitoring/zabbix/agent2.nix b/pkgs/servers/monitoring/zabbix/agent2.nix
index f3c1be0f8e2..5f77528f48b 100644
--- a/pkgs/servers/monitoring/zabbix/agent2.nix
+++ b/pkgs/servers/monitoring/zabbix/agent2.nix
@@ -40,7 +40,7 @@ import ./versions.nix ({ version, sha256 }:
     # we need to manipulate a number of things for their build
     # system to properly work
     buildPhase = ''
-      cp -r vendor src/go/vendor
+      cd ../..
       make
     '';
 
@@ -49,12 +49,7 @@ import ./versions.nix ({ version, sha256 }:
       install -Dm0755 src/go/bin/zabbix_agent2 $out/bin/zabbix_agent2
     '';
 
-    # run `go mod vendor` from the correct directory
-    overrideModAttrs = (_oldAttrs : {
-      preConfigure = ''
-        cd src/go
-        '';
-    });
+    modRoot = "src/go";
 
     meta = with lib; {
       description = "An enterprise-class open source distributed monitoring solution (client-side agent)";

Copy link
Member Author

Choose a reason for hiding this comment

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

That's great! Thanks for taking a look. Would you be willing to make a PR? I can test.


vendorSha256 = "1kb3lc9jjv0cpzq93k1b9y496i95fcnwhb03j0gwlyqmgsa6yn81";

nativeBuildInputs = [ autoreconfHook pkg-config];
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
nativeBuildInputs = [ autoreconfHook pkg-config];
nativeBuildInputs = [ autoreconfHook pkg-config ];

@aanderse aanderse mentioned this pull request Mar 29, 2021
10 tasks
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

4 participants