3
0
Fork 0
forked from mirrors/nixpkgs
Commit graph

17 commits

Author SHA1 Message Date
zimbatm 7e8faf022f rubygems: 2.4.8 -> 2.5.2
Closes #11950
2016-02-26 18:02:24 +00:00
Rok Garbas dd9bad4aa4 rubygems: 2.4.1 -> 2.4.8, fixes #8492 2016-01-20 03:36:36 +01:00
Charles Strahan b6c06e216b ruby: new bundler infrastructure
This improves our Bundler integration (i.e. `bundlerEnv`).

Before describing the implementation differences, I'd like to point a
breaking change: buildRubyGem now expects `gemName` and `version` as
arguments, rather than a `name` attribute in the form of
"<gem-name>-<version>".

Now for the differences in implementation.

The previous implementation installed all gems at once in a single
derivation. This was made possible by using a set of monkey-patches to
prevent Bundler from downloading gems impurely, and to help Bundler
find and activate all required gems prior to installation. This had
several downsides:

* The patches were really hard to understand, and required subtle
  interaction with the rest of the build environment.
* A single install failure would cause the entire derivation to fail.

The new implementation takes a different approach: we install gems into
separate derivations, and then present Bundler with a symlink forest
thereof. This has a couple benefits over the existing approach:

* Fewer patches are required, with less interplay with the rest of the
  build environment.
* Changes to one gem no longer cause a rebuild of the entire dependency
  graph.
* Builds take 20% less time (using gitlab as a reference).

It's unfortunate that we still have to muck with Bundler's internals,
though it's unavoidable with the way that Bundler is currently designed.
There are a number improvements that could be made in Bundler that would
simplify our packaging story:

* Bundler requires all installed gems reside within the same prefix
  (GEM_HOME), unlike RubyGems which allows for multiple prefixes to
  be specified through GEM_PATH. It would be ideal if Bundler allowed
  for packages to be installed and sourced from multiple prefixes.
* Bundler installs git sources very differently from how RubyGems
  installs gem packages, and, unlike RubyGems, it doesn't provide a
  public interface (CLI or programmatic) to guide the installation of a
  single gem. We are presented with the options of either
  reimplementing a considerable portion Bundler, or patch and use parts
  of its internals; I choose the latter. Ideally, there would be a way
  to install gems from git sources in a manner similar to how we drive
  `gem` to install gem packages.
* When a bundled program is executed (via `bundle exec` or a
  binstub that does `require 'bundler/setup'`), the setup process reads
  the Gemfile.lock, activates the dependencies, re-serializes the lock
  file it read earlier, and then attempts to overwrite the Gemfile.lock
  if the contents aren't bit-identical. I think the reasoning is that
  by merely running an application with a newer version of Bundler, you'll
  automatically keep the Gemfile.lock up-to-date with any changes in the
  format. Unfortunately, that doesn't play well with any form of
  packaging, because bundler will immediately cause the application to
  abort when it attempts to write to the read-only Gemfile.lock in the
  store. We work around this by normalizing the Gemfile.lock with the
  version of Bundler that we'll use at runtime before we copy it into
  the store. This feels fragile, but it's the best we can do without
  changes upstream, or resorting to more delicate hacks.

With all of the challenges in using Bundler, one might wonder why we
can't just cut Bundler out of the picture and use RubyGems. After all,
Nix provides most of the isolation that Bundler is used for anyway.

The problem, however, is that almost every Rails application calls
`Bundler::require` at startup (by way of the default project templates).
Because bundler will then, by default, `require` each gem listed in the
Gemfile, Rails applications are almost always written such that none of
the source files explicitly require their dependencies. That leaves us
with two options: support and use Bundler, or maintain massive patches
for every Rails application that we package.

Closes #8612
2015-12-29 09:30:21 -05:00
Mathnerd314 eb7404d97a all-packages: Use callPackage where possible 2015-09-14 22:27:19 -06:00
Charles Strahan 3eeabc4523 more cleanup 2014-10-31 01:44:57 +00:00
Charles Strahan e4a2a7e73e simplification / refactoring 2014-10-28 04:16:14 +00:00
Joel Taylor 794740b7e3 pleasant ruby 2014-10-26 17:34:10 +00:00
Domen Kožar aa162b388d package gim-nix and document it 2014-09-12 00:26:51 +02:00
Shea Levy 44c97e02f6 Move GEM_PATH part of rubygems' setup hook to ruby
Fixes #1413

Signed-off-by: Shea Levy <shea@shealevy.com>
2013-12-26 18:38:10 -05:00
Nixpkgs Monitor 56c9ae9b1d rubygems: update from 1.8.17 to 1.8.25, potentially fixes CVE-2012-2125, CVE-2012-2126, CVE-2013-4287, CVE-2013-4363 2013-12-04 05:10:30 +02:00
Shea Levy 2fb0d1c6c7 Update ruby/rubygems
svn path=/nixpkgs/trunk/; revision=32366
2012-02-17 20:33:15 +00:00
Shea Levy df587970ce rubygems: bump
svn path=/nixpkgs/trunk/; revision=31853
2012-01-26 13:39:31 +00:00
Shea Levy a54473bc5d Use ruby 1.9 as the default
svn path=/nixpkgs/trunk/; revision=29543
2011-09-29 21:55:12 +00:00
Shea Levy 35d07a5c34 Bump rubygems
svn path=/nixpkgs/trunk/; revision=29455
2011-09-23 15:37:05 +00:00
Yury G. Kudryashov bfffc57cc6 rubygems: bump nix-ruby, more nix magic
svn path=/nixpkgs/trunk/; revision=27179
2011-05-08 09:35:31 +00:00
Yury G. Kudryashov 15333c2665 Adjust description
svn path=/nixpkgs/trunk/; revision=25655
2011-01-21 08:24:57 +00:00
Yury G. Kudryashov 9e22c7f8ab Rework ruby gems
svn path=/nixpkgs/trunk/; revision=25654
2011-01-21 08:24:52 +00:00
Renamed from pkgs/development/interpreters/ruby/gems.nix (Browse further)