fix: clear build-time pkg-config path from rbconfig - #55
Conversation
📝 WalkthroughWalkthroughThe embedded Ruby ChangesPKG_CONFIG portability
Estimated code review effort: 1 (Trivial) | ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR fixes portable Ruby artifacts baking the CI-time
Confidence Score: 5/5Single-line change with no runtime behavior impact outside of native gem builds on portable Ruby installs; the deleted key is replaced by normal mkmf discovery. The change is one config.delete call inside an existing loop that already scrubs both RbConfig::CONFIG and RbConfig::MAKEFILE_CONFIG. Deleting the key is unambiguous and correct — it cannot silently break anything that setting it to empty string would have broken. PKG_CONFIG_PATH is still properly set on line 602, so the portable lib path remains available to whatever pkg-config binary mkmf resolves. No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "fix: remove pkg-config from portable rbc..." | Re-trigger Greptile |
Summary
PKG_CONFIGvalue from both portableRbConfighashesENV["PKG_CONFIG"]or discoverpkg-configonPATHRoot cause
The Ruby build records the bootstrap
pkgconfexecutable's absolute path inrbconfig.rb. That path points inside the GitHub Actions build tree and does not exist after the Ruby archive is installed elsewhere. Since mkmf prefers the configured value, the stale path also prevents its environment andPATHfallbacks from running.The existing portability patch already updates both
RbConfig::CONFIGandRbConfig::MAKEFILE_CONFIG; clearingPKG_CONFIGthere restores mkmf's normal fallback behavior for native gems such asruby-magic.Fixes the packaging problem reported in jdx/mise discussion #10913.
Validation
git diff --checkruby -c libexec/package.rbbin/validate-recipesThe PR build workflow will additionally build and exercise a portable Ruby artifact.
Note
Low Risk
Single-line change in the existing rbconfig portability patch; affects only shipped RbConfig for native gem builds, not the Ruby compile itself.
Overview
Portable Ruby installs were baking the CI/bootstrap
pkgconfabsolute path intoRbConfig, somkmfkept calling a binary that no longer exists after the tarball is unpacked elsewhere and never fell back toENV["PKG_CONFIG"]orpkg-configonPATH.The
rbconfig_portability_patchnowdeletesPKG_CONFIGfrom bothRbConfig::CONFIGandRbConfig::MAKEFILE_CONFIG, alongside the existing scrub of build-tree compiler flags. Native extension builds (e.g.ruby-magic) can discoverpkg-confignormally at install time.Reviewed by Cursor Bugbot for commit bf60044. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit
pkg-configdiscovery during builds by honoring the configured environment or systemPATHinstead of relying on a fixed value.