nixpkgs/pkgs
Ricardo M. Correia 2b694c237b cargo, cargoSnapshot: add rustc runtime dependency
It turns out that cargo implicitly depends on rustc at runtime: even
`cargo help` will fail if rustc is not in the PATH.

This means that we need to wrap the cargo binary to add rustc to PATH.
However, I have opted into doing something slightly unusual: instead of
tying down a specific cargo to use a specific rustc (i.e., wrap cargo so
that "${rustc}/bin" is prefixed into PATH), instead I'm adding the rustc
used to build cargo as a fallback rust compiler (i.e., wrap cargo so
that "${rustc}/bin" is suffixed into PATH). This means that cargo will
prefer to use a rust compiler that is in the default path, but fallback
into the one used to build cargo only if there wasn't any rust compiler
in the default path.

The reason I'm doing this is that otherwise it could cause unexpected
effects. For example, if you had a build environment with the
rustcMaster and cargo derivations, you would expect cargo to use
rustcMaster to compile your project (since rustcMaster would be the only
compiler available in $PATH), but this wouldn't happen if we tied down
cargo to use the rustc that was used to compile it (because the default
cargo derivation gets compiled with the stable rust compiler).

That said, I have slightly modified makeRustPlatform so that a rust
platform will always use the rust compiler that was used to build cargo,
because this prevents mistakenly depending on two different versions of
the rust compiler (stable and unstable) in the same rust platform,
something which is usually undesirable.

Fixes #11053
2015-11-18 02:41:45 +01:00
..
applications Replace 'with plaforms; platform' with 'platforms.platform' 2015-11-17 21:30:43 +01:00
build-support cargo, cargoSnapshot: add rustc runtime dependency 2015-11-18 02:41:45 +01:00
data Replace 'with plaforms; platform' with 'platforms.platform' 2015-11-17 21:30:43 +01:00
desktops cheese: fix build for 3.18 2015-11-17 18:48:25 +01:00
development cargo, cargoSnapshot: add rustc runtime dependency 2015-11-18 02:41:45 +01:00
games Replace 'with plaforms; platform' with 'platforms.platform' 2015-11-17 21:30:43 +01:00
misc xscreensaver: security update 5.33 -> 5.34 (close #10845) 2015-11-16 08:20:12 +01:00
os-specific linux-testing: Bump to 4.4-rc1 2015-11-17 17:21:25 -08:00
servers Replace 'with plaforms; platform' with 'platforms.platform' 2015-11-17 21:30:43 +01:00
shells fish: fix use hostname from the store instead of from the environment 2015-11-06 09:55:55 +01:00
stdenv Don't fail if env-vars cannot be written to 2015-11-04 16:32:59 +01:00
test
tools ceph: Fix hash 2015-11-17 17:10:51 -08:00
top-level cargo, cargoSnapshot: add rustc runtime dependency 2015-11-18 02:41:45 +01:00