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.server-mysql and zabbix.server-pgsql broken on master #95532

Closed
aanderse opened this issue Aug 15, 2020 · 9 comments
Closed

zabbix.server-mysql and zabbix.server-pgsql broken on master #95532

aanderse opened this issue Aug 15, 2020 · 9 comments
Labels
0.kind: bug Something is broken

Comments

@aanderse
Copy link
Member

Describe the bug
A clear and concise description of what the bug is.

zabbix.server-mysql and zabbix.server-pgsql broke recently: https://hydra.nixos.org/build/122059780. I briefly poked around but I'm not sure what the problem or solution is. If anyone has any insight much appreciated.

@jonringer took a quick look as well and had this comment.

To Reproduce
Steps to reproduce the behavior:

  1. nix-build -A zabbix.server-mysql on master, see build failure: configure: error: LIBXML2 library not found

Expected behavior
A clear and concise description of what you expected to happen.

I expected the program to compile.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Notify maintainers

@PsyanticY

Metadata
Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute: zabbix.server-mysql zabbix.server-pgsql
# a list of nixos modules affected by the problem
module: services.zabbixServer
@aanderse aanderse added the 0.kind: bug Something is broken label Aug 15, 2020
@jonringer
Copy link
Contributor

removing the --with-libxml2 configure flag allows for it to build, but I think that would be a regression in terms of server capabilities.

More proper fix would probably be to correct upstreams logic in how it finds libxml headers during configure

@aanderse
Copy link
Member Author

@jonringer I'm under the impression this breakage wasn't introduced with a change in the zabbix.server-mysql package, so I'm left to believe something changed in nixpkgs which caused this. From your quick look is that not the case? 😕

@jonringer
Copy link
Contributor

I didn't look at any of the other packages, just investigated with zabbix.server which I guess points to zabbix.server-pgsql

@aanderse
Copy link
Member Author

@jonringer sorry I should have clarified. My statement holds for both zabbix.server-mysql and zabbix.server-pgsql.

@aanderse
Copy link
Member Author

I have double checked - both the zabbix.server-pgsql and zabbix.server-mysql packages from master compile on the release-20.03 branch, so this isn't a change from upstream that directly caused it (maybe indirectly)... something happened in nixpkgs to cause this regression.

ping @mmahut and @PsyanticY as maintainers to take a look.

@pbogdan
Copy link
Member

pbogdan commented Aug 16, 2020

I found a PR that seems to be fixing a similar issue (#90249) after recent-ish pkg-config changes (#87705). I adapted the diff like so

diff --git a/pkgs/servers/monitoring/zabbix/server.nix b/pkgs/servers/monitoring/zabbix/server.nix
index fdf3fd476df..af7fc0cb04d 100644
--- a/pkgs/servers/monitoring/zabbix/server.nix
+++ b/pkgs/servers/monitoring/zabbix/server.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, curl, libevent, libiconv, libxml2, openssl, pcre, zlib
+{ stdenv, fetchurl, autoreconfHook, pkgconfig, curl, libevent, libiconv, libxml2, openssl, pcre, zlib
 , jabberSupport ? true, iksemel
 , ldapSupport ? true, openldap
 , odbcSupport ? true, unixODBC
@@ -25,7 +25,7 @@ in
         inherit sha256;
       };

-      nativeBuildInputs = [ pkgconfig ];
+      nativeBuildInputs = [ autoreconfHook pkgconfig ];
       buildInputs = [
         curl
         libevent
@@ -65,6 +65,14 @@ in
         find database -name data.sql -exec sed -i 's|/usr/bin/||g' {} +
       '';

+      preAutoreconf = ''
+        for i in $(find . -type f -name "*.m4"); do
+          substituteInPlace $i \
+            --replace 'test -x "$PKG_CONFIG"' 'type -P "$PKG_CONFIG" >/dev/null'
+        done
+      '';
+
+
       postInstall = ''
         mkdir -p $out/share/zabbix/database/
         cp -r include $out/

and that appears to fix the build but I can't confidently say it is the right solution.

@aanderse
Copy link
Member Author

Thanks for your time and effort @pbogdan! 🎉

@Ericson2314 how does this look to you?
@jonringer any thoughts?

@jonringer
Copy link
Contributor

LGTM at a glance

@aanderse
Copy link
Member Author

Resolved by #87712.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

No branches or pull requests

3 participants