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.
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
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
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 "/".
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.
* 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
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.