Skip to content

Commit

Permalink
ext: revert hacks for GNU/Musl compatibility (#3384)
Browse files Browse the repository at this point in the history
**What problem is this PR intended to solve?**

Over time, we've accumulated a couple of hacks specifically aimed at
improving the compatibility of the `-linux` native gem on Musl systems.

With #3375 we're building separate `-linux-gnu` and `-linux-musl` gems,
so these hacks should no longer be needed. Let's remove them.


**Have you included adequate test coverage?**

We're testing on a matrix that includes Musl systems, so existing
coverage should be adequate.


**Does this change affect the behavior of either the C or the Java
implementations?**

N/A
  • Loading branch information
flavorjones authored Dec 16, 2024
2 parents e9a6291 + 74b1b98 commit 6b81ce1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ext/nokogiri/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ def configure
# The libiconv configure script doesn't accept "arm64" host string but "aarch64"
recipe.host = recipe.host.gsub("arm64-apple-darwin", "aarch64-apple-darwin")

cflags = concat_flags(ENV["CFLAGS"], "-O2", "-U_FORTIFY_SOURCE", "-g")
cflags = concat_flags(ENV["CFLAGS"], "-O2", "-g")

recipe.configure_options += [
"--disable-dependency-tracking",
Expand Down Expand Up @@ -911,7 +911,7 @@ def configure
end

cppflags = concat_flags(ENV["CPPFLAGS"])
cflags = concat_flags(ENV["CFLAGS"], "-O2", "-U_FORTIFY_SOURCE", "-g")
cflags = concat_flags(ENV["CFLAGS"], "-O2", "-g")

if cross_build_p
cppflags = concat_flags(cppflags, "-DNOKOGIRI_PRECOMPILED_LIBRARIES")
Expand Down Expand Up @@ -952,7 +952,6 @@ def configure
"--with-c14n",
"--with-debug",
"--with-threads",
"--without-tls", # see https://github.com/sparklemotion/nokogiri/issues/3031
"CPPFLAGS=#{cppflags}",
"CFLAGS=#{cflags}",
]
Expand All @@ -971,7 +970,7 @@ def configure
recipe.patch_files = Dir[File.join(PACKAGE_ROOT_DIR, "patches", "libxslt", "*.patch")].sort
end

cflags = concat_flags(ENV["CFLAGS"], "-O2", "-U_FORTIFY_SOURCE", "-g")
cflags = concat_flags(ENV["CFLAGS"], "-O2", "-g")

if darwin? && !cross_build_p
recipe.configure_options << "RANLIB=/usr/bin/ranlib" unless ENV.key?("RANLIB")
Expand Down

0 comments on commit 6b81ce1

Please sign in to comment.