Two `ar` runs into libcrypto.a can overlap under make -j and drop each other's objects, which breaks every Ruby 2.3 and older build on the ubuntu-26.04 runners. The `-j 1` that used to prevent this stopped taking effect when 3a4d3fb0 moved MAKE_OPTS after the package options, and 6663720f removed it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The configure script of Ruby 2.7.8 is generated by Autoconf 2.71, which
runs AC_PROG_CC (setting CFLAGS=-g -O2) before Ruby's own
`test -z "${CFLAGS+set}"` check, so the cflags configure variable is
silently ignored and Ruby 2.7 was still compiled as C23 on GCC 15.
Ruby 3.0+ unset CFLAGS again in that case, and the tarballs of 2.0 to
2.5 ship an Autoconf 2.69 configure which runs the check first.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
GCC 15 defaults to C23, which Ruby < 3.2 can't compile as. Detect the
GCC version instead of the OS, so that e.g. Ubuntu 26.04 is handled too.
The flag keeps going through the cflags configure variable, except for
Ruby 2.6 where it goes on CC, because its MJIT header check runs a bare
$(CC) and would otherwise fail.
Ported from https://github.com/ruby/ruby-builder/pull/31
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The macOS 27 SDK declares both as available since macOS 27.0, and
`AC_CHECK_FUNCS` detects them regardless of the deployment target, so
Ruby built on macOS 26 with the Command Line Tools 27 calls weakly
linked NULL symbols and crashes miniruby during the build.
https://bugs.ruby-lang.org/issues/22311https://github.com/rbenv/ruby-build/issues/2640
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
normalize_semver("dev") returned 0, so ruby-dev was treated as older
than any released version and version-gated workarounds misfired.
Notably the Fedora 42+ -std=gnu17 workaround for Ruby < 3.2 was
applied to ruby-dev builds, which do not need it.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Exporting CFLAGS overrides Ruby's default optflags/debugflags/warnflags,
notably losing -O3 and silently producing a much slower (-O0) Ruby.
The cflags configure variable is appended to those defaults instead.
Keep prepending to CFLAGS when the user already overrides CFLAGS,
since configure ignores cflags when CFLAGS is given.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
`resolve_version` strips the leading `ruby-` from its argument and
then only looks for the stripped form in the definitions directory.
For canonical definitions whose filename retains the `ruby-` prefix
(currently `ruby-dev`) the exact-match step searches for `dev`,
which does not exist, and the grep fallback's `^dev[-.]` anchor
also misses the `ruby-dev` line in the definitions list. Result:
`ruby-build ruby-dev` reports "definition not found" even though
the file is shipped.
Try the original (unstripped) argument first in the exact-match
loop, then fall back to the stripped form. Numeric-version inputs
(`ruby-3.4.9`, `3.4`, `ruby-3.4`) and other implementations
(`mruby-dev`, `jruby-dev`) are unaffected because their existing
code paths still match.
Regression introduced in #2610.
* Support building with version prefix
Commonly in CI pipelines and other scripts, users may
want to install the latest from a specific series, e.g.
`3.4` or `jruby-10.0`.
```bash
$ bin/ruby-build 3.4 /tmp/3.4
...
Downloading ruby-3.4.9.tar.gz...
$ bin/ruby-build 4.0 /tmp/4.0
...
Downloading ruby-4.0.2.tar.gz...
```
Also support `--resolve`:
```bash
$ bin/ruby-build --resolve 3.4
3.4.9
```
* Improve version name resolution from prefix
- `ruby-build --resolve` now prints canonical definition names, always
stripping the "ruby-" prefix from output (e.g. "ruby-3.4" => "3.4.9").
- Fix sorting versions so that "jruby" correctly resolves to "jruby-10.x"
instead of to "jruby-9.x".
- Support bare "ruby" argument to select the latest CRuby version, since
that was already possible for "jruby", "mruby", et al.
- Case-normalize version inputs so that arguments like "JRuby" or
"TruffleRuby" resolve to their lowercase definitions.
- Simplify definition file lookup: all code paths now go through
resolve_version.
- Restore the named-pipe + `--dir` check to correctly abort early.
- Update README and man page: bump Ruby version numbers in examples, add
Ruby implementations section, document the `--resolve` option.
* Clarify what ruby-build considers to be "latest" Ruby version
* Print usage error message if `--resolve` wasn't passed an argument
---------
Co-authored-by: Mislav Marohnić <git@mislav.net>
This commit adds PicoRuby 3.4.2 and introduces a new artifacts: r2p2.
Version numbering context:
PicoRuby's version numbers are aligned with mruby's VM code specification compatibility.
Version 3.4 indicates compatibility with mruby 3.4 VM code format, or RITE0300.
Version 3.4.2 indicates minor bug fix in PicoRuby.
Build artifact changes:
Starting from version 3.4.2, PicoRuby has replaced the irb executable with r2p2 executable(POSIX version of PicoRuby shell system including IRB).
The new build produces three executables:
- picoruby: main Ruby interpreter
- picorbc: Ruby bytecode compiler
- r2p2: interactive REPL (replaces picoirb)
Implementation:
- Added conditional symlink logic in `build_package_picoruby()`: symlinks picoirb as irb if present
- If there's no picoirb in artifacts, symlink for irb is not created
- Added picoruby-3.4.2 definition file
While bisecting, or building a nightly Ruby CI and some other situations,
it is useful to be able to build a specific Ruby revision rather than
just the tip of Ruby's master branch.
Detect /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem used in modern
RHEL and Fedora systems.
Also improve the error message when no system CA bundle is found.
Signed-off-by: Mikel Olasagasti Uranga <mikel@olasagasti.info>