Commit graph

113 commits

Author SHA1 Message Date
Mislav Marohnić
311d96f779 Fix rbenv install --list for definitions auto-discovery
The build definitions auto-discovered from rbenv plugins would
previously not appear in `--list` results due to discovery process
taking place too late.
2014-09-06 02:57:19 -07:00
Mislav Marohnić
f8015da306 Fix output assertion
`assert_success` doesn't accept an argument via stdin
2014-09-06 02:56:39 -07: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ć
78bc84660b Auto-discovery of build definitions from rbenv plugins
The `share/ruby-build/` directory from each rbenv plugin, if it exists,
is added to RUBY_BUILD_DEFINITIONS automatically during `rbenv install`.
2014-08-18 16:08:06 -07:00
Mislav Marohnić
6847c47274 Add rbenv-install tests 2014-08-18 16:08:06 -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
Mislav Marohnić
4e2177d5c2 Add test for ruby-build definitions 2014-08-16 19:56:40 -07:00
Yamashita Yuu
07ef88d7c8 Surely update local git working copy 2014-06-07 01:27:49 +09:00
Yamashita Yuu
28dcc3f85b Add tests for fetch_git 2014-06-07 01:27:49 +09: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ć
1786cf75d2 Fix patch passed via stdin in tests
[picture of I Have No Idea What I'm Doing dog]

https://travis-ci.org/sstephenson/ruby-build/builds/23435342
2014-04-21 17:12:06 +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
Adam Harvey
2e6e100a2e Prefer ggrep for grep invocations that use GNU extensions. 2014-04-18 10:51:26 +10:00
Mislav Marohnić
a4c3dbc573 Avoid sed with extended regexp
Seems like sed 4.1.5 on RHEL 5.3 doesn't support `-E`, and sed on OS X doesn't
support `-r` to activate the extended regexp mode. Best to avoid extended regexp
altogether for compatibility.

Fixes #495
2014-04-05 21:29:38 +02:00
Mislav Marohnić
f44d7ba8c6 Add test for Rubinius gem binstubs fix
References #433
2014-04-05 21:24:46 +02:00
Jose Luis Salas
53920b0fe1 Update libyaml to 0.1.6
Security fix for CVE-2014-2525

Advisory: http://www.ocert.org/advisories/ocert-2014-003.html
2014-03-26 21:17:10 +01:00
Mislav Marohnić
1bcd249ffa Avoid re-downloading if there's a valid tarball in build location
If there already exists a valid tarball in the build location, e.g. as
artefact of a previous install using `--keep`, don't re-download the
file, as there is no need.

References #487
2014-03-25 04:15:50 +01:00
Mislav Marohnić
a3009b4641 Fix re-downloading tarball when destination file already exists
Previously, curl and wget were instructed to try to resume the download
if the destination file already exists. This is supposed to be done via
the "Range" HTTP header, but doesn't work well with CloudFront:

    HTTP server doesn't seem to support byte ranges. Cannot resume.

CloudFront is supposed to support ranges, so I don't know what's going
on here. It might be failing only in case the existing file is a fully
downloaded tarball?

In any case, this disables resuming downloads and resorts to simply
re-downloading the tarball always, overwriting the existing file.

Fixes #487
2014-03-25 03:21:27 +01:00
Mislav Marohnić
ea481d2766 Add test for JRuby+Graal 2014-02-26 01:23:25 +01:00
Colin Mattson
060f50fcd8 Improve Java 7 detection
Java on most (all?) platforms directs `-version` output to STDERR.
2014-02-17 19:44:49 -07:00
Mislav Marohnić
047953e125 Simplify Java 7 detection and error message 2014-02-10 20:11:22 +01:00
Erik Michaels-Ober
63fc2c91b0 Update libyaml to version 0.1.5
Closes https://github.com/sstephenson/ruby-build/issues/499.
2014-02-04 11:51:46 +01:00
Mislav Marohnić
55bb34235b Merge pull request #493 from eric/add-make-install-opts-variables
Add MAKE_INSTALL_OPTS for packages
2014-01-29 14:47:34 -08:00
Mislav Marohnić
6544428cc7 Test that files in share/ get installed w/ mode 644 2014-01-23 14:08:47 +01:00
Eric Lindvall
37c9a0465d Add test for MAKE_INSTALL_OPTS
Also fix the ordering of make install arguments
2014-01-22 11:55:01 -08:00
Eric Lindvall
52b275680f Add tests for RUBY_MAKE_INSTALL_OPTS= 2014-01-21 18:23:56 -08:00
Mislav Marohnić
eae699d642 Add tests for rbenv install/uninstall hooks 2014-01-05 18:59:23 +01:00
Mislav Marohnić
501855c9ac Fix stubbing programs that have dashes in them 2014-01-05 18:58:57 +01:00
Mislav Marohnić
9effc7a670 Thorougly test JRuby install process 2013-12-21 02:09:56 +01:00
Mislav Marohnić
8ebfd1d0a9 Merge branch 'apply-patch'
Closes #469
2013-12-20 19:07:34 +01:00
Mislav Marohnić
94c15a54f0 Auto-detect and link to Homebrew's readline
I thought this was not necessary, but a number of people had problems
when linking to OS X's "readline" (actually Editline wrapper):

- Some components of Pry wouldn't work
- Writing literal Unicode characters was not possible #379
- The compilation would downright fail in some cases #82 #461

Fixes #461
2013-12-12 00:03:47 +01:00
Mislav Marohnić
4351c46923 Add --patch flag to apply a Ruby patch from stdin
If `-p|--patch` flag was set while invoking `ruby-build` or
`rbenv install`, ruby-build will use `patch -p0 -i -` to apply a patch
from stdin to Ruby, Rubinius, or JRuby source code before running the
rest of `build_package_*` commands.

References #443
2013-12-11 21:16:47 +01:00
Mislav Marohnić
2fa587bcfe Fix installing Rubinius 2.0 with Ruby 1.8
Fixes #429, references rubinius/rubinius#2693
2013-11-22 14:23:44 +01:00
Mislav Marohnić
bc9adfdd5d Demonstrate that one can use RUBY_CONFIGURE to apply a patch
References #443
2013-10-30 13:05:49 +01:00
Mislav Marohnić
8b6616b8a7 Install the Rubinius bundle in isolation
Makes sure that installing Rubinius won't touch other gems outside the
build directory.
2013-10-29 14:13:34 +01:00
Mislav Marohnić
00fcf8b504 Bash here-document doesn't work with non-executable TMPDIR
Fixes https://travis-ci.org/sstephenson/ruby-build/builds/13131225
2013-10-28 00:55:35 +01:00
Mislav Marohnić
d9cd8a1ae3 Abort early if TMPDIR is non-writable or non-executable
Fixes #148
2013-10-28 00:44:15 +01:00
Mislav Marohnić
6c08c56d3a Detect number of CPU cores used for make
Alt. implementation of #401, #434
2013-10-27 22:24:12 +01:00
Mislav Marohnić
9a2c45bab6 Add ability to debug stub calls in testing
Example:

        export RAKE_STUB_DEBUG=2
2013-10-26 18:29:36 +02:00
Mislav Marohnić
51000d5e56 Add test for automatic fetching of rake gem 2013-10-26 18:28:53 +02:00
Mislav Marohnić
a6847fdd62 Reduce boilerplate in tests 2013-10-26 17:49:43 +02:00
Mislav Marohnić
c1f506dfd6 Fix unstub cleanup process for failed stubs 2013-10-26 17:43:54 +02:00
Mislav Marohnić
9aab127f75 Install Rake and Bundler in isolation when missing
Some Rubies need Rake or Bundler for the installation process. However,
since the host Ruby version might not have those gems installed, install
them in a temporary GEM_HOME and add their executables to PATH.

Fixes #426
2013-10-26 17:39:55 +02:00
Mislav Marohnić
730a8164d5 Use rake from the current bundle for Rubinius
Rake might not be available on the system, but if there is a Gemfile,
assume that it bundles rake.
2013-10-26 15:48:25 +02:00
Mislav Marohnić
f27c561388 Recursive copying fixes and tests
Use the `cp -f` flag to force unlinking non-writable files.

Closes #384
2013-10-26 08:20:44 +02:00
Mislav Marohnić
262eb1658c Clearer error message when HTTP download fails
Previously, if `http get` failed, the `download_tarball` function would
still continue since the ERR trap had no effect at that point.

Given a script in the form of `{ ... } || return 1`, the expressions
that are the part of the first group are not subject to ERR trap since
they are non-last in a chain of expressions.

However, since we still can't count on the ERR trap taking effect in
this phase, better just rewrite the function to manually abort.

Fixes #394
2013-10-26 06:32:03 +02:00
Mislav Marohnić
da840a82a1 Add test for FreeBSD gmake
Closes #293
2013-10-26 05:47:39 +02:00
Mislav Marohnić
b37427b688 Support relative path as install prefix
Fixes #110
2013-10-26 05:24:25 +02:00
Mislav Marohnić
dc054d30bf Simplify fetching tarballs in build tests
- use cache path feature to skip HTTP fetch atogether
- unified build.log
2013-10-26 05:08:19 +02:00
Mislav Marohnić
60e575ae67 Improve installer script
* Shorter.
* Preserve timestamps and permissions.
* Overwrite existing files.
2013-10-26 02:21:46 +02:00
Mislav Marohnić
5a68586740 Remove non-portable ln -h flag
Works on OS X but fails on CI.
2013-10-25 04:21:34 +02:00
Mislav Marohnić
c7851c5123 Add tests for Homebrew libyaml integration 2013-10-25 04:17:53 +02:00
Mislav Marohnić
892ac95943 Prevent glob expansion in stub patterns
When stub patterns were broken down into an array, they were
accidentally subject to glob expansion. E.g., a pattern '*' might expand
to whatever is in the current directory. This is unwanted, as we need to
preserve patterns as-is.
2013-10-25 04:14:13 +02:00
Mislav Marohnić
5b6700cbf9 Simplify stubbing commands in tests
No more awkward juggling of PATH entries and preset stubs in version
control. Commands are stubbed by symlinking the main stub from a
temporary `$TMP/bin` directory that's added once to PATH in tests.
2013-10-25 02:01:50 +02:00
Mislav Marohnić
a9a274e624 Fix broken test suite
Fixes breakage caused by curl arguments change in
d0912e4fb5
2013-10-24 00:32:55 +02:00
Sam Stephenson
d924fceee5 Test package cache 2012-11-19 23:45:00 -06:00
Sam Stephenson
d999db787e Ensure test/tmp directory exists 2012-11-19 19:25:52 -06:00
Sam Stephenson
cfe0ffe7ef Test mirror support 2012-11-19 19:21:06 -06:00
Sam Stephenson
275b2f5919 Test checksumming 2012-11-19 18:14:26 -06:00