3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/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
..
3dfsb
abook
acbuild acbuild: 0.1.1 -> 0.2.2 and moved to own default.nix, fixes #11889 2015-12-23 01:33:37 +01:00
adobe-reader
apvlv
artha
audio
avrdudess
batti
bibletime
bleachbit
blender
calcurse
calibre calibre: Qt 5 infrastructure update 2015-12-20 07:56:47 -06:00
camlistore
cbatticon cbatticon: use fetchzip to fix sha256 issues 2015-12-07 10:24:38 +00:00
cdrtools cdrtools: 3.00 -> 3.02a03 2015-12-13 15:13:43 +03:00
cgminer
cherrytree
chirp
clipit
cmatrix
cool-retro-term
copyq copyq: init at 2.5.0, fixed #11887 2015-12-23 01:58:59 +01:00
cortex
ctodo
cura
curaengine
d4x
dbvisualizer
devilspie2
dfilemanager dfilemanager: Qt 5 infrastructure update 2015-12-20 07:56:48 -06:00
diffpdf
direwolf
djvulibre
dmenu dmenu: 4.5 -> 4.6 2015-11-10 09:57:17 +01:00
dmenu2 Replace 'with plaforms; platform' with 'platforms.platform' 2015-11-17 21:30:43 +01:00
doomseeker doomseeker: cleanup 2015-12-13 15:14:18 +03:00
dunst
eaglemode Replace 'with plaforms; platform' with 'platforms.platform' 2015-11-17 21:30:43 +01:00
electrum Rename 'emery' maintainer handle to 'ehmry', fixes #11493 2015-12-05 23:06:20 +01:00
emem emem: init at 0.2.11 2015-11-25 03:09:16 +08:00
epdfview
evilvte
evopedia
evtest
fbreader
fetchmail
finalterm Replace 'with plaforms; platform' with 'platforms.platform' 2015-11-17 21:30:43 +01:00
fme
freemind
freicoin
galculator
gammu
garmin-plugin
get_iplayer
girara
gkrellm
gksu
gmrun
gnuradio gnuradio: 3.7.8 -> 3.7.8.1 2015-11-06 15:05:53 +01:00
gnuradio-nacl gnuradio-nacl: init at 2015-11-05 2015-11-05 21:17:39 +01:00
gnuradio-osmosdr
goldendict goldendict: b4bb1e9 -> ec86516 2015-12-10 23:51:07 +06:00
googleearth
gosmore gosmore: once more fix broken hash and disable externals for now to prevent further breakage 2015-12-14 15:33:51 +00:00
gpa
gphoto2 gphoto2fs: reimplement using mkDerivation 2015-11-24 14:45:15 +01:00
gpsbabel gpsbabel: Qt 5 infrastructure update 2015-12-20 07:56:48 -06:00
gpscorrelate
gqrx
gramps
grip
gtk2fontsel
gv
gxmessage
gxneur
hackrf
hamster-time-tracker
hello
hstr
htmldoc
ikiwiki
jbidwatcher
jekyll ruby: new bundler infrastructure 2015-12-29 09:30:21 -05:00
jigdo
jp2a
k2pdfopt
k3b
kdbplus
kde-wacomtablet
kdeconnect
keepass keepass: load plugins from store paths, fixes #11206 2015-12-23 02:12:36 +01:00
keepass-plugins/keefox Keefox (keepass plugin): init at 1.5.4 2015-12-23 02:12:15 +01:00
keepassx Merge pull request #11850 from rycee/bump/keepassx 2015-12-21 08:05:35 +01:00
keybase Replace 'with plaforms; platform' with 'platforms.platform' 2015-11-17 21:30:43 +01:00
kgocode added kgocode 2015-12-06 19:43:25 +01:00
khal khal: update 0.6.0->0.7.0 2015-12-14 02:05:01 +01:00
khard
kiwix
krename
krusader
librecad
lilyterm
llpp
loxodo
lxappearance
lyx
makeself
mdp
mediainfo mediainfo: 0.7.79 -> 0.7.80 2015-12-19 16:33:50 +00:00
mediainfo-gui mediainfo: 0.7.79 -> 0.7.80 2015-12-19 16:33:50 +00:00
merkaartor
monero Rename 'emery' maintainer handle to 'ehmry', fixes #11493 2015-12-05 23:06:20 +01:00
mrxvt
multimon-ng
multisync
mupdf mupdf: propagate needed libraries 2015-11-25 18:30:41 +03:00
mysql-workbench
nanoblogger
navipowm
navit
notify-osd
nut
ocropus buildPythonPackage: fix a few more wheel packages 2015-11-21 21:44:12 +01:00
open-pdf-presenter
openbox-menu
openjump
orpie
pcmanfm
pdfdiff
pdfmod pdfmod: init at 0.9.1 (close #11417) 2015-12-21 15:19:36 +01:00
pdfpc pdfpc: 4.0.0 -> 4.0.1 2015-11-20 17:07:08 +01:00
pgadmin
pinfo
pitz
playonlinux fix eval 2015-12-14 21:12:51 +01:00
posterazor
printrun buildPythonPackage: fix standalone applications using it 2015-11-21 21:44:12 +01:00
procmail
pstree
pwsafe
pytrainer buildPythonPackage: fix standalone applications using it 2015-11-21 21:44:12 +01:00
qpdfview
qtbitcointrader Rename 'emery' maintainer handle to 'ehmry', fixes #11493 2015-12-05 23:06:20 +01:00
qtpass qtpass: Qt 5 infrastructure update 2015-12-20 07:56:47 -06:00
ranger ranger: fix paths to w3m and share 2015-11-23 22:24:00 +01:00
redshift redshift: depend on geoclue2 directly 2015-12-10 02:38:42 +01:00
rescuetime
robomongo robomongo: Qt 5 infrastructure update 2015-12-20 07:56:48 -06:00
rofi rofi-pass: 1.2 -> 1.3.1 2015-12-04 17:24:56 +01:00
roxterm
rsibreak
rtl-sdr
rtv rtv: 1.6.1 -> 1.7.0 2015-12-10 22:07:15 +06:00
rxvt
rxvt_unicode
rxvt_unicode-plugins
sakura
sbagen
scim
sdcv
semnotes
sent sent: 0.1 -> 0.2 2015-11-25 12:18:15 +01:00
slic3r
slmenu
spacefm spacefm: 1.0.1 -> 1.0.4 2015-11-21 16:50:56 +00:00
sqliteman
st Replace 'with plaforms; platform' with 'platforms.platform' 2015-11-17 21:30:43 +01:00
stag
stardict
super_user_spark super-user-spark: 0.1.0.0 -> 0.2.0.3 2015-12-13 20:26:09 -05:00
surf
sweethome3d
synapse
synergy
tangogps
taskjuggler
tasknc
taskwarrior
terminal-notifier Replace 'with plaforms; platform' with 'platforms.platform' 2015-11-17 21:30:43 +01:00
terminator
termite
thinking-rock
tilda
tint2
tpmmanager
truecrypt
tthsum
twmn twmn: Qt 5 infrastructure update 2015-12-20 07:56:47 -06:00
udevil udevil: added patch 2015-12-14 20:49:14 +09:00
urlview urlview: enable on darwin 2015-12-04 11:00:16 -05:00
vanitygen
vifm
viking viking: 1.6 -> 1.6.1 2015-11-29 22:42:14 +01:00
vit
vue
vym
wcalc
weather weather: init at 2.0 2015-11-27 11:47:51 +01:00
wmname
wordnet
workrave
xca xca: 1.3.1 -> 1.3.2 2015-12-02 23:01:00 +01:00
xchm
xcruiser Rename 'emery' maintainer handle to 'ehmry', fixes #11493 2015-12-05 23:06:20 +01:00
xfe
xfontsel
xiphos
xkblayout-state
xmove
xneur
xpdf
xrandr-invert-colors
xterm
yakuake
yate
ykpers ykpers: 1.15.0 -> 1.17.2 2015-11-25 14:17:20 -08:00
zathura mupdf: propagate needed libraries 2015-11-25 18:30:41 +03:00
zscroll zscroll: init at 1.0 2015-11-13 14:58:19 -05:00