Commit graph

301 commits

Author SHA1 Message Date
David Bayendor
54301c16bf Don't display duplicate definitions
This fixes `rbenv install -l` displaying each version twice due to
RUBY_BUILD_DEFINITIONS path containing ruby-build's own definitions path
twice: both as an rbenv plugin and by appending its own internal path.
2014-10-28 19:27:26 +01:00
Mislav Marohnić
194e007e62 Merge branch 'yosemite'
Fixes #651, fixes #648
2014-10-28 18:52:50 +01:00
Mislav Marohnić
b3512f494e Avoid endless recursion when rbx is installed over existing one
When installing rbx over an existing location, the `gems/bin` directory
will already be a symlink to `bin/` and an attempt to recreate this will
end up in recursion that keeps growing a binstub file until the disk is full.
2014-10-28 15:41:09 +01:00
Mislav Marohnić
985200d4da Enable Rubinius builds to re-use cached LLVM dependencies between builds
If RUBY_BUILD_CACHE_PATH is set (typically "`rbenv root`/cache" if it
exists), have Rubinius `./configure` script download prebuilt LLVM
versions into that directory and re-use them if already present.
2014-10-28 15:41:09 +01:00
Mislav Marohnić
f104098909 Fix rbx-1.2.4 setup phase
Rubinius back then didn't have a Gemfile, so don't try to invoke `bundle`.
Instead, rely on the host Ruby to already have rake installed.
2014-10-28 15:41:09 +01:00
Mislav Marohnić
9a5256ed7a Work around Rubinius LLVM incompatibilities on Yosemite
Rubinius fails to download a prebuilt LLVM on Yosemite since one is not
available yet. Instead, download the prebuilt version for the previous
OS X release.

This fixes Rubinius 2.2.7+ builds, but the older ones still fail for me
on Yosemite. This could be due to the fact that they're old releases
which are not compatible with never dependencies on the system.
2014-10-28 15:41:09 +01:00
Mislav Marohnić
b396ad7cd1 Try openssl from Homebrew when calculating SHA-256 checksums
This makes checksums possible on Leopard where `shasum` is unavailable
and system openssl doesn't support `dgst -sha256`.

Fixes #656
2014-10-28 15:28:48 +01:00
Mislav Marohnić
6e39eb52a8 Use CC=clang by default on Yosemite to avoid gcc-4.2
Newer MRIs will pick up gcc-4.2 from PATH and use that instead of
`/usr/bin/gcc`. While this worked up till now, it will not work in
Yosemite anymore since Homebrew's apple-gcc42 is generally not
compatible with 10.10.

So when CC has not explicitly been set, set it to `clang` to avoid
searching the PATH for any other gcc versions. This fixes MRI builds on
systems where apple-gcc42 is installed.
2014-10-28 15:28:07 +01:00
Mislav Marohnić
dafba300b1 Silence warnings when testing gccs
This silences the warning that gcc-4.2 produces on Yosemite:

    couldn't understand kern.osversion `14.0.0'
2014-10-28 10:59:01 +01:00
Mislav Marohnić
10fd04909d Fix Yosemite builds that use gcc-4.2 through require_gcc
The definitions that use `require_gcc` are not compatible with Apple's
clang-powered `gcc` and need gcc-4.2 from Homebrew. However, builds
using gcc-4.2 fail on Yosemite with a warning:

    couldn't understand kern.osversion `14.0.0'

Although the warning is non-fatal, the build goes to shit from there. It
seems that setting the magical value `MACOSX_DEPLOYMENT_TARGET=10.9`
makes the build work and doesn't seem to have negative consequences.
2014-10-28 10:58:38 +01:00
Matthew Van Gundy
aaf8a852ff Fix TMPDIR noexec check to explicitly exit with a zero exit status on success
The TMPDIR check implemented in a4556a73 incorrectly reports that
TMPDIR cannot hold executables on 4.3.11(1) on Ubuntu 14.04.1 LTS.
This is because a script containing no commands returns a non-zero
exit code.  Contrast the following:

  bash 3.2.53(1) on OS X 10.9.5:

    $ bash -c '' && echo SUCCESS
    SUCCESS

  bash 4.3.11(1) on Ubuntu 14.04.1 LTS:

    $ bash -c '' || echo FAIL
    FAIL

This patch modifies the test script to explicitly call `exit 0` to
ensure that a successful exit code is returned if the script executes
successfully.
2014-10-17 11:15:42 -04:00
SHIBATA Hiroshi
803a49a831 Merge pull request #593 from azet/patch-1
Disable insecure SSL protocols
2014-10-16 08:39:56 +08:00
Erik Michaels-Ober
e1811b9fa3 ruby-build 20140926 2014-09-26 06:07:57 +04:00
Mislav Marohnić
04fe8ab73c Merge pull request #516 from docwhat/better-openssl-check
OS X: Fixes check for OpenSSL version

Fixes #606
2014-09-20 00:35:57 -06:00
Mislav Marohnić
a8b23fac56 ruby-build 20140919 2014-09-19 09:04:50 -06:00
Erik Michaels-Ober
498062cd0d ruby-build 20140918 2014-09-18 12:40:13 +02:00
Mislav Marohnić
406d745f50 Peruse /etc/os-release among others when detecting system info
On Fedora, this results in a nice "Fedora 19" identifier and doesn't
show the codename "Schrödinger’s Cat" which is otherwise contained in
`/etc/fedora-release`.

On Arch, this shows "Arch Linux" where previously we had no info for it
(for some reason, `/etc/arch-release` is empty).

http://www.freedesktop.org/software/systemd/man/os-release.html
2014-09-08 22:58:05 -07:00
Mislav Marohnić
512910a675 ruby-build 20140908 2014-09-08 13:49:41 -07:00
Mislav Marohnić
0170728de9 Merge pull request #630 from sstephenson/freebsd-make
On FreeBSD 10, stop defaulting to MAKE=gmake
2014-09-08 13:38:01 -07:00
Mislav Marohnić
323c2b778b Sort Ruby versions when listing available definitions
Stable releases should now be sorted as a higher version than preview
releases or RCs. For instance:

- 1.9.3-preview < 1.9.3-rc1 < 1.9.3-p0
- 2.1.0-dev < 2.1.0-rc1 < 2.1.0
- jruby-1.7.0-preview1 < jruby-1.7.0-rc1 < jruby-1.7.0
2014-09-08 13:06:48 -07:00
Mislav Marohnić
a4556a7346 Verify that TMPDIR can hold executables before installing
This detects when `/tmp` has been mounted with "noexec" mode and avoids
the cryptic error:

  ./configure: Permission denied

Hopefully the information provided will be enough for the user to know
that they have to change TMPDIR to another location.
2014-09-08 10:43:57 -07:00
Mislav Marohnić
60a5abeb3d Fix stripping away non-digits from OS release number 2014-09-08 10:05:17 -07:00
Mislav Marohnić
0e58079d66 On FreeBSD, stop defaulting to MAKE=gmake
It appears that regular `make` that ships on FreeBSD 10 is compatible
enough to build Rubies. This enables ruby-build on fresh FreeBSD
installs (which don't have `gmake` by default) without having to
explicitly set `MAKE=make`.
2014-09-08 09:52:15 -07:00
Mislav Marohnić
f4c2fe67e3 Fix detecting of CPU cores on FreeBSD
On FreeBSD, use the same approach as OS X with `sysctl`.
2014-09-08 09:11:39 -07:00
Mislav Marohnić
4463320e81 Print OS information on build failure
This is useful info for when someone is pasting build output to our
issue tracker seeking support.
2014-09-06 02:20:39 -07:00
Mislav Marohnić
95964b17f1 Highlight output that mentions path to full build log
People often miss that and think that the last 10 lines of build output
is the only information they got.
2014-09-06 02:17:11 -07:00
Mislav Marohnić
17cb1ed6af Prevent "BUILD FAILED" appearing twice on ./configure error
Since `./configure` executes in a bash subshell, it failing would
execute the ERR trap twice: once in a subshell and once in the main
process. An explicit `return 1` skips one of these ERR traps and fixes
double output.

I hope.

[image of I Have No Idea What I'm Doing dog]
2014-09-06 01:29:28 -07:00
Mislav Marohnić
0bdd502ba8 Indicate ruby-build version number on build failures
This might save us from having to ask people which version they have
installed when they paste us build output from the console.
2014-09-06 01:23:17 -07:00
Mislav Marohnić
2f51dee3f0 Print configure options when openssl ext failed to compile
This helps to debug whether `--with-openssl-dir` was used properly.
2014-09-05 16:56:48 -07:00
Mislav Marohnić
1fa109ceb1 Don't log files as they're extracted from tarball
The `-v` option for tar has been here since the beginning of ruby-build,
but it's not really informative to see a list of files in the log as the
list of files is guaranteed to be the same across machines since we do
checksums.
2014-09-05 16:56:48 -07:00
Erik Michaels-Ober
7a17175fc9 ruby-build 20140905 2014-09-05 15:31:01 +02:00
Mislav Marohnić
e8e77e6028 Read ruby-build revision from git if available
But don't assume that RUBY_BUILD_ROOT is where ruby-build's own files
reside, since RUBY_BUILD_ROOT can be overriden with alternate definition
files location.
2014-08-25 17:54:33 -07:00
Mislav Marohnić
f118b173af Extra definitions paths via RUBY_BUILD_DEFINITIONS
This is a colon-separated list of directories that will get searched for
build definition in order from left to right.
2014-08-17 12:20:53 -07:00
Mislav Marohnić
ff75ca7204 Support changing RUBY_BUILD_ROOT
This is to allow specifying an alternate path where `share/ruby-build/*`
definitions reside. Useful in tests as well.
2014-08-17 12:20:53 -07:00
Erik Michaels-Ober
c819790848 ruby-build 20140702 2014-07-02 08:37:09 +02:00
Aaron Zauner
d4e4eaeccd Disable insecure SSL protocols
SSLv2 and v3 have serious protocol flaws. They should be disabled by default. This is also what most distributions do and is recommended by the OpenSSL wiki: http://wiki.openssl.org/index.php/Compilation_and_Installation
2014-06-27 14:51:20 +02:00
Yamashita Yuu
07ef88d7c8 Surely update local git working copy 2014-06-07 01:27:49 +09:00
Yamashita Yuu
01e8767560 Fix fetch_git with --keep
Update existing git repo if exists, or clone if not exists.
The destination repo might exist if the `--keep` was supplied for `ruby-build`.
2014-06-07 01:27:49 +09:00
Mislav Marohnić
273be046b1 ruby-build 20140524 2014-05-24 22:41:15 +07:00
Mislav Marohnić
5dc9233199 Merge remote-tracking branch 'origin' into shasum 2014-05-23 14:40:48 +07:00
Thomas Johansen
b4154d11e8 Re-introduce legacy MD5 checksum verification based on checksum length
This is so any 3rd-party definitions continue to work even if they have
MD5 checksums embedded.
2014-05-23 14:39:41 +07:00
Thomas Johansen
fb5e2b1ae6 Replace MD5 commands with SHA2 equivalents
A more secure hashing algorithm makes it less feasible to serve up a
modified tarball that matches the same checksum.

See the discussion in #548
2014-05-23 14:34:37 +07:00
Mislav Marohnić
c79dcb379e Merge branch 'patch-galore' 2014-05-23 14:14:53 +07:00
SHIBATA Hiroshi
846cad88ee Revert "Merge pull request #535 from Fleurer/patch/1"
This reverts commit d45f145197, reversing
changes made to 13de51105b.
2014-05-12 10:15:53 +09:00
Erik Michaels-Ober
6da69089fb ruby-build 20140509 2014-05-09 01:15:24 +02:00
SHIBATA Hiroshi
d45f145197 Merge pull request #535 from Fleurer/patch/1
link the latest log to /tmp/ruby-build.latest.log
2014-05-06 18:17:23 +09:00
Chris Seaton
6953313c04 Make the downloading message print the actual file name, not just the package name plus .tar.gz. 2014-04-26 16:15:10 +01:00
Mislav Marohnić
210ceef8a3 More portable invocation of mktemp
`mktemp -t ruby-patch`, although working on OS X, fails on Travis CI
with the message "too few X's in template".

https://travis-ci.org/sstephenson/ruby-build/builds/23436088
2014-04-21 17:24:11 +02:00
Mislav Marohnić
c76cde673e Make --patch compatible with git diff patches
Filenames in git diff patches are prefixed by default by "a/" (source)
and "b/" destination. Such patches don't work with ruby-builds `--patch`
option since it internally uses `patch -p0`.

Prior workarounds were to use either an intermediate step:

    filterdiff --strip=1

or to generate the patch without the prefix in the first place:

    git diff --no-prefix ...

Now, git diff patches are detected by searching for this pattern:

    diff --git a/...

And `patch -p1` is used by default in such cases to strip the 1st
component of filename paths.

Fixes #521, closes #484
2014-04-21 16:01:06 +02:00
Mislav Marohnić
74b21936a1 Use patch --force to ignore missing files when patching
From patch(1):

    -f  or  --force
       Assume that the user knows exactly what he or she is doing, and do  not
       ask any questions.  Skip patches whose headers do not say which file is
       to be patched; patch files even though they have the wrong version  for
       the Prereq: line in the patch; and assume that patches are not reversed
       even if they look like they are.  This option does not suppress commen-
       tary; use -s for that.

Fixes #555
2014-04-21 15:32:34 +02:00