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

[19.09] rPackages.RMariaDB, rPackages.RMySQL: Fix builds #72413

Merged
merged 2 commits into from Nov 6, 2019

Conversation

mm--
Copy link
Contributor

@mm-- mm-- commented Nov 1, 2019

Motivation for this change

rPackages.RMySQL was failing to build for me.
When searching for this problem I came cross issue #62412 whichshowed that rPackages.RMariaDB was failing to build as well.

It looks like both packages needed to depend on the dev output of the mariadb.connector-c and mysql.connector-c. RMariaDB also needed patchShebangs for its configure script.

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 nix-review --run "nix-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.
Notify maintainers

cc @

Tested this on NixOS 19.09 as well as a multi-user Nix installation on an Ubuntu machine.

RMySQL was not building as `mysql_config` (which the config script
uses to determine C flags) is in pkgs.mysql.connector-c.dev but not
pkgs.mysql.connector-c
Issue NixOS#62412 reported that the configure script was not running.
It needed `patchShebangs` as well as the `mariadb.connector-c.dev` library.
@mm--
Copy link
Contributor Author

mm-- commented Nov 1, 2019

Note: This is just to fix 19.09. On master, mysql.connector-c is replaced by libmysqlclient (which is also the same as mariadb-connector-c). In master, libmysqlclient does contain bin/mysql_config and bin/mariadb_config which RMySQL and RMariaDB use in their configure scripts to set PKGCONFIG_CFLAGS and PKGCONFIG_LIBS.

@mm--
Copy link
Contributor Author

mm-- commented Nov 1, 2019

Although there are no binaries, I did test these packages using:

nix run -I nixpkgs=$PATH_TO_NEW_NIXPKGS '(with import <nixpkgs> {}; rWrapper.override { packages = [ R rPackages.RMariaDB ]; })' -c R

and then running (in that R session):

library(RMariaDB)

con <- dbConnect(RMariaDB::MariaDB(),
                 host = "(my-mysql-host)",
                 user = "(myuser)",
                 db = "(some-schema)",
                 password = "(mypassword)")

dbListTables(con)

data <- dbGetQuery(con, "SELECT * FROM schema.table;")

dbDisconnect(con)

This worked. Although running a SELECT statement on a VIEW resulted in

Error in result_create(conn@ptr, statement, is_statement) : 
  Prepared statement needs to be re-prepared [1615]

But this error only occurred for RMariaDB.

Doing the same process but with RMySQL worked just fine. I suspect
this is a problem with the server I'm using, not with the compilation
of RMariaDB.

@peti peti merged commit 250fe56 into NixOS:release-19.09 Nov 6, 2019
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