Closed ivanbrennan closed 6 years ago
Trying to reproduce, I got a different issue:
$ nix-shell -I nixpkgs=/home/ryantm/p/nixpkgs -p pkgs.rPackages.RPostgres
these derivations will be built:
/nix/store/9f9s3shhccfwq02k0splzwmf4awzrs8i-r-RPostgres-1.0-4.drv
building '/nix/store/9f9s3shhccfwq02k0splzwmf4awzrs8i-r-RPostgres-1.0-4.drv'...
unpacking sources
unpacking source archive /nix/store/i0i46w7nvbvyxm7kpiacrfqwnp863j3y-RPostgres_1.0-4.tar.gz
source root is RPostgres
setting SOURCE_DATE_EPOCH to timestamp 1513785056 of file RPostgres/MD5
patching sources
configuring
building
running tests
installing
* installing *source* package 'RPostgres' ...
** package 'RPostgres' successfully unpacked and MD5 sums checked
sh: ./configure: /bin/bash: bad interpreter: No such file or directory
ERROR: configuration failed for package 'RPostgres'
* removing '/nix/store/1kcb2fipcp2jsdlj4wbk9p99ddv5r2rg-r-RPostgres-1.0-4/library/RPostgres'
builder for '/nix/store/9f9s3shhccfwq02k0splzwmf4awzrs8i-r-RPostgres-1.0-4.drv' failed with exit code 1
error: build of '/nix/store/9f9s3shhccfwq02k0splzwmf4awzrs8i-r-RPostgres-1.0-4.drv' failed
cc @peti
I made a PR to fix it. It builds after this PR. I don't really know how to test it.
Thanks @ryantm I'm not sure why we ran into different errors, but I was able to successfully build using your fix.
@ivanbrennan you were probably building on a system where /bin/bash exists
@ryantm You're exactly right. I was on an Ubuntu system.
@ryantm I am running into the issue that the merge was supposed to fix. I see that it patches 'configure' and then it complains that the MD5 checksum for 'configure' failed.
building '/nix/store/qkd83fp2b0jw9ba0d73a6p43wkcncyhl-r-RPostgres-1.2.1.drv'...
unpacking sources
unpacking source archive /nix/store/9wz0mzci8l3yhdb9yrd6hz0hpy7gaqwb-RPostgres_1.2.1.tar.gz
source root is RPostgres
setting SOURCE_DATE_EPOCH to timestamp 1601291402 of file RPostgres/MD5
patching sources
configuring
patching script interpreter paths in configure
configure: interpreter directive changed from "#!/bin/sh" to "/nix/store/xvvgw9sb8wk6d2c0j3ybn7sll67s3s4z-bash-4.4-p23/bin/sh"
building
running tests
installing
* installing *source* package 'RPostgres' ...
file 'configure' has the wrong MD5 checksum
** using staged installation
./configure: line 2: /bin/bash: No such file or directory
Warning in system(cmd) : error in running command
ERROR: configuration failed for package 'RPostgres'
* removing '/nix/store/6xmpxxnl030wqbp0glvvd5ar8gv8zh7f-r-RPostgres-1.2.1/library/RPostgres'
builder for '/nix/store/qkd83fp2b0jw9ba0d73a6p43wkcncyhl-r-RPostgres-1.2.1.drv' failed with exit code 1
error: build of '/nix/store/qkd83fp2b0jw9ba0d73a6p43wkcncyhl-r-RPostgres-1.2.1.drv' failed
@logantalley Could you please say what command you are running and provide information about the system running it (OS, version of nix, etc.)?
@ryantm Yes, my apologies. Running on NixOS 21.05. The command I used was:
nix-shell r-test.nix
r-test.nix contains the following:
with import <nixpkgs> {};
pkgs.mkShell {
buildInputs = with pkgs; [
R
rPackages.glue
rPackages.RPostgres
];
}
@logantalley I cannot reproduce this. I took the latest master commit and ran this and it worked:
$ nix --version
nix (Nix) 2.4pre20210601_5985b8b
$ NIX_PATH=nixpkgs=https://github.com/nixos/nixpkgs/archive/c87557a817a.tar.gz nix-shell r-test.nix
Output of nix --version for me is:
nix (Nix) 2.3.15
Edit: OK I ran the exact command that you did at the end there, and it does work. So it looks like the fix does not apply for nix v2.3.15, but will work for 2.4+ at least, and maybe some versions between 2.3.15 and 2.4
So the latest stable version of nix is 2.3.15. So this package doesn't work on stable, you have to specify a newer version, right? What happens if you try using the stable version of nix?
I just did a sudo nix-channel --update
and a sudo nixos-rebuild switch
and I still can't build RPostgres on stable.
Yeah, I don't think it has to do with the version of nix. I can reproduce your error with the latest version of release-21.05.
NIX_PATH=nixpkgs=https://github.com/nixos/nixpkgs/archive/ad6e733d633802620b5eec9be91e837973eac18a.tar.gz nix-shell testr.nix
Ah I see. OK so this a NixOS issue, not a nixpkgs issue. Thank you very much for your help.
This can be simplified to:
nix-build https://github.com/nixos/nixpkgs/archive/ad6e733d633802620b5eec9be91e837973eac18a.tar.gz -A rPackages.RPostgres
fails and
nix-build https://github.com/nixos/nixpkgs/archive/master.tar.gz -A rPackages.RPostgres
works
I'm asking on Matrix if people have a suggestion for what happend.
Issue description
The compilation of RPostgres rPackage fails.
Steps to reproduce
Create a
shell.nix
:and run
nix-shell
.Result:
I tried adding
postgresql.lib
,pkg-config
, andlibpqxx
(only because I didn't find alibpq
package) to the buildInputs (individually and in combination), but none made any difference.Technical details
"x86_64-linux"
Linux 4.15.0-33-generic, Ubuntu, 18.04.1 LTS (Bionic Beaver)
no
no
nix-env (Nix) 2.0
"nixos-18.09pre143771.a8c71037e04, nixpkgs-18.09pre145919.adbd3ead271"
/home/ivan/.nix-defexpr/channels/nixpkgs