`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>
This happens while compiling OpenSSL or any other non-Ruby package:
ruby-build: line 723: [: : integer expression expected
This was because $ruby_semver was checked as a numeric value but was never set.
37signals are dropping AWS, which means goodbye to S3 and CloudFront.
The CloudFront mirror (dqw8nmjcqpjn7.cloudfront.net) was introduced ages
ago to address intermittent unavailability from some upstream sources.
These days, it mainly serves non-MRI packages like OpenSSL and libyaml.
Ruby releases are now served by Fastly (cache.ruby-lang.org) which has
bypassed the ruby-build mirror since 2015. Other sources (GitHub, RubyGems,
Maven) have their own CDNs.
This change removes the default `RUBY_BUILD_MIRROR_URL` and S3 release
mirroring. Custom mirror support remains.
System openssl version reported by `pkg-config --modversion openssl` might end
with a letter, e.g. "1.0.2k", due to OpenSSL versioning policy prior to OpenSSL v3:
https://www.openssl-library.org/policies/general/versioning-policy/#history
The letter would trip up the normalize_semver function due to it only handling numbers.
This change switches to semver parsing via awk instead of doing it clumsily in
bash. This also changes the multiplication factor of major version numbers,
from 100000 to 10000, and adjusts static version comparisons accodingly.
Skip downloading and building OpenSSL if a compatible version was found with pkg-config, but only if that openssl version isn't under Homebrew's "cellar".
---------
Co-authored-by: Mislav Marohnić <git@mislav.net>
Commit f661b64cab that restores `bin/jruby.sh` for
all JRuby versions has an undesired effect on JRuby 9.3 when it pulls in
jruby-launcher v2. Since JRuby 9.3 is EOL and won't get a fix for this, at least
attempt to fix this in ruby-build since until recently JRuby 9.3 worked.
The fix is that JRuby 9.3 (and only those versions) are not allowed to install
jruby-launcher versions 2.0 or greater.