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.
This commit is contained in:
Burke Libbey
2026-01-06 11:37:34 -05:00
parent 18b894e797
commit 419ae375fb
@@ -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"
]
# on darwin, we have /usr/include/tk.h -- so the configure script detects
# that tk is installed
++ 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"