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
vcunat did some cosmetic changes, such as joining lines
because we seem to rarely use one-identifier-per-line style,
or fixing hyena description to conform to our rules.
From the changelog:
```
Version 0.7.80, 2015-11-30
+ Matroska: support of MKVMerge statistics tags (duration frame count,
stream size, bit rate) per track, thanks to ndjamena
+ FLAC: Channel positions, thanks to ndjamena
+ FLAC: difference between detected bit depth and stored bit depth
+ MPEG-TS: if DTVCC transport stream is present and no DTVCC service
descriptor, scan also in the middle of the file in order to detect
more caption services
+ Subtitle frame rate computing if frame count and duration are
available (hidden by default)
+ Subtitles in Matroska: count of elements
+ Matroska, MXF and MP4/MOV: detection of truncated files
+ DTS: difference between ES Matrix and ES Discrete
+ DTS: display ES Matrix or ES Discrete even if HRA or MA is present
+ DTS: difference between DTS-HRA with 96k option and pure DTS-96/24
+ DTS: detection of DTS:X
+ Samples per frame info
+ AC-3: detection of Atmos inside TrueHD
+ Video frame rate: showing precision of 1/1.001 frame rates (e.g.
"23.976 (24000/1001) fps" and "23.976 (23976/1000) fps")
+ MPEG-4/MOV: showing the complete list of compatible brands in the
CodecID field
+ MPEG-4/MOV: Alternate groups
+ MPEG-4/MOV: "Disabled" tag
+ MPEG-4/MOV: "Forced" tag
+ MPEG-4/MOV: showing links between tracks (chapters for, subtitles for,
fallback for)
+ MXF: handling of more acquisition metadata items
+ MXF: Package name
+ AVC: Store method of interlaced content (Interleaved Fields or
Separated Fields)
+ EBUCore: acquisition metadata (Proof of concept, for feedback only)
x Matroska: frame rate detection algorithm revisited, less wrong numbers
are expected
x SDP/Teletext: some pages were sometimes (when present in 2 different
SDP lines) displayed several times
x MPEG-4/MOV: some hint tracks were not displayed
+ Hongkongese language added
+ Option "Full parsing"
```
Following a commit by @k0ral, this completes the upgrade of the other
`mediainfo` components.
From the changelog:
```
Version 0.7.79, 2015-11-02
+ CLI/DLL only, XML: new option --Output=MIXML, with XML v2.0beta1
status, not for production, see
https://github.com/MediaArea/MediaAreaXml for more details
+ MediaTrace: support of more than 1 file in XML output.
+ CLI/DLL only, XML: new option --Output=MAXML, with XML v0.1 status, in
order to have bot MediaInfo and MediaTrace in the same output, not for
production, see https://github.com/MediaArea/MediaAreaXml for more
details
x MediaTrace: fixed some invalid outputs
x #B951, Amazon S3 support (REST API v2), CLI/DLL only and if compiled
with libcurl support: URL without credential were badly interpreted
```
Paste from the changelog:
There have been a lot of changes. Here are the highlights:
* Improved command line parser: terminator -- handling, UUID
recognition, DOM recognition, red-herring pairs (foo:bar), escaped
slashes in patterns (/one\/two/), substitutions (/one\/two/one-two/),
Unicode U+NNNN and \uNNNN, escaped entities (\n, \t etc) for use in
descriptions/annotations, abbreviated day and month names, ISO-8601
durations (PT4H, P1Y etc).
* New virtual tags UDA, ORPHAN, PROJECT, PRIORITY, and LATEST.
* Improved support for DOM references in filters task
'due.year = 2015 and due.week > 20' list.
* New configuration settings urgency.inherit, rule.color.merge,
urgency.user.tag.next.coefficient, color.uda.<name>.none, sugar,
report.<name>.sort:none, json.depends.array.
* Improved urgency: the urgency.inherit setting propagates urgency
along dependency chains.
* Improved searching: more powerful regular expressions.
* Improved attribute modifiers: is/isnt are now consistent exact
match operator equivalents to ==/!==.
* New command _unique, for generating unique lists of values, and
will ultimately replace several helper commands.
* New command commands, which lists commands and details about how
they affect filters, GC, context, and syntax.
* New verbosity tokens recur (feedback when a recurring task instance
is created), unwait (for when a waiting task becomes visible).
* Improved extensions: zsh completion, Fish shell completion, add-on
scripts now online.
* Improved documentation: help command, man pages, more online docs,
negation ! operator, sample hook scripts.
* Improved sync: GnuTLS now mandatory, so everyone has the sync
command.
* Improved JSON import/export support: free-format JSON, task arrays
assumed (which makes import/export work with out-of-the-box parsers),
dependencies optionally modeled as an array, UUIDs validated, tasks
added/updated without duplication, import from STDIN using -.
* Improved performance: less data is read from disk depending on the
filter.
* Improved diagnostics: duplicate dependency warnings, multi-task
edit failures, changes to tasks without IDs, certificate file sizes.
* Improved testing: migrated all Perl tests to Python, parallelized
test suite, colorized output, detection of newly passing tests,
Python 2.7 and 3 support, better debug output, Bash test library,
stress test tool, no more disabled tests - everything runs, test
coverage is now 87.3%.
* Widespread code cleanup, removal of dead code, C++11 enhancements,
improved portability, merged ISO-8601 and legacy durations, less
code, happier developers.
Built and run locally.
From the Changelog:
```
Version 0.7.78, 2015-10-02
+ MOV: AVrp CodecID support
+ Video Stored_Width/Stored_Height and Sampled_Width/Sampled_Height
added (hidden by default)
+ Speed optimization for the parsing of tiny files e.g. JPEG files
+ Option (command line / DLL) --Legacy=0 for disabling some legacy fields
+ Option (command line / DLL) --Output=MAXML, XML with MediaInfo and
MediaTrace output together, technology preview (not for production)
x MPEG-TS: Teletext and Teletext Subtitle were missing in the menu list
x Chroma subsampling "4:4:4" was sometimes indicated for RGB, which is
not useful
```