Commit graph

698 commits

Author SHA1 Message Date
Mislav Marohnić
c4f811a23d
Fix commands printed when TMPDIR is empty 2023-11-08 23:56:03 +01:00
Mislav Marohnić
bb18f12e64
ruby-build 20231107 2023-11-07 19:16:07 +01:00
Mislav Marohnić
b80edb1889
💅 Tidy up ruby-build help output 2023-11-07 18:20:59 +01:00
Mislav Marohnić
91c95bbf8f
Respect NO_COLOR and CLICOLOR_FORCE (#2295)
http://bixense.com/clicolors/
2023-11-07 16:05:27 +01:00
Mislav Marohnić
e320bdfbc7
Add helpful comments explaining ruby-build inner workings 2023-11-07 11:06:23 +01:00
Mislav Marohnić
ff4f335cb1
Simplify printing various error messages to stderr
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.
2023-11-07 11:03:53 +01:00
Mislav Marohnić
5d1bebaccc
Improve verify_openssl output
- 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.
2023-11-07 10:59:18 +01:00
Mislav Marohnić
1f72acb6d9
Connect git commands to the original stderr
Git commands that perform network fetching can now render progress on
the terminal. This also stops writing any git output to the log file.
2023-11-07 10:55:01 +01:00
Mislav Marohnić
56242478b1
Simplify build_package_rbx
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.
2023-11-07 10:51:43 +01:00
Mislav Marohnić
ae653983d8
💅 Cleanup build_package steps implementation
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.
2023-11-07 10:23:41 +01:00
Mislav Marohnić
93c50bbaf0
Show progress of downloaded files in the terminal
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.
2023-11-07 10:17:54 +01:00
Mislav Marohnić
61e50df552
Improve "BUILD FAILED" output
- "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.
2023-11-07 10:07:41 +01:00
Mislav Marohnić
c6f8eb38cf
Print external commands that ruby-build executes
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.
2023-11-07 09:48:04 +01:00
Mislav Marohnić
945d124335
Remove topaz
I can't find evidence that Topaz is still in development nor that it has had a release in the last 10 years.
2023-11-06 16:50:49 +01:00
Mislav Marohnić
a706e117d7
Remove maglev
Maglev Ruby hasn't seen a release in 10 years.
2023-11-06 16:49:29 +01:00
Mislav Marohnić
f6923c65f0
Fix checking system OpenSSL version
The value of OPENSSL_VERSION_TEXT seems to be printed in double quotes.
2023-11-05 13:56:45 +01:00
Mislav Marohnić
31e53468b6
Automatically link to Homebrew OpenSSL
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.
2023-11-02 13:53:50 +01:00
Mislav Marohnić
8f294c43ad
Allow inline arguments in --if conditions
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.
2023-11-02 13:53:30 +01:00
Benoit Daloze
8afc6e179b ruby-build 20231025 2023-10-25 11:57:47 +02:00
Benoit Daloze
39f77ffd17 Skip ri/rdoc when installing jruby-launcher 2023-10-23 12:28:10 +02:00
Mislav Marohnić
c3bae8b6a9 Fix fixing JRuby shebangs on macOS
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.
2023-10-23 12:11:16 +02:00
Mislav Marohnić
db600ccdfd TruffleRuby: remove explicit openssl@1.1 requirement on macOS
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
2023-10-20 15:09:45 +02:00
Mislav Marohnić
fe933abbf8
Merge pull request #2271 from rbenv/ldflags-clean
Remove implicit LDFLAGS, CPPFLAGS, and "ldflags_dirs" build step
2023-10-16 18:19:29 +02:00
Mislav Marohnić
aada31aed5
Avoiding excessive cd when fetching git repos (#2273) 2023-10-16 14:40:04 +02:00
Mislav Marohnić
7a741cfb68
Merge pull request #2270 from rbenv/openssl-clean
Cleanup in OpenSSL compilation step
2023-10-16 14:38:58 +02:00
Mislav Marohnić
1d9b4e268f
Merge pull request #2274 from rbenv/ruby-configure-opts
Avoid compiling OpenSSL if the user supplied `--with-openssl-dir` on the command line
2023-10-14 14:01:09 +02:00
Mislav Marohnić
7773f82f74 Cleanup in truffleruby+graalvm installation
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.
2023-10-14 12:30:53 +02:00
Benoit Daloze
536495d1d3 ruby-build 20231014 2023-10-14 12:19:11 +02:00
Mislav Marohnić
9b8749105f
Avoid compiling OpenSSL if the user supplied --with-openssl-dir on the command line
Same with linking libyaml, gmp, etc. to Homebrew. This considers all user configuration inputs when checking for existing flags.
2023-10-13 19:52:42 +02:00
Mislav Marohnić
47eda17460
Remove implicit LDFLAGS, CPPFLAGS, and "ldflags_dirs" build step
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.
2023-10-13 19:21:04 +02:00
Mislav Marohnić
6663720fca
Cleanup in openssl compilation step
- 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
2023-10-13 19:05:31 +02:00
Benoit Daloze
216084d334 Add RUBY_BUILD_TARBALL_OVERRIDE to override the ruby tarball URL
* Update the check for whether a package is a ruby.
2023-10-12 11:48:03 +02:00
Benoit Daloze
4bf2fece5e ruby-build 20231012 2023-10-12 11:46:39 +02:00
Mislav Marohnić
b4b1dd20ce
Enable shellcheck parsing of ruby-build source (#2268) 2023-10-12 11:10:43 +02:00
Mislav Marohnić
d9bdc904b9
💅 RUBY_CONFIGURE_OPTS_ARRAY 2023-10-11 18:02:07 +02:00
Mislav Marohnić
fbdf88cc13
Accept ruby configuration flags as extra position arguments on the command line 2023-10-11 18:02:07 +02:00
Mislav Marohnić
f7d63b7dcb
Rework argument parsing to error out on invalid flags 2023-10-11 18:02:07 +02:00
Mislav Marohnić
c8927eefd0
Expand parse_options to preserve positional arguments after "--" 2023-10-11 15:05:03 +02:00
Thomas Hurst
4cec390699
Set default MAKE=make on FreeBSD (#2263)
This was set to gmake in https://github.com/rbenv/ruby-build/pull/1381
as a workaround for https://bugs.ruby-lang.org/issues/16331

YJIT builds in Ruby 3.3 previews require the use of BSD make on these
platforms, and no supported version of MRI requires the use of gmake, so
revert this.

JRuby continues to require gmake for jruby-launcher.

Fixes #2262

Co-authored-by: Mislav Marohnić <git@mislav.net>
2023-10-11 12:19:40 +02:00
Benoit Daloze
bfffe34ba1 ruby-build 20230919 2023-09-19 15:05:22 +02:00
Benoit Daloze
f80eb466b9 ruby-build 20230914.1 2023-09-14 18:24:20 +02:00
Hiroshi SHIBATA
1fb355bc69
ruby-build 20230914 2023-09-14 16:31:47 +09:00
João Duarte
c6e924edc8
workaround jruby#7799 by updating rubygems for JRuby 9.2.x (#2246)
Co-authored-by: Mislav Marohnić <git@mislav.net>
2023-09-12 16:08:47 +02:00
Hiroshi SHIBATA
2054401317
ruby-build 20230912 2023-09-12 07:03:32 +09:00
Benoit Daloze
97c93c6901 ruby-build 20230904 2023-09-04 20:47:19 +02:00
Mislav Marohnić
4d4678bc1e
Merge pull request #2231 from rbenv/llvm-cleanup
Remove `require_llvm` implementation
2023-08-08 10:43:56 +02:00
Mislav Marohnić
2dec28caf7
Merge pull request #2232 from rbenv/clang-cleanup
Remove `require_gcc` implementation
2023-08-04 10:53:15 +02:00
Ryan S. Northrup (RyNo)
f170c16c4a
Display the actual error when testing for Ruby's openssl extension (#2223)
I was encountering some build issues on MicroOS and needed the actual exception message in order to pinpoint a workaround.

Co-authored-by: Mislav Marohnić <git@mislav.net>
2023-08-03 16:54:27 +02:00
Mislav Marohnić
a4c6878ff5
Remove require_gcc implementation
This was only used in Ruby versions < 1.9.3, which are now EOL.

This also removes a 11-years old workaround for building Ruby 2.0 with clang.
06d7994bcf
2023-08-03 14:53:52 +02:00
Mislav Marohnić
ad1e1bc1ba
Remove require_llvm implementation
This was used by Rubinius over the years to ensure that a correct llvm version was selected from the ones available on the system, but for recent Rubinius this function is a no-op, and since Rubinius isn't an actively maintained project anymore, I don't feel strongly for keeping ruby-build workarounds that only help ancient Rubinius versions.
2023-08-03 14:34:39 +02:00