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

mariadb: don't move pam files on Darwin #90139

Merged
merged 1 commit into from Jun 11, 2020
Merged

Conversation

doronbehar
Copy link
Contributor

Motivation for this change

Fix #90134 ?

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.

@ofborg ofborg bot added the 6.topic: darwin Running or building packages on Darwin label Jun 11, 2020
@ofborg ofborg bot requested a review from thoughtpolice June 11, 2020 13:10
@vcunat
Copy link
Member

vcunat commented Jun 11, 2020

@GrahamcOfBorg build mariadb

@@ -201,12 +201,12 @@ server = stdenv.mkDerivation (common // {
chmod +x "$out"/bin/wsrep_sst_common
rm "$out"/bin/{mariadb-client-test,mariadb-test,mysql_client_test,mysqltest}
rm -r "$out"/data # Don't need testing data
mv "$out"/OFF/suite/plugins/pam/pam_mariadb_mtr.so "$out"/share/pam/lib/security
mv "$out"/OFF/suite/plugins/pam/mariadb_mtr "$out"/share/pam/etc/security
rm -r "$out"/OFF
Copy link
Contributor

Choose a reason for hiding this comment

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

The "$out"/OFF directory is removed here, before the plugins are moved from it.

@Izorkin
Copy link
Contributor

Izorkin commented Jun 11, 2020

Please check with this patch:

diff --git a/pkgs/servers/sql/mariadb/default.nix b/pkgs/servers/sql/mariadb/default.nix
index 9c2134e211f..69aab569f40 100644
--- a/pkgs/servers/sql/mariadb/default.nix
+++ b/pkgs/servers/sql/mariadb/default.nix
@@ -201,13 +201,13 @@ server = stdenv.mkDerivation (common // {
     chmod +x "$out"/bin/wsrep_sst_common
     rm "$out"/bin/{mariadb-client-test,mariadb-test,mysql_client_test,mysqltest}
     rm -r "$out"/data # Don't need testing data
-    mv "$out"/OFF/suite/plugins/pam/pam_mariadb_mtr.so "$out"/share/pam/lib/security
-    mv "$out"/OFF/suite/plugins/pam/mariadb_mtr "$out"/share/pam/etc/security
-    rm -r "$out"/OFF
   '' + optionalString withStorageMroonga ''
     mv "$out"/share/{groonga,groonga-normalizer-mysql} "$out"/share/doc/mysql
   '' + optionalString (!stdenv.hostPlatform.isDarwin) ''
     sed -i 's/-mariadb/-mysql/' "$out"/bin/galera_new_cluster
+    mv "$out"/OFF/suite/plugins/pam/pam_mariadb_mtr.so "$out"/share/pam/lib/security
+    mv "$out"/OFF/suite/plugins/pam/mariadb_mtr "$out"/share/pam/etc/security
+    rm -r "$out"/OFF
   '';

@doronbehar
Copy link
Contributor Author

👍

'' + optionalString withStorageMroonga ''
mv "$out"/share/{groonga,groonga-normalizer-mysql} "$out"/share/doc/mysql
'' + optionalString (!stdenv.hostPlatform.isDarwin) ''
mv "$out"/OFF/suite/plugins/pam/pam_mariadb_mtr.so "$out"/share/pam/lib/security
mv "$out"/OFF/suite/plugins/pam/mariadb_mtr "$out"/share/pam/etc/security
rm -r "$out"/OFF
Copy link
Member

Choose a reason for hiding this comment

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

I don't expect we want to keep "$out"/OFF on Darwin, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds right to me.

Copy link
Contributor

@talyz talyz Jun 11, 2020

Choose a reason for hiding this comment

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

It doesn't actually seem to be created on darwin, so the build now fails because we try to remove it:

  -- Installing: /nix/store/2f7mg8dm4xh7hk2vvvdadia7gwaa785f-mariadb-server-10.4.13/share/doc/mysql/policy/apparmor/usr.sbin.mysqld.local
  -- Installing: /nix/store/2f7mg8dm4xh7hk2vvvdadia7gwaa785f-mariadb-server-10.4.13/share/doc/mysql/policy/selinux
  -- Installing: /nix/store/2f7mg8dm4xh7hk2vvvdadia7gwaa785f-mariadb-server-10.4.13/share/doc/mysql/policy/selinux/README
  -- Installing: /nix/store/2f7mg8dm4xh7hk2vvvdadia7gwaa785f-mariadb-server-10.4.13/share/doc/mysql/policy/selinux/mariadb-server.te
  -- Installing: /nix/store/2f7mg8dm4xh7hk2vvvdadia7gwaa785f-mariadb-server-10.4.13/share/doc/mysql/policy/selinux/mariadb-server.fc
  -- Installing: /nix/store/2f7mg8dm4xh7hk2vvvdadia7gwaa785f-mariadb-server-10.4.13/share/doc/mysql/policy/selinux/mariadb.te
  -- Installing: /nix/store/2f7mg8dm4xh7hk2vvvdadia7gwaa785f-mariadb-server-10.4.13/lib/pkgconfig/mariadb.pc
  -- Installing: /nix/store/2f7mg8dm4xh7hk2vvvdadia7gwaa785f-mariadb-server-10.4.13/share/aclocal/mysql.m4
  -- Installing: /nix/store/2f7mg8dm4xh7hk2vvvdadia7gwaa785f-mariadb-server-10.4.13/share/doc/mysql/mysql.server
  rm: cannot remove '/nix/store/2f7mg8dm4xh7hk2vvvdadia7gwaa785f-mariadb-server-10.4.13/OFF': No such file or directory
cannot build derivation '/nix/store/zap5nxyb8kkdldla5hi9hyb4hn15f2gj-diesel-cli-1.4.0.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/7jxmgixk4ax0jm07hvaqsb2r25fbd7sj-env.drv': 2 dependencies couldn't be built
[0 built (1 failed), 202 copied (2112.6 MiB), 572.0 MiB DL]
error: build of '/nix/store/7jxmgixk4ax0jm07hvaqsb2r25fbd7sj-env.drv' failed
https://github.com/NixOS/nixpkgs/pull/90139
2 packages failed to build:
diesel-cli mysql

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, ofborg seems to fail to build Darwin PRs so thanks 👍.

@doronbehar
Copy link
Contributor Author

Now at least the x86_64 linux have passed, but there's an error for aarch64 Linux though it doesn't seem related... The Darwin build seems to hang now for too long, so let's:

@GrahamcOfBorg build mariadb

@talyz
Copy link
Contributor

talyz commented Jun 11, 2020

The build now succeeds on darwin 👍

@talyz talyz merged commit d245896 into NixOS:master Jun 11, 2020
@talyz
Copy link
Contributor

talyz commented Jun 11, 2020

Thanks!

@doronbehar doronbehar deleted the mariadb-unblock branch March 2, 2023 10:39
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.

nixpkgs-unstable fails on Hydra because of mariadb
4 participants