Build Ruby without libgmp on macOS - #253
Merged
Merged
Conversation
Sharpie
force-pushed
the
macos-intel-fix
branch
from
September 1, 2026 17:55
2fb1017 to
3318f78
Compare
nmburgan
approved these changes
Sep 1, 2026
Contributor
|
Has the internal implementation and known issues? Is it worth building our own libgmp for MacOS? |
The macOS runners come with a Homebrew-provided `libgmp` installed in
`/usr/local/opt/`. This library is required by the `ruby-build` Ruby
that run Vanagon builds. However, this `libgmp` is specifically built
for macOS 26.0. The Ruby build in `puppet-runtime` finds this library
during `./configure` and the following warning message is generated:
ld: warning: building for macOS-13.0, but linking with dylib '/usr/local/opt/gmp/lib/libgmp.10.dylib' which was built for newer version 26.0
Oddly, the presence of _something_ being printed to stderr causes
`./configure` to alter its logic and the resulting Ruby builds fail.
This commit adds `--without-gmp` to the configure args for macOS so
that the Homebrew library is ignored. The resulting configuration
still supports arbitrary-precision arithmatic as Ruby's `Bignum` uses
an internal implementation instead of `libgmp`.
Signed-off-by: Charlie Sharpsteen <charlie@overlookinfratech.com>
Sharpie
force-pushed
the
macos-intel-fix
branch
from
September 1, 2026 18:04
3318f78 to
8f5c1e6
Compare
Member
Author
|
I believe the internal implementation is less performant, but otherwise correct. The https://github.com/spinel-coop/rv-ruby/blob/20260723/Abstract/rv-ruby.rb#L111 |
bastelfreak
approved these changes
Sep 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Short description
The macOS runners come with a Homebrew-provided
libgmpinstalled in/usr/local/opt/. This library is required by theruby-buildRuby that run Vanagon builds. However, thislibgmpis specifically built for macOS 26.0. The Ruby build inpuppet-runtimefinds this library during./configureand the following warning message is generated:Oddly, the presence of something being printed to stderr causes
./configureto alter its logic and the resulting Ruby builds fail.This commit adds
--without-gmpto the configure args for macOS so that the Homebrew library is ignored. The resulting configuration still supports arbitrary-precision arithmatic as Ruby'sBignumuses an internal implementation instead oflibgmp.Checklist
I have:
Signed-off-byannotation to each of my commitsGenerated-byorAssisted-byannotations to each of my commits created with the help of an AI agent