3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/misc
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
..
abduco Replace 'with plaforms; platform' with 'platforms.platform' 2015-11-17 21:30:43 +01:00
aescrypt kill libiconvOr* 2015-02-07 20:29:28 -08:00
antimicro antimicro: Qt 5 infrastructure update 2015-12-20 07:56:36 -06:00
apparix
appdata-tools
apt-offline
arp-scan
autojump simplify convoluted path to autojump.zsh 2015-03-22 13:44:27 +08:00
autorandr
aws-mturk-clt Turn more licenses into lib.licenses style 2014-11-06 00:48:16 +00:00
bandwidth bandwidth: clang fix 2015-05-15 11:58:21 -04:00
bc
bdf2psf bdf2psf: 1.132 -> 1.134 2015-12-11 19:45:07 +01:00
bfr bfr: Build with current Perl 2015-12-04 12:19:44 +01:00
bibtool Add package 'bibtool'. 2015-01-05 09:30:20 +01:00
binwalk binwalk: remove useless dep on mtdutils 2015-11-01 12:37:52 +01:00
bmon bmon: update from 3.7 to 3.8 2015-07-29 22:36:55 +02:00
bogofilter
brltty Added BRLTTY package 2015-04-29 23:02:09 +02:00
byobu byobu: 5.87 -> 5.98 2015-11-11 11:26:10 +01:00
calamares polkit-qt: normalize package name to upstream 2015-12-20 07:56:51 -06:00
ccze Add ccze 2015-01-24 15:00:55 -08:00
clex Replace 'with plaforms; platform' with 'platforms.platform' 2015-11-17 21:30:43 +01:00
cloc fix LLVM packages to work in darwin stdenv 2015-10-05 08:46:56 -07:00
colord Another libgudev dependency 2015-09-17 17:44:59 +02:00
colord-gtk colord-gtk: update from 0.1.25 to 0.1.26 2015-10-25 18:52:17 +01:00
colord-kde kde414: build with kdelibs-4.14.12 2015-09-27 15:08:12 -05:00
contacts contacts: New expression for darwin 2015-02-12 16:58:22 -06:00
convmv
coreutils Merge recent staging built on Hydra 2015-12-05 11:11:51 +01:00
cowsay
cpulimit cpulimit: does not build on darwin (ZHF) 2015-08-04 10:40:44 +02:00
cpuminer cpuminer: update from 2.4.1 to 2.4.2 2015-06-01 20:33:43 +02:00
cpuminer-multi Rename 'emery' maintainer handle to 'ehmry', fixes #11493 2015-12-05 23:06:20 +01:00
cunit
cutecom cutecom: new expression 2015-02-19 13:34:31 +01:00
datamash New: gnu datamash 2014-10-07 19:41:31 -05:00
dbacl change md5sum to sha256sum for a few packages 2014-10-12 16:13:21 +02:00
ddate Added program ddate, discordian date. 2015-01-02 12:02:13 +00:00
ddccontrol ddccontrol*: cleanup 2015-03-16 21:47:06 +01:00
debian-devscripts debian_devscripts: 2.15.4 -> 2.15.8 2015-08-31 17:17:32 +02:00
debootstrap debootstrap: update to current stable 2015-05-26 09:52:07 +02:00
desktop-file-utils
detox Add myself as maintainer 2015-06-22 08:26:09 +02:00
diffoscope debbindiff: Rename to 'diffoscope' and update 26 -> 29 2015-08-04 09:27:33 +03:00
direnv direnv: 2.6.0 -> 2.7.0 2015-08-15 22:39:03 +01:00
disper
dmg2img
dtach dtach: fix CVE-2012-3368 2015-07-15 18:19:46 +02:00
dvtm dvtm: Update to 0.14 2015-02-22 19:39:31 +08:00
dynamic-colors dynamic-colors: init at 2013-12-28, fixes #11874 2015-12-22 02:04:06 +01:00
emv
ent ent: clang fix 2015-05-15 11:58:21 -04:00
entr entr: init at 3.2 2015-07-30 23:05:38 -07:00
ethtool ethtool: 3.18 -> 4.0 2015-06-08 17:45:31 -07:00
execline execline 2.1.2.0 -> 2.1.4.0 2015-09-23 22:23:21 -05:00
expect expect: fix Darwin linkage 2015-08-30 00:50:48 +02:00
fasd fasd: remove pandoc dep (==haskell), update revision 2015-05-22 21:50:17 +02:00
fdupes fdupes: switch to fdupes-jody patch set 2015-09-18 22:31:23 +00:00
figlet Change occurrences of gcc to the more general cc 2014-12-26 11:06:21 -06:00
file file: 5.24 -> 5.25 2015-09-22 14:30:16 -07:00
fileschanged
findutils findutils: disable test_canonicalize (close #8324) 2015-06-22 18:55:14 +02:00
flashrom flashrom: fix 4936 2014-11-11 21:53:37 +01:00
fluentd ruby: new bundler infrastructure 2015-12-29 09:30:21 -05:00
fontforge fontforge-gtk: update from 20141230 to 20150824 2015-10-25 18:52:49 +01:00
fortune fortune: fix Darwin build 2015-01-29 19:14:49 +01:00
g500-control
gbdfed
getopt Merge remote-tracking branch 'origin/darwin-clang-stdenv' into staging 2014-11-04 14:30:43 +01:00
gibo gibo: init at 1.0.4, fixes #11871 2015-12-22 02:43:24 +01:00
gnokii all-packages: Use callPackage where possible 2015-09-14 22:27:19 -06:00
gnuvd
goaccess goaccess: added geoip db 2015-11-08 12:34:19 +09:00
gparted Convert some *Flags from strings to lists 2015-11-26 23:45:31 +01:00
grc GRC: 1.7 -> 1.9 2015-04-05 18:17:07 -03:00
grub nixos trustedGRUB: add support for HP laptops 2015-12-22 03:12:30 +01:00
grub4dos grub4dos: init at 0.4.6a 2015-10-19 03:27:42 +03:00
gsmartcontrol
gummiboot Unmaintain a bunch of packages 2015-07-01 08:11:05 -04:00
hddtemp Set some meta.platforms 2015-03-20 20:04:42 +01:00
hdf5 pkgs.hdf5: Fix mpi build 2015-11-20 11:25:47 +01:00
heatseeker Revert "Revert "Merge pull request #9543 from NixOS/staging.post-15.06"" 2015-11-14 12:32:51 -08:00
heimdall Update heimdall to 1.4.1 2015-01-20 07:10:23 +01:00
i3minator i3-py: init at 0.6.4 2015-06-20 23:31:38 -06:00
idutils Fix many package descriptions 2014-08-24 22:31:37 +02:00
ipad_charge ipad_charge, simple-scan: libusb{-compat -> 1} 2015-12-17 23:51:43 +01:00
ipxe Rename 'emery' maintainer handle to 'ehmry', fixes #11493 2015-12-05 23:06:20 +01:00
ised ised: get rid of builderDefsPackage 2014-10-11 18:28:29 +02:00
jdiskreport Turn more licenses into lib.licenses style 2014-11-06 00:48:16 +00:00
kalibrate-rtl
kde-gtk-config kde414: build with kdelibs-4.14.12 2015-09-27 15:08:12 -05:00
kermit kermit: update from 8.0.211 to 9.0.302 2014-11-09 17:26:37 +01:00
keychain keychain: support Darwin as a platform 2015-08-12 11:46:56 -04:00
lbdb change md5sum to sha256sum for a few packages 2014-10-12 16:13:21 +02:00
ldapvi fixup "git-export" directory names 2015-01-13 17:46:09 +01:00
less Less builds fine on Illumos. 2015-11-16 17:20:12 +01:00
lnav lnav: init at 0.8.0 2015-11-20 15:03:20 +08:00
lockfile-progs
logstash logstash: fix bin path 2015-12-04 14:21:58 +01:00
logstash-forwarder logstash-forwarder: 20141216 -> 0.4.0 2015-08-19 13:25:44 -07:00
lolcat Add lolcat, a rainbow version of cat 2015-05-27 17:02:36 +02:00
lrzsz
makebootfat Rename 'emery' maintainer handle to 'ehmry', fixes #11493 2015-12-05 23:06:20 +01:00
man
man-db man-db: use groff from closure, not PATH 2015-12-17 23:51:43 +01:00
mates mates: init at 0.1.0 2015-10-28 17:17:23 +01:00
mbuffer mbuffer: use version variable 2015-10-31 22:57:19 +01:00
mc
mcrl
mcrl2
mcrypt
mdbtools kill libiconvOr* 2015-02-07 20:29:28 -08:00
megacli rename all occurrences of stdenv.cc.gcc to stdenv.cc.cc 2015-01-14 20:27:55 -08:00
memtest86 memtest86: update from 4.3.3 to 4.3.6 2014-09-06 18:17:14 +02:00
memtest86+ memtest86+: Make compatible with gcc5 2015-06-27 15:49:30 -07:00
minicom Fix many package descriptions 2014-08-24 22:31:37 +02:00
mktorrent mktorrent: Fix build on Darwin 2015-04-06 22:10:08 -04:00
mmv Use mirror:// URIs for ftp.debian.org 2015-05-22 10:39:27 +02:00
moreutils moreutils: 0.55 -> 0.57 2015-07-29 15:46:15 +02:00
most Fix many package descriptions 2014-08-24 22:31:37 +02:00
mpdscribble Add package: mpdscribble 2015-03-14 12:23:23 +00:00
mrtg mrtg: add 2.17.4 2014-12-06 09:05:29 +01:00
ms-sys ms-sys: 2.4.1 -> 2.5.1 2015-12-14 23:32:18 +01:00
mstflint mstflint: Add derivation 2014-09-14 19:00:25 -07:00
multitail multitail: 6.2.1 -> 6.4.2 2015-09-26 11:03:17 +02:00
mysql2pgsql Remove obsolete shebangfix script 2015-01-07 15:29:10 +01:00
ncdu ncdu: update from 1.10 to 1.11 2015-05-29 22:17:02 +02:00
ocz-ssd-guru xlibs: replace occurrences by xorg 2015-09-15 12:54:34 +02:00
openopc
opentsdb opentsdb: 2.1.0 -> 2.1.1 2015-09-29 14:26:12 +02:00
ostree ostree: Update to 2015.3 2015-01-28 10:39:02 +08:00
pal pal: 0.4.2 -> 0.4.3 2015-09-20 15:36:31 +02:00
parallel Partial revert of "parallel: 20150922 -> 20151122" 2015-11-26 11:28:17 -05:00
parcellite parcellite: 1.1.7 -> 1.1.9 2014-11-26 21:23:17 +00:00
parted parted: Fix patch 2015-02-13 14:40:58 -08:00
partition-manager
pastebinit pastebinit: fix build 2014-11-15 10:57:51 +01:00
pg_top Fix many package descriptions 2014-08-24 22:31:37 +02:00
picocom picocom: 2.0 -> 2.1 2015-10-18 17:23:51 -07:00
pipelight pipelight: remove unused inputs, use stdenv_32bit 2015-11-16 15:02:54 +01:00
pk2cmd Turn more licenses into lib.licenses style 2014-11-06 00:48:16 +00:00
plantuml plantuml: update from 7991 to 8012 2014-12-06 16:13:15 +01:00
plowshare plowshare: move from googlecode to github 2015-08-15 21:04:32 +02:00
ponysay
profile-cleaner profile-cleaner: 2.34 -> 2.35 2015-07-28 22:13:35 +01:00
profile-sync-daemon Add the Profile Sync Daemon Package & NixOS Module 2014-12-13 09:24:12 -05:00
progress cv: adopt its new name 'progress' 2015-09-06 20:57:57 +02:00
proxytunnel
pv Add myself as maintainer 2015-06-22 08:26:09 +02:00
qjoypad Don't use "with licenses;" for single licences 2015-05-28 19:20:29 +02:00
rcm rcm: Use Nix store path for RCM_LIB 2015-01-25 14:59:04 -08:00
recutils Fix many package descriptions 2014-08-24 22:31:37 +02:00
remind remind: 3.1.14 -> 3.1.15 2015-09-02 09:56:35 +01:00
renameutils
riemann-c-client riemann-c-client: update to 1.7.0 2015-05-23 18:01:51 -07:00
riemann-tools Add riemann-tools to nixpkgs 2015-06-30 17:16:51 -04:00
rkflashtool Install more rkflashtools. 2015-01-29 19:50:19 +01:00
rlwrap Set some meta.platforms 2015-03-20 20:04:42 +01:00
rmlint rmlint: 2.4.1 -> 2.4.2 2015-12-16 22:35:01 +00:00
rockbox-utility Add myself as maintainer 2015-06-22 08:26:09 +02:00
rrdtool rrdtool: 1.5.4 -> 1.5.5 2015-11-20 17:11:09 +01:00
s6-portable-utils s6-portable-utils 2.0.5.0 -> 2.0.5.2 2015-09-24 20:13:27 -05:00
scanmem scanmem: init at 0.15.2 2015-08-23 15:25:52 +02:00
screen screen: include the utmp from the apple_sdk 2015-12-18 00:12:31 -06:00
screenfetch screenfetch: add grep to PATH, closes #9088 2015-08-05 14:44:41 +02:00
sdl-jstest sdl-jstest: 20150625 -> 20150806 2015-10-15 17:07:39 +03:00
sl sl: 3.03 -> 5.02 2015-09-20 02:55:55 +03:00
slop slop: 4.1.15 -> 4.1.16 2015-09-22 01:57:11 +02:00
slsnif
smc
snapper Add package: snapper 2014-09-23 11:46:56 +02:00
stow stow: patch that removes warning for 2.2.0, closes #8513 2015-06-26 18:02:59 +02:00
sutils Fixed many descriptions 2014-11-11 14:36:34 +01:00
svtplay-dl svtplay-dl: 0.20.2015.10.25 -> 0.20.2015.11.29 2015-11-30 23:34:52 +01:00
system-config-printer
t Don't use "with licenses;" for single licences 2015-05-28 19:20:29 +02:00
t1utils t1utils: set meta.platforms = all 2015-11-06 17:26:06 +01:00
testdisk testdisk: darwin fixes 2015-10-31 21:45:23 +01:00
time Fix many package descriptions 2014-08-24 22:31:37 +02:00
timidity Convert all jack references to libjack2 2015-06-27 00:17:52 -07:00
tlp tlp: use module_init_tools, avoid recompilation for nixos 2015-12-05 00:54:09 +03:00
tmate fix reference to glibtoolize in tmate 2015-10-20 03:57:34 -07:00
tmpwatch Fix many package descriptions 2014-08-24 22:31:37 +02:00
tmux tmux: 2.0 -> 2.1 2015-10-20 23:04:39 -07:00
tmux-cssh tmux-cssh: init at 21750733c5b6fa2fe23b9e50ce69d8564f2f742a 2015-11-07 16:47:52 +00:00
tmuxinator Don't use "with licenses;" for single licences 2015-05-28 19:20:29 +02:00
toilet toilet: init at 0.3 2015-09-26 21:04:15 +02:00
trash-cli Missed gcc refs 2014-12-26 12:28:15 -05:00
ttf2pt1
ttfautohint Add ttfautohint: an automatic hinter for TrueType fonts 2015-02-15 22:32:15 +01:00
ttmkfdir
tty-clock New package: tty-clock-0.1 2014-09-28 13:05:58 +02:00
ttylog ttylog: 0.25 -> 0.26 2015-06-18 22:52:44 -07:00
ttyrec ttyrec: init at 1.0.8 2015-11-15 11:26:56 +01:00
txt2man
umlet umlet 13.2 → 13.3 2015-08-27 17:14:54 +02:00
unclutter x11: replace its usage by xlibsWrapper directly 2015-09-15 12:08:24 +02:00
units units: add readline dependency 2015-12-14 18:34:54 +01:00
urjtag urjtag: enable various features 2015-09-23 21:03:11 +02:00
usbmuxd usbmuxd: update to 1.1.0 2015-04-29 17:46:14 -05:00
uucp
vdirsyncer vdirsyncer: 0.7.0 -> 0.7.3 2015-11-05 23:40:25 +01:00
venus python: get rid of ssl module as it's always builtin 2014-10-11 20:23:51 +02:00
vfdecrypt fix: add missing versions 2015-06-04 23:34:14 +03:00
vmtouch vmtouch: git-20150310 -> 1.0.2 2015-12-14 12:36:15 -08:00
vorbisgain vorbisgain: update from 0.34 to 0.37 2015-01-22 19:15:08 +01:00
wv
wv2
wyrd Fix wyrd to compile with ocaml 4.02 2015-07-23 19:50:01 +02:00
xapian-omega xapian-omega: init at 1.2.21 2015-12-04 17:53:21 +00:00
xburst-tools
xclip x11: replace its usage by xlibsWrapper directly 2015-09-15 12:08:24 +02:00
xdaliclock xdaliclock: replace use of builderDefsPackage 2015-08-27 16:44:23 +02:00
xdo transformed meta.maintainers of some packages into lists 2014-09-13 13:52:02 +02:00
xdummy
xflux fix: add missing versions 2015-06-04 23:34:14 +03:00
xmltv
xsel x11: replace its usage by xlibsWrapper directly 2015-09-15 12:08:24 +02:00
xtitle transformed meta.maintainers of some packages into lists 2014-09-13 13:52:02 +02:00
xvfb-run
yad Fix many package descriptions 2014-08-24 22:31:37 +02:00
yank yank: 0.4.1 -> 0.6.0, fixes #11522 2015-12-07 15:25:50 +01:00
youtube-dl youtube-dl: 2015.11.19 -> 2015.11.24 2015-11-25 08:28:20 +01:00
yubico-piv-tool yubico-piv-tool: 0.1.6 -> 1.0.2 2015-09-18 14:52:51 -07:00
yubikey-personalization yubikey-personalization: 1.17.1 -> 1.17.2 2015-09-23 12:30:00 -07:00
yubikey-personalization-gui yubikey-personalization-gui: 3.1.20 -> 3.1.21 2015-09-18 14:52:51 -07:00
zsh-navigation-tools zsh-navigation-tools: 1.3.2 -> 1.4 2015-12-17 18:28:35 +01:00