macOS Rubies need Homebrew openssl@4 >= 4.1 since #980; an older 4.x segfaults instead of erroring

未關閉 適合新手
#981 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
1/5
預估耗時
1 小時以內
新手友好度
82/100
Issue 類型
文件
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
github-actions, macos, ruby

研究方向

找到 README 中關於自架 runner 的部分,並閱讀其中有關使 libssl 與 GitHub 映像相符的現有說明。更新說明,指出 macOS arm64 的 Ruby 4.0.10 組建需要 Homebrew openssl@4 版本 4.1.0 或更新版本;當文件中的最低版本與 issue 回報可正常運作的版本一致時,即視為完成。issue 也建議在載入較舊的 OpenSSL 時,讓 setup-ruby 顯示更清楚的錯誤,但沒有提供實作該變更的切入點。

由索引模型根據 Issue 內容生成。

描述

What changed: since the builds added in #980, the macOS arm64 Rubies link Homebrew openssl@4 instead of openssl@3 (I checked 3.4.13 and 4.0.10). 4.0.10 is built against openssl@4 4.1.0; 4.0.9 linked openssl@3.

What happens with ruby/setup-ruby@v1 and Ruby 4.0.10 on a third-party macOS 26 arm64 runner:

openssl@4 on the machine Result
None gem install bundler fails: OpenSSL is not available
4.0.1 Ruby loads, then OpenSSL::PKCS7#verify([], …) segfaults (backtrace below)
4.1.0 (local repro) Works

Ask: I know the README asks self-hosted runners to match the GitHub image's libssl, so this is expected. Could the self-hosted section mention that macOS builds now need Homebrew openssl@4 at least as new as the one they were built with? A clear error from setup-ruby when the loaded OpenSSL is older than the build's would also have saved a lot of debugging.

Backtrace and repro
[BUG] Segmentation fault at 0x0000000000000000
ruby 4.0.10 (2026-11-19 revision a704b7cd95) +PRISM [arm64-darwin24]
openssl.bundle(ossl_x509_ary2sk0+0x50) ext/openssl/ossl.c:66
openssl.bundle(ossl_pkcs7_verify+0x12c) ext/openssl/ossl_pkcs7.c:797

Reproduced locally with the released 4.0.10 tarball and the script below: it passes with openssl@4 4.1.0, and with the 4.0.1 bottle it segfaults in ossl_x509_ary2sk0 (ossl.c:66) already at OpenSSL::PKCS7.sign(…, [], …).

require 'openssl'

puts "ruby #{RUBY_VERSION}, #{OpenSSL::OPENSSL_LIBRARY_VERSION}, openssl gem #{OpenSSL::VERSION}"

key = OpenSSL::PKey::RSA.new(2048)
cert = OpenSSL::X509::Certificate.new
cert.version = 2
cert.serial = 1
cert.subject = cert.issuer = OpenSSL::X509::Name.parse('/CN=repro')
cert.public_key = key
cert.not_before = Time.now
cert.not_after = Time.now + 3600
cert.sign(key, OpenSSL::Digest.new('SHA256'))

der = OpenSSL::PKCS7.sign(cert, key, '<plist/>', [], OpenSSL::PKCS7::BINARY).to_der

# Same call as fastlane_core/provisioning_profile.rb:115
profile = OpenSSL::PKCS7.new(der)
result = profile.verify([], OpenSSL::X509::Store.new, nil, OpenSSL::PKCS7::NOVERIFY)
puts "verify returned #{result}, data=#{profile.data}"
主要語言
JavaScript
星號
1k
分支
381
平均合併
17 小時 39 分鐘
30 天內合併 PR
10

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

ruby/setup-ruby 的其他 Issue

查看 ruby/setup-ruby 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。