There is no need to redirect to &3 to most cases anymore: &2 will suffice.
Also, it is better to print failure errors like checksum mismatches to
stderr instead of to the log file at &4.
- The command line invocation is now printed in the log.
- For every extension that failed, print the absolute location to its
mkmf.log to encourage the user to look there when troubleshooting.
- Do not print "Configure options used" since ruby-build now prints the
full `./configure` invocation as part of the build output.
This removes the `isolated_gem_dependency` hack as well as the `rake` &
`bundle` shell wrapper functions. The main reason is to avoid having to
use the `command` shell builtin to be able to invoke the real `rake` and
`bundle`. In my testing on bash 3.2, `command` does not respect the
usual bash error handling rules, and thus a failed `command` invocation
can trigger the ERR trap mechanism even when we don't want it to.
This stops writing raw pushd/popd output to the log file, which is noisy
and potentially confusing out-of-context. Instead, when changing the
directory in a way that is significant to the log, just print `cd`
followed by the name of the new directory.
This connects the stderr of download utilities like curl and wget to the
original stderr of the process so that they can detect a terminal and
print progress bars to it.
- "BUILD FAILED" is now printed in red instead of in highlight color.
- Print CPU architecture information after OS information.
- Do NOT print last 10 lines of the log anymore. Due to the verbosity of
compilers, that rarely includes the actual error message, but users
think it does and so they paste it in their GitHub reports instead of
perusing the log file.
ruby-build now prints the full invocation of (almost) every external
command that it runs. Typically that is something like:
-> ./configure --prefix=/path/to/ruby
-> make -j 2
-> make install
All output of these commands still goes to the log file by default.
This changes the behavior of `--verbose` mode to simply redirect all
command output to the stdout & stderr of the parent process instead of
writing to and then tailing the log file. This allows implementations of
commands like `./configure` or `make` to detect a terminal and output
color.
If a system OpenSSL version was not found or is at version that is incompatible with a Ruby being installed, ruby-build would typically download and compile a new OpenSSL version scoped to that Ruby installation.
Now the `needs_openssl` condition will also check for Homebrew-installed OpenSSL and automatically link to the first one found that satisfies the version requirement. This primarily helps speed up Ruby installation on macOS where the system OpenSSL is never compatible and where Homebrew is a de-facto standard package manager.
Example:
install_package openssl-1.1 "https://..." --if needs_openssl:1.0.1-3.1.x
In the example, the two values are passed as arguments to the `needs_openssl` function.
LC_CTYPE is "utf-8" on macOS, which instructs utilities like `tr` to expect Unicode input. However, in case of binary files, which we here explicitly guard against, the utility will fail because of invalid input encoding.
The solution is to set LC_CTYPE=C which effectively removes the expectation around input encoding and allows `tr` to process the input byte-by-byte.
TruffleRuby build definitions used to explicitly rely on `brew --prefix openssl@1.1` on macOS and abort installation if that was not found. However, this check didn't take into account that the user might have set OPENSSL_PREFIX in their environment, or that they have another `openssl@*` version installed via Homebrew. This change removes the `use_homebrew_openssl` check and allows TruffleRuby to perform its own OpenSSL detection.
https://github.com/oracle/truffleruby/blob/vm-23.1.0/lib/truffle/truffle/openssl-prefix.rb#L14-L17
- Now only generates a `configure` script if explicitly specified
- Add ability to add arbitrary files to the tarball
- Cache most common tarballs in fixtures directory to speed up tests
Reuse original `build_package_copy` instead of having to maintain an additional `build_package_copy_to` step.
As a bonus, this prevents a global variable `to` from leaking.
The default settings for LDFLAGS and CPPFLAGS were there since the initial commit to ruby-build:
LDFLAGS="-L${PREFIX_PATH}/lib"
CPPFLAGS="-I${PREFIX_PATH}/include"
However, it's not clear to me what these settings help with. A typical Ruby installation will initialize files in these directories, but it will do so regardless of the environment variables.
So, let's remove them and see what breaks.
- The `make -j 1` workaround seems neither in effect nor necessary anymore
- Assume that KERNEL_BITS workaround isn't necessary anymore
- Declare more variables as local