NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.51k stars 13.69k forks source link

RMariaDB fails to build #62412

Closed deliciouslytyped closed 1 year ago

deliciouslytyped commented 5 years ago
let
  pkgs = import <nixpkgs> {};
  inherit (pkgs) mkShell rstudioWrapper rPackages;

  myR = selector: rstudioWrapper.override { packages = selector rPackages; };
  rStuff = myR (p: with p; [
    RMariaDB
    DBI
    ]);
in
  mkShell {
    name = "woo-science";
    buildInputs = [
      rStuff
      ];
    }
$ nix-shell r.nix
these derivations will be built:
  /nix/store/apb31splragc1whl41vn8d9q9i12d63z-r-RMariaDB-1.0.6.drv
  /nix/store/xl7ws8sis4hdwmlqcsyhnybbgspwfc2r-RStudio-1.1.463-wrapper.drv
building '/nix/store/apb31splragc1whl41vn8d9q9i12d63z-r-RMariaDB-1.0.6.drv'...
unpacking sources
unpacking source archive /nix/store/17z2bvq52d8vif9n13rbjydbq22n7ii4-RMariaDB_1.0.6.tar.gz
source root is RMariaDB
setting SOURCE_DATE_EPOCH to timestamp 1525638089 of file RMariaDB/MD5
patching sources
configuring
building
running tests
installing
* installing *source* package 'RMariaDB' ...
** package 'RMariaDB' successfully unpacked and MD5 sums checked
sh: ./configure: not found
Warning in system(cmd) : error in running command
ERROR: configuration failed for package 'RMariaDB'
* removing '/nix/store/vm6rsq19idm4v0zwsplb2j7mdsqicp8n-r-RMariaDB-1.0.6/library/RMariaDB'
builder for '/nix/store/apb31splragc1whl41vn8d9q9i12d63z-r-RMariaDB-1.0.6.drv' failed with exit code 1
cannot build derivation '/nix/store/xl7ws8sis4hdwmlqcsyhnybbgspwfc2r-RStudio-1.1.463-wrapper.drv': 1 dependencies couldn't be built
error: build of '/nix/store/xl7ws8sis4hdwmlqcsyhnybbgspwfc2r-RStudio-1.1.463-wrapper.drv' failed
mm-- commented 4 years ago

I had this issue as well on lib.version "19.09.976.c75de8bc12c". I wasn't able to build either RMySQL or RMariaDB. In the latter case, it looks like RMariaDB needs to have patchShebangs configure in its preConfigure stage. It also seemed to me that it wasn't getting the correct libraries passed to it.

You can fix it with an overlay like this:

self: super:
{
  rPackages = (super.rPackages or {}) // {
    RMariaDB = super.rPackages.RMariaDB.overrideDerivation (attrs: {
      nativeBuildInputs = [ self.mariadb.connector-c.dev ] ++ attrs.nativeBuildInputs;
      preConfigure = "patchShebangs configure";
    });
    RMySQL = super.rPackages.RMySQL.overrideDerivation (attrs: {
      nativeBuildInputs = [ self.mysql.connector-c.dev ] ++ attrs.nativeBuildInputs;
    });
  };
}
stale[bot] commented 4 years ago

Thank you for your contributions. This has been automatically marked as stale because it has had no activity for 180 days. If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity. Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse. 3. Ask on the #nixos channel on irc.freenode.net.
simeoncarstens commented 3 years ago

In the meantime (20.09 at least), you have to use self.mariadb-connector-c.dev instead of self.mariadb.connector-c.dev.

stale[bot] commented 2 years ago

I marked this as stale due to inactivity. → More info

mm-- commented 2 years ago

RMariaDB probably still fails to build, as there's no fix in r-modules/default.nix. I just need to port my fix from 19.09 to master.

sir4ur0n commented 2 years ago

For the record on recent Nixpkgs versions, RMariaDB package correctly builds. I think we can close this issue now.