Commit graph

175 commits

Author SHA1 Message Date
Mislav Marohnić
4cc9dc3be8
appease linter 2023-03-06 19:19:31 +01:00
Mislav Marohnić
4079aa75cd
add stub_repeated test helper 2023-03-06 19:15:49 +01:00
Roman Usherenko
40af31b46b
automatically detect and use Homebrew's libyaml
Co-authored-by: Mislav Marohnić <git@mislav.net>
2023-03-06 19:14:40 +01:00
Masato Ohba
46878c9646
Remove brew update instruction (#2151)
because `brew update` runs automatically on `brew upgrade` by default since long time ago.
2023-02-20 16:00:59 +01:00
Mislav Marohnić
7de903c560
Fix rbenv install --list exit status 2022-10-03 13:28:58 +02:00
Mislav Marohnić
cde170b581
Suggest rbenv global if there is no explicit global setting (#2052)
Upon installing their first Ruby version on the system, the user may want to set it as their default; otherwise the default will remain "system" and any `gem install` attempts will fail with a permission error.

This suggestion is skipped if the user already has chosen an explicit default, even if it's "system".
2022-09-25 11:20:43 +02:00
Jean Boussier
1f9b792168 macOS: Use GMP from homebrew
MRI's BigInt use GMP under the hood if available, and if not
fallbacks to an homemade implementation with much worse performance.

Without GMP:
```
>> Benchmark.realtime { Integer('1' * (10 ** 7)) }
=> 13.80743500002427
```

With GMP
```
>> Benchmark.realtime { Integer('1' * (10 ** 7)) }
=> 0.4098639999865554
```

macOS not being a common production platform, it's not a huge deal
but it would still preferable to compile with `gmp.h` if present.

I'd also suggest to print a warning if compiling on macOS and gmp
isn't installed, but I don't know if it's desirable.

NB: `--with-gmp-dir` was only added recently, so this will only
apply to MRI >= 3.2, as well as rubies on which this flag was backported.
2022-09-22 08:56:34 +02:00
Benoit Daloze
a753b24551 Show the log file to make it easy to follow progress
* Fixes https://github.com/rbenv/ruby-build/issues/1721
2022-08-06 13:04:40 +02:00
Benoit Daloze
e607953dbf Fix version check for Java 17
* Fixes https://github.com/rbenv/ruby-build/issues/1798
* OpenJDK 17 reports:
  $ java -version
  openjdk version "17" 2021-09-14
  There is no dot in the version, so we need to only use the first match from grep -o.
* Clarify it is a minimum required java version, not an exact version.
2021-09-28 12:42:07 +02:00
Benoit Daloze
ac72249e04 Ensure it is safe to remove the prefix path for TruffleRuby or error
* Only do clean_prefix_path for TruffleRuby and rename for clarity,
  since the logic is now TruffleRuby-specific.
2021-07-26 17:44:28 +02:00
Benoit Daloze
44729b287f Handle multiple directories in PATH having an executable for remove_commands_from_path
* This is common on Linux where e.g. /bin = /usr/bin and both are in PATH.
2021-07-07 20:04:22 +02:00
Hiroshi SHIBATA
99f6bcbe49
Merge pull request #1457 from uzxmx/feature/specify-complete-mirror-url
Support specifying the complete mirror URL
2020-12-03 15:14:46 +09:00
Benoit Daloze
30895f03c4 Rename definition to truffleruby+graalvm
* '+' needs to be considered part of the name for --definitions and -l
  to see truffleruby and truffleruby+graalvm as separate.
2020-07-22 16:41:01 +02:00
Benoit Daloze
767a1ccc30 Add support for installing GraalVM
* Supports using other GraalVM languages such as JavaScript, Python, R and Java.
* Supports running TruffleRuby on JVM and not only Native.
* Add GraalVM 20.1.0.
2020-07-22 16:41:01 +02:00
Mingxiang Xue
b034b8cd37 Add RUBY_BUILD_MIRROR_PACKAGE_URL to specify the complete mirror URL
Signed-off-by: Mingxiang Xue <mingxiangxue@gmail.com>
2020-07-18 00:36:59 +08:00
Koichiro Iwao
e2b65f5dd5 Merge branch 'master' into list-exclude-eol 2020-04-27 11:20:31 +09:00
Koichiro Iwao
c76bf6fb80
s/all available definitions/all local definitions/
"available" implies ruby-build will be checking online sources but
actually ruby-build doesn't do that. "local definitions" may be
prefered.

Pointed out by jasonkarns.
2020-03-20 18:08:04 +09:00
Koichiro Iwao
66647e3953
s/all built-in definitions/all available definitions/
Suggested by mislav: https://github.com/rbenv/ruby-build/pull/1402#discussion_r389060742

> I wonder should we substitute "built-in" with something like "all
> available definitions". Since ruby-build will additionally pick up
> definitions found under the paths listed in RUBY_BUILD_DEFINITIONS,
> these definitions will get listed even if they are not "built-in".
> Therefore, "built-in" feels like a misnomer here.
2020-03-19 18:16:16 +09:00
Koichiro Iwao
67ac0b45d6
the short list now shows only latest stable versions
for each Ruby implementations like the following.

    2.4.9
    2.5.7
    2.6.5
    2.7.0
    jruby-9.2.9.0
    maglev-1.0.0
    mruby-2.1.0
    rbx-3.107
    truffleruby-19.3.1
2020-03-06 22:23:46 +09:00
Koichiro Iwao
abaebf3ea1
Fix CI 2020-03-03 15:44:02 +09:00
Koichiro Iwao
f9aae4e6ff
Fix CI 2020-02-19 11:13:35 +09:00
eladeyal-intel
1e94192659 shorter git command chains 2020-01-31 17:23:02 +02:00
Koichiro Iwao
4577be8fac
Fix CI: Add --list-exclude-eol option to test 2020-01-30 15:36:26 +09:00
Benoit Daloze
08af628396 Add a few extra examples for the version sorting test 2019-11-21 16:41:12 +01:00
Mislav Marohnić
d6af53ef1c Fix test for gmake on FreeBSD 2019-11-20 10:56:16 +01:00
Mislav Marohnić
ed46d03947 Include header files with mruby
Fix #1311
2019-11-05 11:03:49 +01:00
Mislav Marohnić
8945b5721f Add tests for different styles of patches 2019-11-05 09:48:22 +01:00
Mislav Marohnić
e2b1da83bb Assert error shown when curl, wget, & aria2c are unavailable
Closes #1234
2019-11-04 14:48:46 +01:00
Mislav Marohnić
fe5986d649 Fix rbenv install --list test 2019-11-04 14:48:46 +01:00
Mislav Marohnić
c30d4cba91 Fix verifying Java 9+ versions
Ref. #1135
2019-11-02 13:09:38 +01:00
Jason Karns
dc15799456
Only FreeBSD needs extra PATH for bash
For the tests to run on FreeBSD, the bash executable needs to be
available in PATH.

The test_helper PATH was modified by
49a9471758 and f70d958f47
in order to be sure that bash is in PATH on FreeBSD.
(The default location for packages on FreeBSD is /usr/local/bin, and
since bash isn't provided by FreeBSD itself, that means /usr/local/bin
is the most common, if not only, location to find bash on FreeBSD.)

However, adding /usr/local/bin to PATH means that homebrew-managed
packages on macOS are now in PATH for the test suite. This is especially
important due to packages like readline. Since ruby-build prefers
homebrew readline when available, this makes the tests fail on macOS
(because the tests are written assuming no readline configuration.)

While the tests could stub brew in all cases, to ensure the readline
package is ignored by the tests, it seems more prudent to revert the
PATH to be as minimal as possible, and to only include /usr/local/bin by
precisely the OS that depends on it.
2018-11-12 14:26:56 -05:00
Mislav Marohnić
9219a43caf
Merge pull request #1198 from yyuu/http-client-based-on-envvar
Allow overriding HTTP client type based on environment variable of `RUBY_BUILD_HTTP_CLIENT`
2018-08-22 11:27:06 +00:00
Mislav Marohnić
655c13b57e Allow aria2c to be found in PATH in tests 2018-08-22 12:50:02 +02:00
Benoit Daloze
0ec626bc4d Remove early check for LLVM when installing TruffleRuby
* TruffleRuby already checks for LLVM itself when it needs it and
  looks up more paths to find the LLVM executables clang and opt.
* See https://github.com/oracle/truffleruby/issues/1386.
2018-07-14 22:39:37 +02:00
Benoit Daloze
a8a3ebf809 Add tests for TruffleRuby 2018-06-15 20:17:13 +02:00
Yamashita, Yuu
34652a4fae Allow overriding HTTP client type based on environment variable RUBY_BUILD_HTTP_CLIENT (pyenv/pyenv#1126) 2018-04-26 02:08:59 +00:00
SHIBATA Hiroshi
331a408adc
Merge pull request #1136 from juanibiapina/relax-java-version-regexp
Relax java version regexp
2017-11-27 15:26:35 +09:00
SHIBATA Hiroshi
f41e8474a8
ubygems.rb is unavailable on Ruby 2.5 2017-10-12 11:57:46 +09:00
Juan Ibiapina
4889ec7ca6 Relax java version regexp
This allows the java version to be specified as "9", instead of "1.9".

Closes #1135
2017-10-09 12:54:13 +02:00
Ivan Kuchin
cb84607d3e fix ordering for versions with different length patch number (nothing, p72, p375) 2017-02-25 15:48:03 +01:00
Ivan Kuchin
e35d7a59ab remove quotes preventing from iterating over each version in sort versions test 2017-02-25 15:48:03 +01:00
SHIBATA Hiroshi
6df6ab470f Merge pull request #1051 from yuichiro-naito/add_test_of_freebsd_11
Add test of FreeBSD-11.
2017-02-03 16:54:32 +09:00
Yuichiro NAITO
ea90779a98 Add test of FreeBSD-11. 2017-01-27 10:49:56 +09:00
Yuichiro NAITO
e38155a6da Fix to build with gcc on FreeBSD 2017-01-18 11:02:37 +09:00
Yuichiro NAITO
f70d958f47 Do not include whole $PATH.
'/usr/local/bin' is used for bash on FreeBSD.
It is the default install path of FreeBSD packages.
2016-12-23 00:55:15 +09:00
Yuichiro NAITO
0a347a4537 stub uname for Non Linux environment 2016-12-21 10:52:25 +09:00
Yuichiro NAITO
49a9471758 respect original PATH 2016-12-21 10:51:15 +09:00
Yuichiro NAITO
4dc6d7d7a4 add stub uname value for use_freebsd_pkg function 2016-11-24 17:50:09 +09:00
Yuichiro NAITO
646bb47b81 add stub uname default value 2016-11-24 16:12:00 +09:00
Jason Karns
21494ba359 Remove suite-wide setup
Bats doesn't support both suite-wide setup (in helper) *and* file-wide
setup. Which means the existance of any file-level setup() function
overwrites any setup() function from test_helper. This can be confusing,
and (IMO) easier to simply avoid the overwriting and remove any
_implied_ suite-wide setup function from test_helper.

This turns out to not be so bad for the recently added setup function,
because the only test files that actually need aria2c removed from PATH
are those that actually invoke curl. These can be found because they are
the only test files that stub curl; half of which already had
file-specific setup() functions. So the only ones which need a
file-local setup() function added were: checksum.bats and mirror.bats

Along these lines, rbenv.bats and hooks.bats were removing aria2c from
PATH but don't actually need to. (curl isn't stubbed in these tests so
the existance of aria2c wouldn't affect the tests)

Lastly, fixed a tab/spaces whitespace mixup that was introduced by:
750c086d11
2016-08-13 15:53:04 -04:00