Unverified Commit 419ae375 authored by Burke Libbey's avatar Burke Libbey
Browse files

ruby: remove --with-setjmp-type=setjmp on Darwin

The --with-setjmp-type=setjmp configure flag was added in 2014 to work
around a hang during "generating encdb.h" on macOS 10.10 (Yosemite).

This flag forces Ruby to use setjmp/longjmp instead of the default
_setjmp/_longjmp, which causes a 5.5x slowdown in proc and block calls
on modern macOS due to unnecessary signal mask save/restore operations.

macOS 10.10 Yosemite reached end of life in 2017 and is far below the
minimum macOS version supported by nixpkgs (currently 10.14 I think?).
The underlying issue was specific to that OS version and does not affect
any supported macOS release.

I am however not 100% sure which release this incompatibility _stopped_
with. It certainly works on Tahoe.
parent 18b894e7
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -237,13 +237,9 @@ let
          ++ lib.optional stdenv.cc.isGNU "CFLAGS=-O3"
          ++ [
          ]
          ++ ops stdenv.hostPlatform.isDarwin [
          # on darwin, we have /usr/include/tk.h -- so the configure script detects
          # that tk is installed
            "--with-out-ext=tk"
            # on yosemite, "generating encdb.h" will hang for a very long time without this flag
            "--with-setjmp-type=setjmp"
          ]
          ++ lib.optional stdenv.hostPlatform.isDarwin "--with-out-ext=tk"
          ++ ops stdenv.hostPlatform.isFreeBSD [
            "rb_cv_gnu_qsort_r=no"
            "rb_cv_bsd_qsort_r=yes"