compile failure on 2.6+
dunn opened this issue · comments
Using this shell.nix
, I can successfully build Ruby 2.5.x, but not 2.6.x or 2.7.x:
with import <nixpkgs> {};
let
nixpkgsRubySource = fetchFromGitHub {
owner = "bobvanderlinden";
repo = "nixpkgs-ruby";
rev = "f08653ec386876cf4942018b08301636b8e7e4f9";
sha256 = "0xa9d1rr36xxci19sh4g0y39vjidil375lylip6b0532ms7b88vx";
};
in
rec {
nixpkgsRuby = import nixpkgsRubySource { inherit pkgs; };
rubyVersion = nixpkgsRuby.mkDerivationForRubyVersion;
rubyEnv = stdenv.mkDerivation {
name = "rubyEnv";
buildInputs = [ (rubyVersion ["2" "6" "2"]) ];
installPhase = ''
ruby --version > $out
'';
};
}
The error happens when it tries to build rubygems:
building '/nix/store/yvxmsrmnzw290p3b03np77z0gc06q09a-ruby-2.7.1.drv'...
unpacking sources
unpacking source archive /nix/store/sdaw5qm7g6zw3k1yd1bry4yvri4hc11s-ruby-2.7.1.tar.gz
unpacking source archive /nix/store/dskr74y0rr39jxxz51hwggdk1laa8psw-rubygems-2.7.6.tgz
source root is ruby-2.7.1
/build/ruby-2.7.1/rubygems /build
patching file lib/rubygems/dependency_installer.rb
Hunk #1 succeeded at 17 (offset 1 line).
patching file lib/rubygems/installer.rb
Hunk #1 succeeded at 791 (offset 27 lines).
patching file lib/rubygems/path_support.rb
/build
setting SOURCE_DATE_EPOCH to timestamp 1585651497 of file ruby-2.7.1/warning.rbinc
patching sources
sed: can't read configure.in: No such file or directory
builder for '/nix/store/yvxmsrmnzw290p3b03np77z0gc06q09a-ruby-2.7.1.drv' failed with exit code 2
error: build of '/nix/store/yvxmsrmnzw290p3b03np77z0gc06q09a-ruby-2.7.1.drv' failed
(full logs for 2.7.1: https://gist.github.com/dunn/a6efdadc2d92de4ea7dedbbe51760cc4)
When I set the version to 2.5.8, the automake step succeeds:
source root is ruby-2.5.8
/build/ruby-2.5.8/rubygems /build
patching file lib/rubygems/dependency_installer.rb
Hunk #1 succeeded at 17 (offset 1 line).
patching file lib/rubygems/installer.rb
Hunk #1 succeeded at 791 (offset 27 lines).
patching file lib/rubygems/path_support.rb
/build
setting SOURCE_DATE_EPOCH to timestamp 1585656958 of file ruby-2.5.8/vmtc.inc
patching sources
autoreconfPhase
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not using Libtool
autoreconf: running: /nix/store/f85bcv4kdmknxwpi175vnfmrr0f4xvgs-autoconf-2.69/bin/autoconf --force
autoreconf: configure.ac: not using Autoheader
autoreconf: configure.ac: not using Automake
autoreconf: Leaving directory `.'
[...]
Since #23, all Ruby versions are now build and tested by CI. This includes 2.5.0
, 2.6.x
and 2.7.x
. The builds that are failing are explicitly marked as broken now. You can see these versions here:
nixpkgs-ruby/ruby/overrides.nix
Lines 10 to 23 in 12d991d
There might be various reasons why the build broke. I haven't looked too deeply into the cause of the build failure of these versions, but it makes sense to only look into it if anyone actually needs such a version.
Does this work for you?
I'm not currently using Nix, so unfortunately I can't test a fix.
I think this is resolved. I was able to build and run 2.6.2 using:
$ nix run .#'"ruby-2.6.2"' -- -e 'puts RUBY_VERSION'
2.6.2