summary refs log tree commit diff
path: root/pkgs/build-support/rust/default.nix
Commit message (Collapse)AuthorAge
* rust: Refactoring of rust and cargo packagesDavid Craven2016-06-15
|
* Fix buildRustPackage edge casesDavid Craven2016-06-02
| | | | | | | 1. When multiple versions of the same package are required $revs is an array. 2. When cargo fetch is run it usually doesn't need a network connection. But when it does SSL_CERT_FILE isn't set.
* buildRustPackage: Don't specify `logLevel` by default.Moritz Ulrich2016-05-28
|
* buildRustPackage: Add `log-level` argument.Moritz Ulrich2016-05-28
|
* rust: fix prePatch phase fail when sourceRoot setBrian McKenna2016-02-17
| | | | We want to go up more than a single directory if we're in a nested one.
* cargo, cargoSnapshot: add rustc runtime dependencyRicardo M. Correia2015-11-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* buildRustPackage: Fix rust builds due to #7524Ricardo M. Correia2015-07-24
| | | | Fixes #8966
* buildRustPackage: Accept `srcs` attribute as wellRicardo M. Correia2015-05-29
| | | | | Add support for building Rust packages that have multiple sources, i.e., that use the `srcs` and `sourceRoot` attributes instead of just `src`.
* buildRustPackage: Don't hardcode registry index hashRicardo M. Correia2015-05-19
| | | | | | | | | | | Instead, discover it automatically when building the package. This makes `buildRustPackage` more future-proof with respect to changes in how `cargo` generates the hash. Also, it fixes broken builds in i686 because apparently, cargo generates a different registry index hash in this architecture (compared to x86-64).
* buildRustPackage: Get rid of /proc/self/cwd hackRicardo M. Correia2015-04-23
| | | | | | | This makes buildRustPackage portable to non-Linux platforms. Additionally, now we also save the `Cargo.lock` file into the fetch output, so that we don't have to run $cargoUpdateHook again just before building.
* buildRustPackage: Add a mechanism to patch registry depsRicardo M. Correia2015-04-23
| | | | | | | | ... in a more generic way. With this commit, if you need to patch a registry package to make it work with Nix, you just need to add a script to patch-registry-deps in the same style as the `pkg-config` script.
* cargo: Remove setupHookRicardo M. Correia2015-04-23
| | | | | | | Instead, move that code into buildRustPackage. The setup hook was only doing part of the work anyway, and having it in a separate place was obscuring what was really going on.
* buildRustPackage: Fix Cargo.lock being ignoredRicardo M. Correia2015-04-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | It turns out that `cargo`, with respect to registry dependencies, was ignoring the package versions locked in `Cargo.lock` because we changed the registry index URL. Therefore, every time `rustRegistry` would be updated, we'd always try to use the latest version available for every dependency and as a result the deps' SHA256 hashes would almost always have to be changed. To fix this, now we do a string substitution in `Cargo.lock` of the `crates.io` registry URL with our URL. This should be safe because our registry is just a copy of the `crates.io` registry at a certain point in time. Since now we don't always use the latest version of every dependency, the build of `cargo` actually started to fail because two of the dependencies specified in its `Cargo.lock` file have build failures. To fix the latter problem, I've added a `cargoUpdateHook` variable that gets ran both when fetching dependencies and just before building the program. The purpose of `cargoUpdateHook` is to do any ad-hoc updating of dependencies necessary to get the package to build. The use of the '--precise' flag is needed so that cargo doesn't try to fetch an even newer version whenever `rustRegistry` is updated (and therefore have to change depsSha256 as a consequence).
* buildRustPackage: Add check phase and enable it by defaultRicardo M. Correia2015-04-21
| | | | | Also disable check phase in cargo as there are lots of failures (some probably due to trying to access the network).
* Add support for building cargo'ed Rust programsGeorges Dubus2015-04-21