Commit graph

854 commits

Author SHA1 Message Date
Mislav Marohnić
cf383ac114
Fixes "integer expression expected" error
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.
2025-09-25 13:50:49 +02:00
Benoit Daloze
d9725557c6 ruby-build 20250916.1 2025-09-16 18:30:45 +02:00
Hiroshi SHIBATA
58d14974bc
ruby-build 20250916 2025-09-16 09:15:53 +09:00
Jeremy Daer
df045bdc07 Drop the default package mirror
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.
2025-09-12 09:49:34 -07:00
Mislav Marohnić
ab15bd535f
ruby-build 20250908 2025-09-08 19:20:07 +02:00
Mislav Marohnić
28563f38a3
Fix using system openssl v1.x with pkg-config
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.
2025-09-08 19:07:28 +02:00
Hiroshi SHIBATA
2d5ef5b4b0
ruby-build 20250829 2025-08-29 08:24:24 +09:00
Mislav Marohnić
95b887330e
Fix linking to Homebrew OpenSSL 2025-08-14 12:33:22 +02:00
Mislav Marohnić
fd0460e858
Merge pull request #2560 from rbenv/jruby-9.3
Fix regression in JRuby 9.3
2025-08-12 13:56:59 +02:00
Nicolas Bachschmidt
fd0f332f06
Consult pkg-config when detecting system OpenSSL (#2547)
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>
2025-08-12 13:56:42 +02:00
Mislav Marohnić
986c1e373e
Fix regression in JRuby 9.3
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.
2025-08-11 16:03:12 +02:00
Mislav Marohnić
266b94f278
ruby-build 20250811 2025-08-11 15:46:25 +02:00
Hiroshi SHIBATA
a97e10ff10
ruby-build 20250724 2025-07-24 20:38:15 +09:00
Hiroshi SHIBATA
d037c38abb
ruby-build 20250716 2025-07-16 09:29:50 +09:00
Mislav Marohnić
72aae41d57
Fix Fedora version check when VERSION_ID is decimal
This fixes RHEL builds where VERSION_ID=7.9
2025-06-30 17:14:22 +02:00
|7eter l-|. l3oling
5693b62d54
Allow installation of Ruby 2.7, 3.0, 3.1 on Fedora >= 42 (#2543)
Fedora 42+ has updated to GCC v15. GCC v15 changed the default
mode from gnu17 to gnu23: https://gcc.gnu.org/gcc-15/changes.html#c

Ruby < 3.2 can't compile on GCC v15 in the default mode of gnu23.

Fixes https://github.com/rbenv/ruby-build/issues/2542

---------

Co-authored-by: Mislav Marohnić <git@mislav.net>
2025-06-26 01:26:07 +02:00
Mislav Marohnić
1195268593
ruby-build 20250610 2025-06-10 22:38:55 +02:00
Benoit Daloze
5fedc1fc56 ruby-build 20250529.1 2025-05-29 00:12:45 +02:00
Jason Karns
0f0b4f5628
ruby-build 20250516 2025-05-16 09:13:02 -04:00
Mislav Marohnić
7c0b13b355
ruby-build 20250507 2025-05-07 20:08:15 +02:00
Benoit Daloze
de8494ef4b ruby-build 20250430 2025-04-30 20:51:44 +02:00
Benoit Daloze
f89beda427 ruby-build 20250424 2025-04-24 22:41:33 +02:00
なつき
e90abc41aa Honor $JAVA_HOME in require_java 2025-04-18 15:09:22 +08:00
Hiroshi SHIBATA
e1393bad0e
ruby-build 20250418 2025-04-18 10:00:11 +09:00
Hiroshi SHIBATA
7dffe09db7
ruby-build 20250415 2025-04-15 10:32:16 +09:00
Hiroshi SHIBATA
cae502a444
ruby-build 20250409 2025-04-09 20:38:36 +09:00
Charles Oliver Nutter
f661b64cab
Don't delete jruby.sh
I'm not sure why this file was being deleted but this code dates way back! Unfortunately deleting this interferes with a new version of the native JRuby launcher we want to release which is dependent on the shell script being present. This PR removes jruby.sh from the `remove_windows_files` function so it can be used by the new launcher.

See https://github.com/jruby/jruby-launcher/pull/48#issuecomment-2772272290
2025-04-02 12:42:27 -05:00
Hiroshi SHIBATA
2334633d60
ruby-build 20250326 2025-03-26 14:47:28 +09:00
Benoit Daloze
88dd8dbfef ruby-build 20250318 2025-03-18 13:58:34 +01:00
Hiroshi SHIBATA
cb9c1decb3
ruby-build 20250215 2025-02-15 07:35:48 +09:00
Hiroshi SHIBATA
20f209a092
ruby-build 20250212 2025-02-12 09:03:43 +09:00
Hiroshi SHIBATA
65c7d80a66
ruby-build 20250205 2025-02-05 09:18:01 +09:00
Hiroshi SHIBATA
31fa406e7d
ruby-build 20250130 2025-01-30 08:37:54 +09:00
Benoit Daloze
d5453a162d ruby-build 20250127 2025-01-27 13:36:11 +01:00
Mislav Marohnić
eabf640863
compute_sha2: drop support for OS X Leopard
When computing the SHA-2 checksum, `openssl dgst` is a potential candidate if
openssl was found in PATH. Previously, openssl from Homebrew would also get
explicitly added to the candidates list because, historically, Homebrew did not
link it to PATH, OS X Leopard did not have `shasum`, and system openssl could
not calculate sha256 checksums.

This drops support for OS X Leopard which last had an update 15 years ago.

Ref. b396ad7cd1
2025-01-22 13:27:25 +01:00
Mislav Marohnić
fdcfac8d42
rbenv install: fix substituting $HOME with "~" (#2501)
Depending on bash version, the expression `${var/$HOME\//~/}` will not have
effect because the "~" character in the replacement expression is expanded.

The updated approach is a bit of a mouthful, but it avoids using "~" in a
substitution pattern, while also guarding against values of HOME that are
blank or when HOME is literally just "/".
2025-01-21 22:11:40 +01:00
Mislav Marohnić
3366b3bff2
ruby-build 20250121 2025-01-21 20:48:38 +01:00
Benoit Daloze
4b363d67d5 Simplify logic for rpath, the comma syntax is supported by all compilers
* From https://github.com/rbenv/ruby-build/pull/2496/files#r1915751424
2025-01-15 15:22:21 +01:00
Hiroshi SHIBATA
644d2940e6
ruby-build 20250115 2025-01-15 17:49:45 +09:00
Mislav Marohnić
f6628c3d1f
ruby-build 20250114 2025-01-14 23:40:13 +01:00
Mislav Marohnić
afb5dcc402
Fix installing OpenSSL on non-Linux or with clang
The recent rpath argument addition broke compilation of OpenSSL with clang since
it seems expect this syntax (comma instead of "="):

    -Wl,-rpath,<path>

Also, it doesn't seem that the rpath argument is necessary for any platform other
than "Linux"; that is, we should skip passing it on BSD and macOS.
2025-01-14 23:32:57 +01:00
Mislav Marohnić
068c4047cf
Fix library lookup path in the vendored OpenSSL (#2493)
* Fix library lookup path in the vendored OpenSSL

When a vendored OpenSSL is needed for compiling Ruby, that OpenSSL installation
ends up with its `bin/openssl` executable broken due to not finding "libssl.so"
and "libcrypto.so" in the global load path for libraries. This doesn't seem to
negatively affect the Ruby "openssl" extension, but is a broken OpenSSL install
nevertheless.

This change causes the `bin/openssl` executable and related shared libraries to
be built with an "RPATH" pointing to the "lib" directory of the vendored OpenSSL.

* fix test
2025-01-11 15:15:26 +01:00
Hiroshi SHIBATA
b5ade6192c
ruby-build 20241225.2 2024-12-25 18:02:54 +09:00
Hiroshi SHIBATA
62b63dbb12
ruby-build 20241225.1 2024-12-25 17:42:03 +09:00
Hiroshi SHIBATA
554dda2dcb
ruby-build 20241225 2024-12-25 15:43:43 +09:00
Hiroshi SHIBATA
5a5358797d
ruby-build 20241213 2024-12-13 07:51:28 +09:00
Benoit Daloze
6c937c819c Add an environment variable to always build openssl/libssl
* This is useful when one wants to avoid depending e.g. on which openssl version
  is installed in Homebrew, notably for https://github.com/ruby/setup-ruby/issues/668
2024-11-13 14:27:42 +01:00
Mislav Marohnić
87c272cd57
Merge pull request #2462 from rbenv/named-pipes
Allow named pipes as build definition argument
2024-11-05 23:43:02 +01:00
Mislav Marohnić
4b3890884a
Allow named pipes as build definition argument
Allow ruby-build to read a build definition from a named pipe in addition to just
from regular files.
2024-11-05 15:04:47 +01:00
Mislav Marohnić
bc88537fc5
Avoid array subscript error when checking OpenSSL versions
If none of Homebrew OpenSSL versions satisfy the `needs_openssl` requirement,
array iteration will reach `index=-1` and that will raise a non-fatal error
when accessing the `versions` array. This makes sure not to go past index=0.
2024-11-05 14:42:53 +01:00