nixpkgs/pkgs/applications/networking
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
..
bittorrentsync wait for filesystem before starting btsync; bump to latest package version 2015-04-23 13:09:34 +00:00
browsers w3m: use Arch patches 2015-12-25 15:26:14 -05:00
cluster ruby: new bundler infrastructure 2015-12-29 09:30:21 -05:00
copy-com mass rewrite of find parameters to cross-platform style 2015-09-06 10:26:30 +02:00
davmail davmail: 4.6.1 -> 4.7.0 2015-11-28 12:36:49 +01:00
dropbox dropbox: 3.12.5 -> 3.12.6 2015-12-23 08:36:50 -06:00
dropbox-cli dropbox-cli: 2015.02.12 -> 2015.10.28, fixes #11538 2015-12-08 02:13:11 +01:00
enhanced-ctorrent enhanced-ctorrent: Add package 2015-01-13 00:38:06 -08:00
esniper esniper: fix homepage address 2015-04-18 20:07:18 +02:00
feedreaders Convert some *Flags from strings to lists 2015-11-26 23:45:31 +01:00
ftp/filezilla filezilla: 3.14.0 -> 3.14.1 2015-10-28 17:43:41 +01:00
google-drive-ocamlfuse google-drive-ocamlfuse: 0.5.12 -> 0.5.18 2015-10-07 17:47:22 +01:00
ids Revert "Revert "Merge pull request #9543 from NixOS/staging.post-15.06"" 2015-11-14 12:32:51 -08:00
ike rename occurrences of gcc.gcc to gcc.cc 2015-01-14 20:47:49 -08:00
instant-messengers teamspeak_client: Qt 5 infrastructure update 2015-12-20 07:56:54 -06:00
iptraf change md5sum to sha256sum for a few packages 2014-10-12 16:13:21 +02:00
iptraf-ng Revert "Revert "Merge pull request #9543 from NixOS/staging.post-15.06"" 2015-11-14 12:32:51 -08:00
irc quassel_qt5: fix build with Qt 5.5 2015-09-30 10:53:52 -05:00
jmeter jmeter: fix download URL 2014-11-18 15:43:09 +01:00
linssid linssid: Qt 5 infrastructure update 2015-12-20 07:56:49 -06:00
mailreaders clawsMail: 3.13.0 -> 3.13.1 (CVE-2015-8614) 2015-12-23 18:48:38 +01:00
msmtp msmtp: 1.6.1 -> 1.6.2 2015-05-06 23:40:52 +02:00
mumble mumble: 2015-09-27 -> 2015-11-08 2015-11-10 20:08:58 -08:00
netperf netperf: update to version 2.6.0 2012-08-10 11:56:22 +02:00
newsreaders Rename 'emery' maintainer handle to 'ehmry', fixes #11493 2015-12-05 23:06:20 +01:00
nload nload: init at 0.7.4 2015-10-03 11:29:51 +01:00
notbit notbit: Update git 2015-02-11 15:23:31 -08:00
offrss offrss: fixing crossbuilding, disabling podofo in that case 2013-04-10 18:26:42 +02:00
owncloud-client owncloud: update to 1.7.1 2015-02-02 18:28:55 +01:00
p2p firestr: Qt 5 infrastructure update 2015-12-20 07:56:50 -06:00
pjsip Turn some license strings into lib.licenses values 2014-07-28 11:31:14 +02:00
remote teamviewer: init at 11.0.52520, remove older versions 2015-12-03 22:28:36 +03:00
seafile-client seafile-*: 4.0.6 -> 4.4.2 (close #10755) 2015-11-09 18:43:20 +01:00
sipcmd sipcmd: add the command-line SIP client 2015-02-18 11:52:05 +03:00
siproxd Updating siproxd to 0.8.1, and libosip. 2013-06-29 15:14:02 +02:00
sniffers wireshark: 1.12.7 -> 2.0.0 2015-11-27 05:17:26 +01:00
spideroak spideroak: 5.1.6 -> 6.0.1 2015-10-12 09:24:22 +02:00
sync lsyncd: 2.1.5 -> 2.1.6 2015-12-20 21:56:28 +01:00
umurmur umurmur: Enable shmapi 2015-05-24 16:05:08 -07:00
vnstat vnstat: fix platforms list 2015-11-03 17:32:38 -04:00
yafc yafc: update to 1.3.6 2015-10-18 22:20:07 +02:00
znc znc: 1.6.1 -> 1.6.2 2015-11-17 21:12:35 -08:00