pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lang/ruby32-base on Darwin, rbconfig.rb



I was having trouble getting the "nokogiri" gem to install with native extensions on Darwin (MacOS Ventura). You can see that whole story here:

 https://github.com/sparklemotion/nokogiri/issues/2932

The problem is that there were some flags in rbconfig.rb that cause trouble for nokgiri and other gems, at least when installed with "bundler".

Here's the diff (from the binary package vs. my updated environment):

--- lib/ruby/3.2.0/x86_64-darwin22/rbconfig.rb	2023-07-11 00:10:43
+++ lib/ruby/3.2.0/x86_64-darwin22/rbconfig.rb	2023-07-17 15:35:09
@@ -97,7 +97,7 @@
   CONFIG["EXTDLDFLAGS"] = "$(LIBRUBYARG_SHARED)"
   CONFIG["EXTLDFLAGS"] = ""
   CONFIG["strict_warnflags"] = ""
- CONFIG["warnflags"] = "-Wall -Wextra -Wextra-tokens -Wdeprecated-declarations -Wdivision-by-zero -Wdiv-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -diag-disable=175,188,1684,2259,2312 -Wundef" + CONFIG["warnflags"] = "-Wall -Wextra -Wextra-tokens -Wdeprecated-declarations -Wdivision-by-zero -Wdiv-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wundef"
   CONFIG["debugflags"] = "-ggdb3"
   CONFIG["optflags"] = "-O3 -fno-fast-math"
   CONFIG["NULLCMD"] = ":"
@@ -181,7 +181,7 @@
   CONFIG["CXXFLAGS"] = "-O2 -I/opt/pkg/include -D_REENTRANT -fdeclspec"
   CONFIG["OBJEXT"] = "o"
CONFIG["CPPFLAGS"] = "-I/opt/pkg/include -D_REENTRANT -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT $(DEFS) $(cppflags)"
-  CONFIG["LDFLAGS"] = "-L. -L/usr/lib -L/opt/pkg/lib -Wl,--no-as-needed"
+  CONFIG["LDFLAGS"] = "-L. -L/usr/lib -L/opt/pkg/lib"
CONFIG["CFLAGS"] = "-O2 -I/opt/pkg/include -D_REENTRANT $(cflags) -fno-common -pipe"
   CONFIG["STRIP"] = "llvm-strip -S -x"
   CONFIG["RANLIB"] = "llvm-ranlib"



I'm not sure why we have that -diag-disable flag in the "warnflags". This is not there in the NetBSD ruby32 package, and I'm not sure where it came from but its in the Darwin package and breaks things.

The other flag was the "-Wl,--no-as-needed" seems to be present and ok with NetBSD, but the MacOS linker doesn't like it.

Removing these from rbconfig.rb allows the gems to build their extensions without issue.

I can't find any reference to these flags in the pkgsrc source nor in the mk files, so I don't know where they're being pulled in from to be able to patch them. Is this coming from upstream?


--
Louis


Home | Main Index | Thread Index | Old Index