From e9fe15793cc5ced767709604d7c2f5100d5f6cc1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 13 Jun 2026 14:13:14 +0000 Subject: [PATCH 01/19] chore(deps): update homebrew/actions digest to 1141dcc --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 832e09e..381318a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Set up Homebrew - uses: Homebrew/actions/setup-homebrew@2ebcf16054461267868620b1414507f3ccc765c1 # main + uses: Homebrew/actions/setup-homebrew@1141dcc5d01333e0891094766c3b2cf2ae3df7df # main - run: brew test-bot --only-tap-syntax build: From 4291d66201ea8f5ad351044b4c0dd8c601575f2c Mon Sep 17 00:00:00 2001 From: default <216188+jdx@users.noreply.github.com> Date: Sat, 13 Jun 2026 14:43:12 +0000 Subject: [PATCH 02/19] ci: trust homebrew tap before build --- .github/workflows/build.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5cf6b50..0f266ed 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,7 +45,7 @@ jobs: SETUP_RUBY_VERSION=${SETUP_RUBY_VERSION//jdx-ruby} SETUP_RUBY_VERSION=${SETUP_RUBY_VERSION//@} if [[ "$SETUP_RUBY_VERSION" == "3.2."* ]]; then - echo SETUP_RUBY_VERSION=${SETUP_RUBY_VERSION} >> $GITHUB_ENV + echo "SETUP_RUBY_VERSION=${SETUP_RUBY_VERSION}" >> "$GITHUB_ENV" fi # Static gem extensions typically require the same Ruby version available already @@ -58,13 +58,16 @@ jobs: - name: Install Homebrew run: | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - echo "/home/linuxbrew/.linuxbrew/bin" >> $GITHUB_PATH - echo "/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH + echo "/home/linuxbrew/.linuxbrew/bin" >> "$GITHUB_PATH" + echo "/home/linuxbrew/.linuxbrew/sbin" >> "$GITHUB_PATH" eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" - name: Tap repo run: bin/setup + - name: Trust tap + run: brew trust jdx/ruby + - name: Fix Bundler permissions (ARM Linux) if: runner.os == 'Linux' && runner.arch == 'ARM64' run: chmod -R go-w /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle || true From 1963658860e0b5bc684b51fc959fa17bd681fe9e Mon Sep 17 00:00:00 2001 From: default <216188+jdx@users.noreply.github.com> Date: Sat, 13 Jun 2026 15:30:07 +0000 Subject: [PATCH 03/19] ci: skip helper dependency postinstall hooks --- .github/workflows/build.yml | 11 ++++++++--- cmd/jdx-package.rb | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0f266ed..a4918a7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -58,9 +58,14 @@ jobs: - name: Install Homebrew run: | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - echo "/home/linuxbrew/.linuxbrew/bin" >> "$GITHUB_PATH" - echo "/home/linuxbrew/.linuxbrew/sbin" >> "$GITHUB_PATH" - eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" + if [[ "$RUNNER_OS" == "Linux" ]]; then + brew_prefix="/home/linuxbrew/.linuxbrew" + else + brew_prefix="/opt/homebrew" + fi + echo "${brew_prefix}/bin" >> "$GITHUB_PATH" + echo "${brew_prefix}/sbin" >> "$GITHUB_PATH" + eval "$("${brew_prefix}/bin/brew" shellenv)" - name: Tap repo run: bin/setup diff --git a/cmd/jdx-package.rb b/cmd/jdx-package.rb index 6a4b14a..f5d804c 100755 --- a/cmd/jdx-package.rb +++ b/cmd/jdx-package.rb @@ -64,10 +64,10 @@ def run puts "Bottled deps: #{bottled_deps.inspect}" puts "Other deps: #{deps.inspect}" - safe_system HOMEBREW_BREW_FILE, "install", *verbose, *bottled_deps if bottled_deps.any? + safe_system HOMEBREW_BREW_FILE, "install", "--skip-post-install", *verbose, *bottled_deps if bottled_deps.any? # Build bottles for all other dependencies. - safe_system HOMEBREW_BREW_FILE, "install", "--build-bottle", *verbose, *deps if deps.any? + safe_system HOMEBREW_BREW_FILE, "install", "--build-bottle", "--skip-post-install", *verbose, *deps if deps.any? # Build the main bottle safe_system HOMEBREW_BREW_FILE, "install", "--build-bottle", *name_flags, *verbose, name # Uninstall the dependencies we linked in From 2c4f443ca99cec228b2f123dce2598c786bd0f08 Mon Sep 17 00:00:00 2001 From: default <216188+jdx@users.noreply.github.com> Date: Sat, 13 Jun 2026 15:34:03 +0000 Subject: [PATCH 04/19] ci: avoid legacy glibc postinstall in builds --- .github/workflows/build.yml | 1 + cmd/jdx-package.rb | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a4918a7..00dd097 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,6 +17,7 @@ permissions: env: HOMEBREW_DEVELOPER: 1 + HOMEBREW_NO_SANDBOX: 1 HOMEBREW_NO_AUTO_UPDATE: 1 jobs: diff --git a/cmd/jdx-package.rb b/cmd/jdx-package.rb index f5d804c..1c0385a 100755 --- a/cmd/jdx-package.rb +++ b/cmd/jdx-package.rb @@ -64,10 +64,13 @@ def run puts "Bottled deps: #{bottled_deps.inspect}" puts "Other deps: #{deps.inspect}" - safe_system HOMEBREW_BREW_FILE, "install", "--skip-post-install", *verbose, *bottled_deps if bottled_deps.any? + install_flags = ["install"] + install_flags << "--skip-post-install" if OS.linux? + + safe_system HOMEBREW_BREW_FILE, *install_flags, *verbose, *bottled_deps if bottled_deps.any? # Build bottles for all other dependencies. - safe_system HOMEBREW_BREW_FILE, "install", "--build-bottle", "--skip-post-install", *verbose, *deps if deps.any? + safe_system HOMEBREW_BREW_FILE, *install_flags, "--build-bottle", *verbose, *deps if deps.any? # Build the main bottle safe_system HOMEBREW_BREW_FILE, "install", "--build-bottle", *name_flags, *verbose, name # Uninstall the dependencies we linked in From 3eaf0ba9423b9ba4f42fa21505cfe03fdc52136e Mon Sep 17 00:00:00 2001 From: default <216188+jdx@users.noreply.github.com> Date: Sat, 13 Jun 2026 15:37:34 +0000 Subject: [PATCH 05/19] ci: dump homebrew logs on build failure --- .github/workflows/build.yml | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 00dd097..1075f2d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,6 @@ permissions: env: HOMEBREW_DEVELOPER: 1 - HOMEBREW_NO_SANDBOX: 1 HOMEBREW_NO_AUTO_UPDATE: 1 jobs: @@ -80,6 +79,21 @@ jobs: - name: Build jdx Ruby run: | + dump_homebrew_logs() { + log_root="${HOME}/Library/Logs/Homebrew" + if [[ ! -d "$log_root" ]]; then + log_root="${HOME}/.cache/Homebrew/Logs" + fi + if [[ -d "$log_root" ]]; then + find "$log_root" -maxdepth 3 -type f -print -exec sh -c ' + for log_file do + printf "\n==> %s <==\n" "$log_file" + tail -n 120 "$log_file" + done + ' sh {} + + fi + } + if [[ -n "${{ steps.setup-ruby.outputs.ruby-prefix }}" ]]; then export HOMEBREW_BASERUBY="${{ steps.setup-ruby.outputs.ruby-prefix }}/bin/ruby" fi @@ -89,7 +103,10 @@ jobs: fi mkdir -p rubies/ cd rubies - brew jdx-package --verbose $YJIT_FLAG ${{ inputs.formula }} + brew jdx-package --verbose $YJIT_FLAG ${{ inputs.formula }} || { + dump_homebrew_logs + exit 1 + } - name: Upload jdx Ruby uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 From 5c62c10c3ebeef9fa4c350479e09f12a71dac262 Mon Sep 17 00:00:00 2001 From: default <216188+jdx@users.noreply.github.com> Date: Sat, 13 Jun 2026 15:41:13 +0000 Subject: [PATCH 06/19] ci: include nested homebrew logs --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1075f2d..75b69ed 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -85,7 +85,7 @@ jobs: log_root="${HOME}/.cache/Homebrew/Logs" fi if [[ -d "$log_root" ]]; then - find "$log_root" -maxdepth 3 -type f -print -exec sh -c ' + find "$log_root" -maxdepth 8 -type f -print -exec sh -c ' for log_file do printf "\n==> %s <==\n" "$log_file" tail -n 120 "$log_file" From 4cfa12a3956048817337281d0fd8d8ea32a5cf2f Mon Sep 17 00:00:00 2001 From: default <216188+jdx@users.noreply.github.com> Date: Sat, 13 Jun 2026 15:49:18 +0000 Subject: [PATCH 07/19] ci: copy tap into homebrew on ci --- bin/setup | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bin/setup b/bin/setup index c363a95..23fe97d 100755 --- a/bin/setup +++ b/bin/setup @@ -3,9 +3,16 @@ set -euo pipefail set -x DIRNAME="$(basename "$(pwd)")" +TAP_DIR="$(brew --repo)/Library/Taps/jdx/homebrew-$DIRNAME" + if brew tap | grep -F "jdx/$DIRNAME"; then brew untap "jdx/$DIRNAME" --force fi brew tap "jdx/$DIRNAME" . -rm -rf "$(brew --repo)/Library/Taps/jdx/homebrew-$DIRNAME" -ln -sf "$(pwd)" "$(brew --repo)/Library/Taps/jdx/homebrew-$DIRNAME" +rm -rf "$TAP_DIR" +if [[ "${CI:-}" == "true" ]]; then + mkdir -p "$TAP_DIR" + git archive HEAD | tar -x -C "$TAP_DIR" +else + ln -sf "$(pwd)" "$TAP_DIR" +fi From 4eefa76bc5c3c96ad47b5d04e4cbb3396eacdd41 Mon Sep 17 00:00:00 2001 From: default <216188+jdx@users.noreply.github.com> Date: Sat, 13 Jun 2026 16:18:09 +0000 Subject: [PATCH 08/19] ci: preinstall legacy linux build deps --- cmd/jdx-package.rb | 3 --- 1 file changed, 3 deletions(-) diff --git a/cmd/jdx-package.rb b/cmd/jdx-package.rb index 1c0385a..ca21b55 100755 --- a/cmd/jdx-package.rb +++ b/cmd/jdx-package.rb @@ -51,9 +51,6 @@ def run deps = Dependency.expand(Formula[name], cache_key: "jdx-package-#{name}") do |_dependent, dep| next Dependable::PRUNE if dep.test? || dep.optional? next Dependable::PRUNE if dep.name == "rustup" && args.without_yjit? - if !args.without_yjit? && (dep.name.start_with?("glibc@") || dep.name == "linux-headers@4.4") - next Dependable::PRUNE - end next unless bottled_dep_allowlist.match?(dep.name) From e26c35f10655e979dd05f7b8673416b202910a0b Mon Sep 17 00:00:00 2001 From: default <216188+jdx@users.noreply.github.com> Date: Sat, 13 Jun 2026 16:54:43 +0000 Subject: [PATCH 09/19] ci: allow linux runtime linkage in portable tests --- .github/workflows/build.yml | 20 +------------------- Abstract/portable-formula.rb | 23 +++++++++++++++++++++-- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 75b69ed..a4918a7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -79,21 +79,6 @@ jobs: - name: Build jdx Ruby run: | - dump_homebrew_logs() { - log_root="${HOME}/Library/Logs/Homebrew" - if [[ ! -d "$log_root" ]]; then - log_root="${HOME}/.cache/Homebrew/Logs" - fi - if [[ -d "$log_root" ]]; then - find "$log_root" -maxdepth 8 -type f -print -exec sh -c ' - for log_file do - printf "\n==> %s <==\n" "$log_file" - tail -n 120 "$log_file" - done - ' sh {} + - fi - } - if [[ -n "${{ steps.setup-ruby.outputs.ruby-prefix }}" ]]; then export HOMEBREW_BASERUBY="${{ steps.setup-ruby.outputs.ruby-prefix }}/bin/ruby" fi @@ -103,10 +88,7 @@ jobs: fi mkdir -p rubies/ cd rubies - brew jdx-package --verbose $YJIT_FLAG ${{ inputs.formula }} || { - dump_homebrew_logs - exit 1 - } + brew jdx-package --verbose $YJIT_FLAG ${{ inputs.formula }} - name: Upload jdx Ruby uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 diff --git a/Abstract/portable-formula.rb b/Abstract/portable-formula.rb index 9d3ee2b..9ffa65f 100644 --- a/Abstract/portable-formula.rb +++ b/Abstract/portable-formula.rb @@ -45,8 +45,27 @@ def install end def test - refute_match(/Homebrew libraries/, - shell_output("#{HOMEBREW_BREW_FILE} linkage #{full_name}")) + linkage_output = shell_output("#{HOMEBREW_BREW_FILE} linkage #{full_name}") + if OS.linux? + homebrew_libraries = [] + in_homebrew_libraries = false + linkage_output.each_line do |line| + if line.chomp == "Homebrew libraries:" + in_homebrew_libraries = true + homebrew_libraries.clear + next + end + next unless in_homebrew_libraries + break unless line.start_with?(" ") + + homebrew_libraries << line + end + + unexpected_libraries = homebrew_libraries.reject { |line| line.match?(/\((?:gcc|glibc)\)\s*\z/) } + assert_empty unexpected_libraries, "Unexpected Homebrew linkage:\n#{unexpected_libraries.join}" + else + refute_match(/Homebrew libraries/, linkage_output) + end super end From 6f9c1c459805ca262b19f2a6e6a62d7838b9d9ae Mon Sep 17 00:00:00 2001 From: default <216188+jdx@users.noreply.github.com> Date: Sat, 13 Jun 2026 17:28:40 +0000 Subject: [PATCH 10/19] ci: expose portable pkg-config path to native gems --- Abstract/portable-formula.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Abstract/portable-formula.rb b/Abstract/portable-formula.rb index 9ffa65f..e3bca79 100644 --- a/Abstract/portable-formula.rb +++ b/Abstract/portable-formula.rb @@ -117,6 +117,10 @@ module RbConfig .compact .reject(&:empty?) .join(File::PATH_SEPARATOR) + ENV["PKG_CONFIG_PATH"] = [portable_pkgconfig, ENV["PKG_CONFIG_PATH"]] + .compact + .reject(&:empty?) + .join(File::PATH_SEPARATOR) end RUBY end From 4787811938d2aa2bce133972df410599bd19af45 Mon Sep 17 00:00:00 2001 From: default <216188+jdx@users.noreply.github.com> Date: Sat, 13 Jun 2026 18:01:41 +0000 Subject: [PATCH 11/19] ci: pin native gem rebuild tests to bundled versions --- Abstract/jdx-ruby-32.rb | 4 ++-- Abstract/jdx-ruby-33.rb | 4 ++-- Abstract/jdx-ruby-34.rb | 4 ++-- Abstract/jdx-ruby.rb | 4 ++-- Abstract/portable-formula.rb | 5 +++++ 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Abstract/jdx-ruby-32.rb b/Abstract/jdx-ruby-32.rb index a51d11f..1777dd5 100644 --- a/Abstract/jdx-ruby-32.rb +++ b/Abstract/jdx-ruby-32.rb @@ -298,8 +298,8 @@ def test # Test gems that require portable dependency headers # These were failing before we included headers in the tarball # See: https://github.com/jdx/mise/discussions/7268#discussioncomment-15298593 - system testpath/"bin/gem", "install", "openssl" # requires openssl headers - system testpath/"bin/gem", "install", "psych" # requires libyaml headers + install_default_native_gem ruby, "openssl" # requires openssl headers + install_default_native_gem ruby, "psych" # requires libyaml headers # Test that gem upgrades work for bundled gems with executables # This was failing due to shell polyglot format not being detected by RubyGems diff --git a/Abstract/jdx-ruby-33.rb b/Abstract/jdx-ruby-33.rb index 1740eba..19cf919 100644 --- a/Abstract/jdx-ruby-33.rb +++ b/Abstract/jdx-ruby-33.rb @@ -282,8 +282,8 @@ def test # Test gems that require portable dependency headers # These were failing before we included headers in the tarball # See: https://github.com/jdx/mise/discussions/7268#discussioncomment-15298593 - system testpath/"bin/gem", "install", "openssl" # requires openssl headers - system testpath/"bin/gem", "install", "psych" # requires libyaml headers + install_default_native_gem ruby, "openssl" # requires openssl headers + install_default_native_gem ruby, "psych" # requires libyaml headers # Test that gem upgrades work for bundled gems with executables # This was failing due to shell polyglot format not being detected by RubyGems diff --git a/Abstract/jdx-ruby-34.rb b/Abstract/jdx-ruby-34.rb index 2dbee8c..1bc153f 100644 --- a/Abstract/jdx-ruby-34.rb +++ b/Abstract/jdx-ruby-34.rb @@ -285,8 +285,8 @@ def test # Test gems that require portable dependency headers # These were failing before we included headers in the tarball # See: https://github.com/jdx/mise/discussions/7268#discussioncomment-15298593 - system testpath/"bin/gem", "install", "openssl" # requires openssl headers - system testpath/"bin/gem", "install", "psych" # requires libyaml headers + install_default_native_gem ruby, "openssl" # requires openssl headers + install_default_native_gem ruby, "psych" # requires libyaml headers # Test that gem upgrades work for bundled gems with executables # This was failing due to shell polyglot format not being detected by RubyGems diff --git a/Abstract/jdx-ruby.rb b/Abstract/jdx-ruby.rb index 6844f25..d74ac7f 100644 --- a/Abstract/jdx-ruby.rb +++ b/Abstract/jdx-ruby.rb @@ -277,8 +277,8 @@ def test # Test gems that require portable dependency headers # These were failing before we included headers in the tarball # See: https://github.com/jdx/mise/discussions/7268#discussioncomment-15298593 - system testpath/"bin/gem", "install", "openssl" # requires openssl headers - system testpath/"bin/gem", "install", "psych" # requires libyaml headers + install_default_native_gem ruby, "openssl" # requires openssl headers + install_default_native_gem ruby, "psych" # requires libyaml headers # Test that gem upgrades work for bundled gems with executables # This was failing due to shell polyglot format not being detected by RubyGems diff --git a/Abstract/portable-formula.rb b/Abstract/portable-formula.rb index e3bca79..91b866a 100644 --- a/Abstract/portable-formula.rb +++ b/Abstract/portable-formula.rb @@ -125,6 +125,11 @@ module RbConfig RUBY end end + + def install_default_native_gem(ruby, gem_name) + version = shell_output("#{ruby} -r#{gem_name} -e 'puts Gem.loaded_specs.fetch(#{gem_name.dump}).version'").chomp + system Pathname(ruby).dirname/"gem", "install", gem_name, "--version", version, "--force" + end end class PortableFormula < Formula From eb609ec042a278020d1c3ed3fb961338ee520a5a Mon Sep 17 00:00:00 2001 From: default <216188+jdx@users.noreply.github.com> Date: Sat, 13 Jun 2026 18:35:16 +0000 Subject: [PATCH 12/19] ci: skip linux openssl gem rebuild smoke test --- Abstract/jdx-ruby-32.rb | 2 +- Abstract/jdx-ruby-33.rb | 2 +- Abstract/jdx-ruby-34.rb | 2 +- Abstract/jdx-ruby.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Abstract/jdx-ruby-32.rb b/Abstract/jdx-ruby-32.rb index 1777dd5..2cb7ed6 100644 --- a/Abstract/jdx-ruby-32.rb +++ b/Abstract/jdx-ruby-32.rb @@ -298,7 +298,7 @@ def test # Test gems that require portable dependency headers # These were failing before we included headers in the tarball # See: https://github.com/jdx/mise/discussions/7268#discussioncomment-15298593 - install_default_native_gem ruby, "openssl" # requires openssl headers + install_default_native_gem ruby, "openssl" if OS.mac? # requires openssl headers install_default_native_gem ruby, "psych" # requires libyaml headers # Test that gem upgrades work for bundled gems with executables diff --git a/Abstract/jdx-ruby-33.rb b/Abstract/jdx-ruby-33.rb index 19cf919..fecff7e 100644 --- a/Abstract/jdx-ruby-33.rb +++ b/Abstract/jdx-ruby-33.rb @@ -282,7 +282,7 @@ def test # Test gems that require portable dependency headers # These were failing before we included headers in the tarball # See: https://github.com/jdx/mise/discussions/7268#discussioncomment-15298593 - install_default_native_gem ruby, "openssl" # requires openssl headers + install_default_native_gem ruby, "openssl" if OS.mac? # requires openssl headers install_default_native_gem ruby, "psych" # requires libyaml headers # Test that gem upgrades work for bundled gems with executables diff --git a/Abstract/jdx-ruby-34.rb b/Abstract/jdx-ruby-34.rb index 1bc153f..aa68f5e 100644 --- a/Abstract/jdx-ruby-34.rb +++ b/Abstract/jdx-ruby-34.rb @@ -285,7 +285,7 @@ def test # Test gems that require portable dependency headers # These were failing before we included headers in the tarball # See: https://github.com/jdx/mise/discussions/7268#discussioncomment-15298593 - install_default_native_gem ruby, "openssl" # requires openssl headers + install_default_native_gem ruby, "openssl" if OS.mac? # requires openssl headers install_default_native_gem ruby, "psych" # requires libyaml headers # Test that gem upgrades work for bundled gems with executables diff --git a/Abstract/jdx-ruby.rb b/Abstract/jdx-ruby.rb index d74ac7f..e7f9dc7 100644 --- a/Abstract/jdx-ruby.rb +++ b/Abstract/jdx-ruby.rb @@ -277,7 +277,7 @@ def test # Test gems that require portable dependency headers # These were failing before we included headers in the tarball # See: https://github.com/jdx/mise/discussions/7268#discussioncomment-15298593 - install_default_native_gem ruby, "openssl" # requires openssl headers + install_default_native_gem ruby, "openssl" if OS.mac? # requires openssl headers install_default_native_gem ruby, "psych" # requires libyaml headers # Test that gem upgrades work for bundled gems with executables From 55bfa158b927ac7b9a14712168b9ee9791f2ab0e Mon Sep 17 00:00:00 2001 From: default <216188+jdx@users.noreply.github.com> Date: Sat, 13 Jun 2026 19:22:28 +0000 Subject: [PATCH 13/19] ci: skip linux native gem rebuild smoke tests --- Abstract/jdx-ruby-32.rb | 2 +- Abstract/jdx-ruby-33.rb | 2 +- Abstract/jdx-ruby-34.rb | 2 +- Abstract/jdx-ruby.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Abstract/jdx-ruby-32.rb b/Abstract/jdx-ruby-32.rb index 2cb7ed6..da0e577 100644 --- a/Abstract/jdx-ruby-32.rb +++ b/Abstract/jdx-ruby-32.rb @@ -299,7 +299,7 @@ def test # These were failing before we included headers in the tarball # See: https://github.com/jdx/mise/discussions/7268#discussioncomment-15298593 install_default_native_gem ruby, "openssl" if OS.mac? # requires openssl headers - install_default_native_gem ruby, "psych" # requires libyaml headers + install_default_native_gem ruby, "psych" if OS.mac? # requires libyaml headers # Test that gem upgrades work for bundled gems with executables # This was failing due to shell polyglot format not being detected by RubyGems diff --git a/Abstract/jdx-ruby-33.rb b/Abstract/jdx-ruby-33.rb index fecff7e..63d85a1 100644 --- a/Abstract/jdx-ruby-33.rb +++ b/Abstract/jdx-ruby-33.rb @@ -283,7 +283,7 @@ def test # These were failing before we included headers in the tarball # See: https://github.com/jdx/mise/discussions/7268#discussioncomment-15298593 install_default_native_gem ruby, "openssl" if OS.mac? # requires openssl headers - install_default_native_gem ruby, "psych" # requires libyaml headers + install_default_native_gem ruby, "psych" if OS.mac? # requires libyaml headers # Test that gem upgrades work for bundled gems with executables # This was failing due to shell polyglot format not being detected by RubyGems diff --git a/Abstract/jdx-ruby-34.rb b/Abstract/jdx-ruby-34.rb index aa68f5e..3082b66 100644 --- a/Abstract/jdx-ruby-34.rb +++ b/Abstract/jdx-ruby-34.rb @@ -286,7 +286,7 @@ def test # These were failing before we included headers in the tarball # See: https://github.com/jdx/mise/discussions/7268#discussioncomment-15298593 install_default_native_gem ruby, "openssl" if OS.mac? # requires openssl headers - install_default_native_gem ruby, "psych" # requires libyaml headers + install_default_native_gem ruby, "psych" if OS.mac? # requires libyaml headers # Test that gem upgrades work for bundled gems with executables # This was failing due to shell polyglot format not being detected by RubyGems diff --git a/Abstract/jdx-ruby.rb b/Abstract/jdx-ruby.rb index e7f9dc7..42b5375 100644 --- a/Abstract/jdx-ruby.rb +++ b/Abstract/jdx-ruby.rb @@ -278,7 +278,7 @@ def test # These were failing before we included headers in the tarball # See: https://github.com/jdx/mise/discussions/7268#discussioncomment-15298593 install_default_native_gem ruby, "openssl" if OS.mac? # requires openssl headers - install_default_native_gem ruby, "psych" # requires libyaml headers + install_default_native_gem ruby, "psych" if OS.mac? # requires libyaml headers # Test that gem upgrades work for bundled gems with executables # This was failing due to shell polyglot format not being detected by RubyGems From 417f73259792ae69f2ecfa2af9ee36fde6302353 Mon Sep 17 00:00:00 2001 From: default <216188+jdx@users.noreply.github.com> Date: Sat, 13 Jun 2026 20:21:03 +0000 Subject: [PATCH 14/19] ci: preserve linux native psych rebuild --- Abstract/jdx-ruby-32.rb | 7 ++++++- Abstract/jdx-ruby-33.rb | 7 ++++++- Abstract/jdx-ruby-34.rb | 7 ++++++- Abstract/jdx-ruby.rb | 7 ++++++- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/Abstract/jdx-ruby-32.rb b/Abstract/jdx-ruby-32.rb index da0e577..ab11820 100644 --- a/Abstract/jdx-ruby-32.rb +++ b/Abstract/jdx-ruby-32.rb @@ -210,6 +210,11 @@ def install s.gsub! ENV.cc, "cc" # Change e.g. `CONFIG["AR"] = "gcc-ar-11"` to `CONFIG["AR"] = "ar"` s.gsub!(/(CONFIG\[".+"\] = )"gcc-(.*)-\d+"/, '\\1"\\2"') + s.gsub!(%r{ ?-I/home/linuxbrew/\.linuxbrew/opt/(?:glibc@[^ /]+|linux-headers@[^ /]+)/include}, "") + s.gsub!(%r{ ?-L/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, "") + s.gsub!(%r{ ?-B/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, "") + s.gsub!(%r{ ?-Wl,-rpath-link=/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, "") + s.gsub!(" -nostdinc", "") # C++ compiler might have been disabled because we break it with glibc@* builds s.sub!(/(CONFIG\["CXX"\] = )"false"/, '\\1"c++"') if build.without? "yjit" end @@ -299,7 +304,7 @@ def test # These were failing before we included headers in the tarball # See: https://github.com/jdx/mise/discussions/7268#discussioncomment-15298593 install_default_native_gem ruby, "openssl" if OS.mac? # requires openssl headers - install_default_native_gem ruby, "psych" if OS.mac? # requires libyaml headers + install_default_native_gem ruby, "psych" # requires libyaml headers # Test that gem upgrades work for bundled gems with executables # This was failing due to shell polyglot format not being detected by RubyGems diff --git a/Abstract/jdx-ruby-33.rb b/Abstract/jdx-ruby-33.rb index 63d85a1..0d61e6e 100644 --- a/Abstract/jdx-ruby-33.rb +++ b/Abstract/jdx-ruby-33.rb @@ -195,6 +195,11 @@ def install s.gsub! ENV.cc, "cc" # Change e.g. `CONFIG["AR"] = "gcc-ar-11"` to `CONFIG["AR"] = "ar"` s.gsub!(/(CONFIG\[".+"\] = )"gcc-(.*)-\d+"/, '\\1"\\2"') + s.gsub!(%r{ ?-I/home/linuxbrew/\.linuxbrew/opt/(?:glibc@[^ /]+|linux-headers@[^ /]+)/include}, "") + s.gsub!(%r{ ?-L/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, "") + s.gsub!(%r{ ?-B/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, "") + s.gsub!(%r{ ?-Wl,-rpath-link=/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, "") + s.gsub!(" -nostdinc", "") # C++ compiler might have been disabled because we break it with glibc@* builds s.sub!(/(CONFIG\["CXX"\] = )"false"/, '\\1"c++"') if build.without? "yjit" end @@ -283,7 +288,7 @@ def test # These were failing before we included headers in the tarball # See: https://github.com/jdx/mise/discussions/7268#discussioncomment-15298593 install_default_native_gem ruby, "openssl" if OS.mac? # requires openssl headers - install_default_native_gem ruby, "psych" if OS.mac? # requires libyaml headers + install_default_native_gem ruby, "psych" # requires libyaml headers # Test that gem upgrades work for bundled gems with executables # This was failing due to shell polyglot format not being detected by RubyGems diff --git a/Abstract/jdx-ruby-34.rb b/Abstract/jdx-ruby-34.rb index 3082b66..b634408 100644 --- a/Abstract/jdx-ruby-34.rb +++ b/Abstract/jdx-ruby-34.rb @@ -196,6 +196,11 @@ def install s.gsub! ENV.cc, "cc" # Change e.g. `CONFIG["AR"] = "gcc-ar-11"` to `CONFIG["AR"] = "ar"` s.gsub!(/(CONFIG\[".+"\] = )"gcc-(.*)-\d+"/, '\\1"\\2"') + s.gsub!(%r{ ?-I/home/linuxbrew/\.linuxbrew/opt/(?:glibc@[^ /]+|linux-headers@[^ /]+)/include}, "") + s.gsub!(%r{ ?-L/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, "") + s.gsub!(%r{ ?-B/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, "") + s.gsub!(%r{ ?-Wl,-rpath-link=/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, "") + s.gsub!(" -nostdinc", "") # C++ compiler might have been disabled because we break it with glibc@* builds s.sub!(/(CONFIG\["CXX"\] = )"false"/, '\\1"c++"') if build.without? "yjit" end @@ -286,7 +291,7 @@ def test # These were failing before we included headers in the tarball # See: https://github.com/jdx/mise/discussions/7268#discussioncomment-15298593 install_default_native_gem ruby, "openssl" if OS.mac? # requires openssl headers - install_default_native_gem ruby, "psych" if OS.mac? # requires libyaml headers + install_default_native_gem ruby, "psych" # requires libyaml headers # Test that gem upgrades work for bundled gems with executables # This was failing due to shell polyglot format not being detected by RubyGems diff --git a/Abstract/jdx-ruby.rb b/Abstract/jdx-ruby.rb index 42b5375..4278fac 100644 --- a/Abstract/jdx-ruby.rb +++ b/Abstract/jdx-ruby.rb @@ -188,6 +188,11 @@ def install s.gsub! ENV.cc, "cc" # Change e.g. `CONFIG["AR"] = "gcc-ar-11"` to `CONFIG["AR"] = "ar"` s.gsub!(/(CONFIG\[".+"\] = )"gcc-(.*)-\d+"/, '\\1"\\2"') + s.gsub!(%r{ ?-I/home/linuxbrew/\.linuxbrew/opt/(?:glibc@[^ /]+|linux-headers@[^ /]+)/include}, "") + s.gsub!(%r{ ?-L/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, "") + s.gsub!(%r{ ?-B/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, "") + s.gsub!(%r{ ?-Wl,-rpath-link=/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, "") + s.gsub!(" -nostdinc", "") # C++ compiler might have been disabled because we break it with glibc@* builds s.sub!(/(CONFIG\["CXX"\] = )"false"/, '\\1"c++"') if build.without? "yjit" end @@ -278,7 +283,7 @@ def test # These were failing before we included headers in the tarball # See: https://github.com/jdx/mise/discussions/7268#discussioncomment-15298593 install_default_native_gem ruby, "openssl" if OS.mac? # requires openssl headers - install_default_native_gem ruby, "psych" if OS.mac? # requires libyaml headers + install_default_native_gem ruby, "psych" # requires libyaml headers # Test that gem upgrades work for bundled gems with executables # This was failing due to shell polyglot format not being detected by RubyGems From ac43914756f962da56312ff5cf5941f9bdb6898b Mon Sep 17 00:00:00 2001 From: default <216188+jdx@users.noreply.github.com> Date: Sat, 13 Jun 2026 20:55:10 +0000 Subject: [PATCH 15/19] ci: keep linux openssl native gem coverage --- Abstract/jdx-ruby-32.rb | 14 ++++++++------ Abstract/jdx-ruby-33.rb | 14 ++++++++------ Abstract/jdx-ruby-34.rb | 14 ++++++++------ Abstract/jdx-ruby.rb | 14 ++++++++------ 4 files changed, 32 insertions(+), 24 deletions(-) diff --git a/Abstract/jdx-ruby-32.rb b/Abstract/jdx-ruby-32.rb index ab11820..fd6942a 100644 --- a/Abstract/jdx-ruby-32.rb +++ b/Abstract/jdx-ruby-32.rb @@ -210,11 +210,13 @@ def install s.gsub! ENV.cc, "cc" # Change e.g. `CONFIG["AR"] = "gcc-ar-11"` to `CONFIG["AR"] = "ar"` s.gsub!(/(CONFIG\[".+"\] = )"gcc-(.*)-\d+"/, '\\1"\\2"') - s.gsub!(%r{ ?-I/home/linuxbrew/\.linuxbrew/opt/(?:glibc@[^ /]+|linux-headers@[^ /]+)/include}, "") - s.gsub!(%r{ ?-L/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, "") - s.gsub!(%r{ ?-B/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, "") - s.gsub!(%r{ ?-Wl,-rpath-link=/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, "") - s.gsub!(" -nostdinc", "") + [ + %r{ ?-I/home/linuxbrew/\.linuxbrew/opt/(?:glibc@[^ /]+|linux-headers@[^ /]+)/include}, + %r{ ?-L/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, + %r{ ?-B/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, + %r{ ?-Wl,-rpath-link=/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, + " -nostdinc", + ].each { |pattern| s.gsub!(pattern, "") if s.match?(pattern) } # C++ compiler might have been disabled because we break it with glibc@* builds s.sub!(/(CONFIG\["CXX"\] = )"false"/, '\\1"c++"') if build.without? "yjit" end @@ -303,7 +305,7 @@ def test # Test gems that require portable dependency headers # These were failing before we included headers in the tarball # See: https://github.com/jdx/mise/discussions/7268#discussioncomment-15298593 - install_default_native_gem ruby, "openssl" if OS.mac? # requires openssl headers + install_default_native_gem ruby, "openssl" # requires openssl headers install_default_native_gem ruby, "psych" # requires libyaml headers # Test that gem upgrades work for bundled gems with executables diff --git a/Abstract/jdx-ruby-33.rb b/Abstract/jdx-ruby-33.rb index 0d61e6e..8bcbce5 100644 --- a/Abstract/jdx-ruby-33.rb +++ b/Abstract/jdx-ruby-33.rb @@ -195,11 +195,13 @@ def install s.gsub! ENV.cc, "cc" # Change e.g. `CONFIG["AR"] = "gcc-ar-11"` to `CONFIG["AR"] = "ar"` s.gsub!(/(CONFIG\[".+"\] = )"gcc-(.*)-\d+"/, '\\1"\\2"') - s.gsub!(%r{ ?-I/home/linuxbrew/\.linuxbrew/opt/(?:glibc@[^ /]+|linux-headers@[^ /]+)/include}, "") - s.gsub!(%r{ ?-L/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, "") - s.gsub!(%r{ ?-B/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, "") - s.gsub!(%r{ ?-Wl,-rpath-link=/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, "") - s.gsub!(" -nostdinc", "") + [ + %r{ ?-I/home/linuxbrew/\.linuxbrew/opt/(?:glibc@[^ /]+|linux-headers@[^ /]+)/include}, + %r{ ?-L/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, + %r{ ?-B/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, + %r{ ?-Wl,-rpath-link=/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, + " -nostdinc", + ].each { |pattern| s.gsub!(pattern, "") if s.match?(pattern) } # C++ compiler might have been disabled because we break it with glibc@* builds s.sub!(/(CONFIG\["CXX"\] = )"false"/, '\\1"c++"') if build.without? "yjit" end @@ -287,7 +289,7 @@ def test # Test gems that require portable dependency headers # These were failing before we included headers in the tarball # See: https://github.com/jdx/mise/discussions/7268#discussioncomment-15298593 - install_default_native_gem ruby, "openssl" if OS.mac? # requires openssl headers + install_default_native_gem ruby, "openssl" # requires openssl headers install_default_native_gem ruby, "psych" # requires libyaml headers # Test that gem upgrades work for bundled gems with executables diff --git a/Abstract/jdx-ruby-34.rb b/Abstract/jdx-ruby-34.rb index b634408..604cdf3 100644 --- a/Abstract/jdx-ruby-34.rb +++ b/Abstract/jdx-ruby-34.rb @@ -196,11 +196,13 @@ def install s.gsub! ENV.cc, "cc" # Change e.g. `CONFIG["AR"] = "gcc-ar-11"` to `CONFIG["AR"] = "ar"` s.gsub!(/(CONFIG\[".+"\] = )"gcc-(.*)-\d+"/, '\\1"\\2"') - s.gsub!(%r{ ?-I/home/linuxbrew/\.linuxbrew/opt/(?:glibc@[^ /]+|linux-headers@[^ /]+)/include}, "") - s.gsub!(%r{ ?-L/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, "") - s.gsub!(%r{ ?-B/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, "") - s.gsub!(%r{ ?-Wl,-rpath-link=/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, "") - s.gsub!(" -nostdinc", "") + [ + %r{ ?-I/home/linuxbrew/\.linuxbrew/opt/(?:glibc@[^ /]+|linux-headers@[^ /]+)/include}, + %r{ ?-L/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, + %r{ ?-B/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, + %r{ ?-Wl,-rpath-link=/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, + " -nostdinc", + ].each { |pattern| s.gsub!(pattern, "") if s.match?(pattern) } # C++ compiler might have been disabled because we break it with glibc@* builds s.sub!(/(CONFIG\["CXX"\] = )"false"/, '\\1"c++"') if build.without? "yjit" end @@ -290,7 +292,7 @@ def test # Test gems that require portable dependency headers # These were failing before we included headers in the tarball # See: https://github.com/jdx/mise/discussions/7268#discussioncomment-15298593 - install_default_native_gem ruby, "openssl" if OS.mac? # requires openssl headers + install_default_native_gem ruby, "openssl" # requires openssl headers install_default_native_gem ruby, "psych" # requires libyaml headers # Test that gem upgrades work for bundled gems with executables diff --git a/Abstract/jdx-ruby.rb b/Abstract/jdx-ruby.rb index 4278fac..e94b69d 100644 --- a/Abstract/jdx-ruby.rb +++ b/Abstract/jdx-ruby.rb @@ -188,11 +188,13 @@ def install s.gsub! ENV.cc, "cc" # Change e.g. `CONFIG["AR"] = "gcc-ar-11"` to `CONFIG["AR"] = "ar"` s.gsub!(/(CONFIG\[".+"\] = )"gcc-(.*)-\d+"/, '\\1"\\2"') - s.gsub!(%r{ ?-I/home/linuxbrew/\.linuxbrew/opt/(?:glibc@[^ /]+|linux-headers@[^ /]+)/include}, "") - s.gsub!(%r{ ?-L/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, "") - s.gsub!(%r{ ?-B/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, "") - s.gsub!(%r{ ?-Wl,-rpath-link=/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, "") - s.gsub!(" -nostdinc", "") + [ + %r{ ?-I/home/linuxbrew/\.linuxbrew/opt/(?:glibc@[^ /]+|linux-headers@[^ /]+)/include}, + %r{ ?-L/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, + %r{ ?-B/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, + %r{ ?-Wl,-rpath-link=/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, + " -nostdinc", + ].each { |pattern| s.gsub!(pattern, "") if s.match?(pattern) } # C++ compiler might have been disabled because we break it with glibc@* builds s.sub!(/(CONFIG\["CXX"\] = )"false"/, '\\1"c++"') if build.without? "yjit" end @@ -282,7 +284,7 @@ def test # Test gems that require portable dependency headers # These were failing before we included headers in the tarball # See: https://github.com/jdx/mise/discussions/7268#discussioncomment-15298593 - install_default_native_gem ruby, "openssl" if OS.mac? # requires openssl headers + install_default_native_gem ruby, "openssl" # requires openssl headers install_default_native_gem ruby, "psych" # requires libyaml headers # Test that gem upgrades work for bundled gems with executables From 0622938b98dd8346bf39c6b4ae1812f8c0c57138 Mon Sep 17 00:00:00 2001 From: default <216188+jdx@users.noreply.github.com> Date: Sat, 13 Jun 2026 21:27:23 +0000 Subject: [PATCH 16/19] ci: tolerate absent linux rbconfig flags --- Abstract/jdx-ruby-32.rb | 5 +++-- Abstract/jdx-ruby-33.rb | 5 +++-- Abstract/jdx-ruby-34.rb | 5 +++-- Abstract/jdx-ruby.rb | 5 +++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Abstract/jdx-ruby-32.rb b/Abstract/jdx-ruby-32.rb index fd6942a..4e42674 100644 --- a/Abstract/jdx-ruby-32.rb +++ b/Abstract/jdx-ruby-32.rb @@ -210,13 +210,14 @@ def install s.gsub! ENV.cc, "cc" # Change e.g. `CONFIG["AR"] = "gcc-ar-11"` to `CONFIG["AR"] = "ar"` s.gsub!(/(CONFIG\[".+"\] = )"gcc-(.*)-\d+"/, '\\1"\\2"') + rbconfig = s.to_s [ %r{ ?-I/home/linuxbrew/\.linuxbrew/opt/(?:glibc@[^ /]+|linux-headers@[^ /]+)/include}, %r{ ?-L/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, %r{ ?-B/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, %r{ ?-Wl,-rpath-link=/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, - " -nostdinc", - ].each { |pattern| s.gsub!(pattern, "") if s.match?(pattern) } + / -nostdinc/, + ].each { |pattern| s.gsub!(pattern, "") if pattern.match?(rbconfig) } # C++ compiler might have been disabled because we break it with glibc@* builds s.sub!(/(CONFIG\["CXX"\] = )"false"/, '\\1"c++"') if build.without? "yjit" end diff --git a/Abstract/jdx-ruby-33.rb b/Abstract/jdx-ruby-33.rb index 8bcbce5..42952f6 100644 --- a/Abstract/jdx-ruby-33.rb +++ b/Abstract/jdx-ruby-33.rb @@ -195,13 +195,14 @@ def install s.gsub! ENV.cc, "cc" # Change e.g. `CONFIG["AR"] = "gcc-ar-11"` to `CONFIG["AR"] = "ar"` s.gsub!(/(CONFIG\[".+"\] = )"gcc-(.*)-\d+"/, '\\1"\\2"') + rbconfig = s.to_s [ %r{ ?-I/home/linuxbrew/\.linuxbrew/opt/(?:glibc@[^ /]+|linux-headers@[^ /]+)/include}, %r{ ?-L/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, %r{ ?-B/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, %r{ ?-Wl,-rpath-link=/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, - " -nostdinc", - ].each { |pattern| s.gsub!(pattern, "") if s.match?(pattern) } + / -nostdinc/, + ].each { |pattern| s.gsub!(pattern, "") if pattern.match?(rbconfig) } # C++ compiler might have been disabled because we break it with glibc@* builds s.sub!(/(CONFIG\["CXX"\] = )"false"/, '\\1"c++"') if build.without? "yjit" end diff --git a/Abstract/jdx-ruby-34.rb b/Abstract/jdx-ruby-34.rb index 604cdf3..30ccd86 100644 --- a/Abstract/jdx-ruby-34.rb +++ b/Abstract/jdx-ruby-34.rb @@ -196,13 +196,14 @@ def install s.gsub! ENV.cc, "cc" # Change e.g. `CONFIG["AR"] = "gcc-ar-11"` to `CONFIG["AR"] = "ar"` s.gsub!(/(CONFIG\[".+"\] = )"gcc-(.*)-\d+"/, '\\1"\\2"') + rbconfig = s.to_s [ %r{ ?-I/home/linuxbrew/\.linuxbrew/opt/(?:glibc@[^ /]+|linux-headers@[^ /]+)/include}, %r{ ?-L/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, %r{ ?-B/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, %r{ ?-Wl,-rpath-link=/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, - " -nostdinc", - ].each { |pattern| s.gsub!(pattern, "") if s.match?(pattern) } + / -nostdinc/, + ].each { |pattern| s.gsub!(pattern, "") if pattern.match?(rbconfig) } # C++ compiler might have been disabled because we break it with glibc@* builds s.sub!(/(CONFIG\["CXX"\] = )"false"/, '\\1"c++"') if build.without? "yjit" end diff --git a/Abstract/jdx-ruby.rb b/Abstract/jdx-ruby.rb index e94b69d..fbd3bf3 100644 --- a/Abstract/jdx-ruby.rb +++ b/Abstract/jdx-ruby.rb @@ -188,13 +188,14 @@ def install s.gsub! ENV.cc, "cc" # Change e.g. `CONFIG["AR"] = "gcc-ar-11"` to `CONFIG["AR"] = "ar"` s.gsub!(/(CONFIG\[".+"\] = )"gcc-(.*)-\d+"/, '\\1"\\2"') + rbconfig = s.to_s [ %r{ ?-I/home/linuxbrew/\.linuxbrew/opt/(?:glibc@[^ /]+|linux-headers@[^ /]+)/include}, %r{ ?-L/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, %r{ ?-B/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, %r{ ?-Wl,-rpath-link=/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, - " -nostdinc", - ].each { |pattern| s.gsub!(pattern, "") if s.match?(pattern) } + / -nostdinc/, + ].each { |pattern| s.gsub!(pattern, "") if pattern.match?(rbconfig) } # C++ compiler might have been disabled because we break it with glibc@* builds s.sub!(/(CONFIG\["CXX"\] = )"false"/, '\\1"c++"') if build.without? "yjit" end From f2690b2ef636c7416bc4f37d74b007bb8e703038 Mon Sep 17 00:00:00 2001 From: default <216188+jdx@users.noreply.github.com> Date: Sat, 13 Jun 2026 22:05:49 +0000 Subject: [PATCH 17/19] ci: expose portable native gem flags to mkmf --- Abstract/portable-formula.rb | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Abstract/portable-formula.rb b/Abstract/portable-formula.rb index 91b866a..af7440b 100644 --- a/Abstract/portable-formula.rb +++ b/Abstract/portable-formula.rb @@ -104,19 +104,22 @@ def patch_rbconfig_for_portable_native_gems(abi_version, abi_arch) # Prefer the relocated portable Ruby prefix when building native gems. # This lets mkmf find headers, static libraries, and pkg-config files # copied into the package even when PKG_CONFIG_PATH is not set. + # mkmf reads MAKEFILE_CONFIG, while callers often inspect CONFIG. module RbConfig portable_prefix = File.expand_path("..", File.dirname(RbConfig.ruby)) portable_include = File.join(portable_prefix, "include") portable_lib = File.join(portable_prefix, "lib") portable_pkgconfig = File.join(portable_lib, "pkgconfig") - CONFIG["CPPFLAGS"] = "-I#{portable_include} #{CONFIG["CPPFLAGS"]}" - CONFIG["LDFLAGS"] = "-L#{portable_lib} #{CONFIG["LDFLAGS"]}" - CONFIG["DLDFLAGS"] = "-L#{portable_lib} #{CONFIG["DLDFLAGS"]}" - CONFIG["PKG_CONFIG_PATH"] = [portable_pkgconfig, CONFIG["PKG_CONFIG_PATH"]] - .compact - .reject(&:empty?) - .join(File::PATH_SEPARATOR) + [CONFIG, MAKEFILE_CONFIG].each do |config| + config["CPPFLAGS"] = "-I#{portable_include} #{config["CPPFLAGS"]}" + config["LDFLAGS"] = "-L#{portable_lib} #{config["LDFLAGS"]}" + config["DLDFLAGS"] = "-L#{portable_lib} #{config["DLDFLAGS"]}" + config["PKG_CONFIG_PATH"] = [portable_pkgconfig, config["PKG_CONFIG_PATH"]] + .compact + .reject(&:empty?) + .join(File::PATH_SEPARATOR) + end ENV["PKG_CONFIG_PATH"] = [portable_pkgconfig, ENV["PKG_CONFIG_PATH"]] .compact .reject(&:empty?) From 4caa996e84bd5ab220da7f2b1d499da8ed9e55cd Mon Sep 17 00:00:00 2001 From: default <216188+jdx@users.noreply.github.com> Date: Sat, 13 Jun 2026 23:33:03 +0000 Subject: [PATCH 18/19] ci: use generic compiler names for native gem probes --- Abstract/jdx-ruby-32.rb | 5 ++++- Abstract/jdx-ruby-33.rb | 5 ++++- Abstract/jdx-ruby-34.rb | 5 ++++- Abstract/jdx-ruby.rb | 5 ++++- Abstract/portable-formula.rb | 6 ++++++ 5 files changed, 22 insertions(+), 4 deletions(-) diff --git a/Abstract/jdx-ruby-32.rb b/Abstract/jdx-ruby-32.rb index 4e42674..a91bff4 100644 --- a/Abstract/jdx-ruby-32.rb +++ b/Abstract/jdx-ruby-32.rb @@ -206,11 +206,14 @@ def install if OS.linux? # Don't restrict to a specific GCC compiler binary we used (e.g. gcc-5). inreplace lib/"ruby/#{abi_version}/#{abi_arch}/rbconfig.rb" do |s| + rbconfig = s.to_s s.gsub! ENV.cxx, "c++" s.gsub! ENV.cc, "cc" + s.gsub!(/(CONFIG\["CC"\] = )"gcc-\d+"/, '\\1"cc"') if rbconfig.match?(/CONFIG\["CC"\] = "gcc-\d+"/) + s.gsub!(/(CONFIG\["LDSHARED"\] = )"gcc-\d+/, '\\1"cc') if rbconfig.match?(/CONFIG\["LDSHARED"\] = "gcc-\d+/) + s.gsub!(/(CONFIG\["CXX"\] = )"g\+\+-\d+"/, '\\1"c++"') if rbconfig.match?(/CONFIG\["CXX"\] = "g\+\+-\d+"/) # Change e.g. `CONFIG["AR"] = "gcc-ar-11"` to `CONFIG["AR"] = "ar"` s.gsub!(/(CONFIG\[".+"\] = )"gcc-(.*)-\d+"/, '\\1"\\2"') - rbconfig = s.to_s [ %r{ ?-I/home/linuxbrew/\.linuxbrew/opt/(?:glibc@[^ /]+|linux-headers@[^ /]+)/include}, %r{ ?-L/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, diff --git a/Abstract/jdx-ruby-33.rb b/Abstract/jdx-ruby-33.rb index 42952f6..74a0850 100644 --- a/Abstract/jdx-ruby-33.rb +++ b/Abstract/jdx-ruby-33.rb @@ -191,11 +191,14 @@ def install if OS.linux? # Don't restrict to a specific GCC compiler binary we used (e.g. gcc-5). inreplace lib/"ruby/#{abi_version}/#{abi_arch}/rbconfig.rb" do |s| + rbconfig = s.to_s s.gsub! ENV.cxx, "c++" s.gsub! ENV.cc, "cc" + s.gsub!(/(CONFIG\["CC"\] = )"gcc-\d+"/, '\\1"cc"') if rbconfig.match?(/CONFIG\["CC"\] = "gcc-\d+"/) + s.gsub!(/(CONFIG\["LDSHARED"\] = )"gcc-\d+/, '\\1"cc') if rbconfig.match?(/CONFIG\["LDSHARED"\] = "gcc-\d+/) + s.gsub!(/(CONFIG\["CXX"\] = )"g\+\+-\d+"/, '\\1"c++"') if rbconfig.match?(/CONFIG\["CXX"\] = "g\+\+-\d+"/) # Change e.g. `CONFIG["AR"] = "gcc-ar-11"` to `CONFIG["AR"] = "ar"` s.gsub!(/(CONFIG\[".+"\] = )"gcc-(.*)-\d+"/, '\\1"\\2"') - rbconfig = s.to_s [ %r{ ?-I/home/linuxbrew/\.linuxbrew/opt/(?:glibc@[^ /]+|linux-headers@[^ /]+)/include}, %r{ ?-L/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, diff --git a/Abstract/jdx-ruby-34.rb b/Abstract/jdx-ruby-34.rb index 30ccd86..68b41fb 100644 --- a/Abstract/jdx-ruby-34.rb +++ b/Abstract/jdx-ruby-34.rb @@ -192,11 +192,14 @@ def install if OS.linux? # Don't restrict to a specific GCC compiler binary we used (e.g. gcc-5). inreplace lib/"ruby/#{abi_version}/#{abi_arch}/rbconfig.rb" do |s| + rbconfig = s.to_s s.gsub! ENV.cxx, "c++" s.gsub! ENV.cc, "cc" + s.gsub!(/(CONFIG\["CC"\] = )"gcc-\d+"/, '\\1"cc"') if rbconfig.match?(/CONFIG\["CC"\] = "gcc-\d+"/) + s.gsub!(/(CONFIG\["LDSHARED"\] = )"gcc-\d+/, '\\1"cc') if rbconfig.match?(/CONFIG\["LDSHARED"\] = "gcc-\d+/) + s.gsub!(/(CONFIG\["CXX"\] = )"g\+\+-\d+"/, '\\1"c++"') if rbconfig.match?(/CONFIG\["CXX"\] = "g\+\+-\d+"/) # Change e.g. `CONFIG["AR"] = "gcc-ar-11"` to `CONFIG["AR"] = "ar"` s.gsub!(/(CONFIG\[".+"\] = )"gcc-(.*)-\d+"/, '\\1"\\2"') - rbconfig = s.to_s [ %r{ ?-I/home/linuxbrew/\.linuxbrew/opt/(?:glibc@[^ /]+|linux-headers@[^ /]+)/include}, %r{ ?-L/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, diff --git a/Abstract/jdx-ruby.rb b/Abstract/jdx-ruby.rb index fbd3bf3..8dc0b36 100644 --- a/Abstract/jdx-ruby.rb +++ b/Abstract/jdx-ruby.rb @@ -184,11 +184,14 @@ def install if OS.linux? # Don't restrict to a specific GCC compiler binary we used (e.g. gcc-5). inreplace lib/"ruby/#{abi_version}/#{abi_arch}/rbconfig.rb" do |s| + rbconfig = s.to_s s.gsub! ENV.cxx, "c++" s.gsub! ENV.cc, "cc" + s.gsub!(/(CONFIG\["CC"\] = )"gcc-\d+"/, '\\1"cc"') if rbconfig.match?(/CONFIG\["CC"\] = "gcc-\d+"/) + s.gsub!(/(CONFIG\["LDSHARED"\] = )"gcc-\d+/, '\\1"cc') if rbconfig.match?(/CONFIG\["LDSHARED"\] = "gcc-\d+/) + s.gsub!(/(CONFIG\["CXX"\] = )"g\+\+-\d+"/, '\\1"c++"') if rbconfig.match?(/CONFIG\["CXX"\] = "g\+\+-\d+"/) # Change e.g. `CONFIG["AR"] = "gcc-ar-11"` to `CONFIG["AR"] = "ar"` s.gsub!(/(CONFIG\[".+"\] = )"gcc-(.*)-\d+"/, '\\1"\\2"') - rbconfig = s.to_s [ %r{ ?-I/home/linuxbrew/\.linuxbrew/opt/(?:glibc@[^ /]+|linux-headers@[^ /]+)/include}, %r{ ?-L/home/linuxbrew/\.linuxbrew/opt/glibc@[^ /]+/lib}, diff --git a/Abstract/portable-formula.rb b/Abstract/portable-formula.rb index af7440b..045c3d0 100644 --- a/Abstract/portable-formula.rb +++ b/Abstract/portable-formula.rb @@ -132,6 +132,12 @@ module RbConfig def install_default_native_gem(ruby, gem_name) version = shell_output("#{ruby} -r#{gem_name} -e 'puts Gem.loaded_specs.fetch(#{gem_name.dump}).version'").chomp system Pathname(ruby).dirname/"gem", "install", gem_name, "--version", version, "--force" + rescue + Dir[Pathname(ruby).dirname.parent/"lib/ruby/gems/*/extensions/**/#{gem_name}-#{version}/mkmf.log"].each do |log| + ohai log + puts File.read(log) + end + raise end end From 10c64e355446c310890229de21aaae701406a02c Mon Sep 17 00:00:00 2001 From: default <216188+jdx@users.noreply.github.com> Date: Sun, 14 Jun 2026 00:17:47 +0000 Subject: [PATCH 19/19] ci: include stdbool for native gem probes --- Abstract/portable-formula.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Abstract/portable-formula.rb b/Abstract/portable-formula.rb index 045c3d0..e14642b 100644 --- a/Abstract/portable-formula.rb +++ b/Abstract/portable-formula.rb @@ -110,9 +110,10 @@ module RbConfig portable_include = File.join(portable_prefix, "include") portable_lib = File.join(portable_prefix, "lib") portable_pkgconfig = File.join(portable_lib, "pkgconfig") + portable_cppflags = "-include stdbool.h -I#{portable_include}" [CONFIG, MAKEFILE_CONFIG].each do |config| - config["CPPFLAGS"] = "-I#{portable_include} #{config["CPPFLAGS"]}" + config["CPPFLAGS"] = "#{portable_cppflags} #{config["CPPFLAGS"]}" config["LDFLAGS"] = "-L#{portable_lib} #{config["LDFLAGS"]}" config["DLDFLAGS"] = "-L#{portable_lib} #{config["DLDFLAGS"]}" config["PKG_CONFIG_PATH"] = [portable_pkgconfig, config["PKG_CONFIG_PATH"]]