summary refs log tree commit diff
path: root/pkgs/build-support/rust/fetchcargo.nix
Commit message (Collapse)AuthorAge
* rustPlatform.fetchcargo: exposeAlyssa Ross2019-12-23
|
* rustPlatform: forward fetchcargo args to stdenvAlyssa Ross2019-12-23
| | | | | | | Most stdenv wrappers already work like this -- it allows greater customisation. We just have to be careful to remove arguments we're using that shouldn't be passed to stdenv. I've been conservative here, because fetchcargo checksums shouldn't change lightly.
* buildRustPackage: add verifyCargoDeps optionzimbatm2019-09-30
| | | | | | | | | | | One issue with cargoSha256 is that it's hard to detect when it needs to be updated or not. It's possible to upgrade a package and forget to update cargoSha256 and run with old versions of the program or libraries. This commit introduces `verifyCargoDeps` which, when enabled, will check that the Cargo.lock is not out of date in the cargoDeps by comparing it with the package source.
* cargo-vendor: dropMario Rodas2019-09-22
| | | | | | Cargo 1.37 imported `cargo-vendor` as built-in command [1] [1] https://github.com/rust-lang/cargo/pull/6869
* treewide: use dontUnpackworldofpeace2019-07-01
|
* fetchcargo: fixed config installation pathAlexander Krupenkin2018-12-14
|
* Merge pull request #51028 from clefru/tmp-cargo-configJörg Thalheim2018-11-26
|\ | | | | | | buildRustPackage: write cargo config to temporary file instead of source dir
| * Write cargo config to temporary file instead of source dir.Clemens Fruhwirth2018-11-25
| | | | | | | | ... as this fails if the source dir contains a "config" directory.
* | makeRustPlatform: refactor to make it easier to understandJörg Thalheim2018-11-21
|/ | | | | It is now clearer what is supposed to be in the rust attribute set without having studied type theory. The amount of code is identically.
* fetchcargo: Fix cargo-vendor-normalise for darwinSilvan Mosberger2018-09-17
|
* cargo-vendor-normalise: add a small install checkSymphorien Gibol2018-09-11
|
* fectchcargo: don't break old sha256Symphorien Gibol2018-09-11
|
* fetchcargo: normalise cargo config to ensure determinismSymphorien Gibol2018-09-11
|
* buildRustPackage, fetchcargo: optionally use vendor config from cargo-vendorJustin Humm2018-09-11
| | | | | | | | | | | | | | | | | | | | | | | | | By setting useRealVendorConfig explicitly to true, the actual (slightly modified) config generated by cargo-vendor is used. This solves a problem, where the static vendor config in pkgs/build-support/rust/default.nix would not sufficiently replace all crates Cargo is looking for. As useRealVendorConfig (and writeVendorConfig in fetchcargo) default to false, there should be no breakage in existing cargoSha256 hashes. Nethertheless, imho using this new feature should become standard. A possible deprecation path could be: - introduce this patch - set useRealVendorConfig explicitly to false whereever cargoSha256 is set but migration is not wanted yet. - after some time, let writeVendorConfig default to true - when useRealVendorConfig is true everywhere cargoSha256 is set and enough time is passed, `assert cargoVendorDir == null -> useRealVendorConfig;`, remove old behaviour - after some time, remove all appearences of useRealVendorConfig and the parameter itself
* buildRustPackage: allow patches to fix Cargo.lockLéo Gaspard2018-08-13
|
* build-support/rust: make use of abandoned cargoUpdateHookYurii Rashkovskii2018-02-23
| | | | | | | | | | | | | | | | | | | | | | | Previously, cargoUpdateHook was meaningful as it was used in [`cargo-fetch-deps`](https://github.com/NixOS/nixpkgs/blob/19d3cf81d3436a6600f261579b55b9132a6ca8fb/pkgs/build-support/rust/fetch-cargo-deps#L71). However, this entire file was removed in 5f8cf0048ea089fa73d17512fc4f9f0f0644e225. As far as I can tell, nothing in the code is using it, but it is still being passed around: https://github.com/NixOS/nixpkgs/search?q=cargoUpdateHook&type=Code&utf8=%E2%9C%93 There are, however, legitimate use cases for it. For example, in some software, some dependencies are not locked in Cargo.toml and this causes Cargo to try fetching another version of them. This doesn't work well with vendoring crates. This hook allows to inject patching or whatever necessary workarounds in the crate vendoring process. I suppose that's what it was for in there in the first place. This patch restores this hook and makes it usable again.
* rust: fix evaluationJörg Thalheim2018-02-04
|
* Merge remote-tracking branch 'upstream/master' into stagingTuomas Tynkkynen2018-01-14
|\ | | | | | | | | | | | | | | | | | | Conflicts: pkgs/build-support/fetchbower/default.nix pkgs/build-support/fetchdarcs/default.nix pkgs/build-support/fetchgx/default.nix pkgs/development/python-modules/botocore/default.nix pkgs/os-specific/linux/firmware/firmware-linux-nonfree/default.nix pkgs/tools/admin/awscli/default.nix
| * Merge pull request #33681 from obsidiansystems/fixed-output-depsJohn Ericson2018-01-10
| |\ | | | | | | Fixed output deps
| | * treewide: Fix deps in a few other fixed output derivationsJohn Ericson2018-01-10
| | |
| * | Revert "rust: store the cargo-vendor config"Robin Gloster2018-01-09
| |/ | | | | | | | | | | | | This reverts commit 0af2c5891bfccfe5a6e8ba67e95c5852c45529d2. See https://github.com/NixOS/nixpkgs/commit/0af2c5891bfccfe5a6e8ba67e95c5852c45529d2#commitcomment-26737983 This breaks the cargoSha256 hashes.
| * rust: store the cargo-vendor configzimbatm2018-01-09
| | | | | | | | | | | | | | cargo-vendor generates almost the right cargo config. Store it with the vendored files and patch it on use. This allows to re-use the generated config when using git dependencies.
* | cacert: cleanup exporting SSL_CERT_FILEDaiderd Jordan2017-12-27
|/
* rust: update cargo builder to fetch registry dynamicallyKevin Cox2017-10-23
| | | | | | | | | | | | | | | | | | | | | | | | | | The biggest benefit is that we no longer have to update the registry package. This means that just about any cargo package can be built by nix. No longer does `cargo update` need to be feared because it will update to packages newer then what is available in nixpkgs. Instead of fetching the cargo registry this bundles all the source code into a "vendor/" folder. This also uses the new --frozen and --locked flags which is nice. Currently cargo-vendor only provides binaries for Linux and macOS 64-bit. This can be solved by building it for the other architectures and uploading it somewhere (like the NixOS cache). This also has the downside that it requires a change to everyone's deps hash. And if the old one is used because it was cached it will fail to build as it will attempt to use the old version. For this reason the attribute has been renamed to `cargoSha256`. Authors: * Kevin Cox <kevincox@kevincox.ca> * Jörg Thalheim <Mic92@users.noreply.github.com> * zimbatm <zimbatm@zimbatm.com>
* lib/fetchers.nix: factor out impure proxy vars (#18702)Profpatsch2016-09-17
| | | | Apparently everyone just copied those variables, instead of creating a library constant for them. Some even removed the comment. -.-
* rust: Refactoring of rust and cargo packagesDavid Craven2016-06-15
|
* fetch-cargo-deps: factor into fetchCargoDeps functionNikolay Amiantov2016-02-25
|
* fetchcargo: set CA bundle pathNikolay Amiantov2016-02-25
|
* Configure a default trust store for opensslGuillaume Maudoux2016-02-03
|
* 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 erroneous /bin/sh referenceRicardo M. Correia2015-10-29
| | | | | | | | The fetch-cargo-deps script is written in bash syntax, but it erroneously ran under the /bin/sh interpreter. This wasn't noticed because /bin/sh is actually bash in NixOS, but on some other systems this is not true.
* cacert: store ca-bundle.crt in $out/etc/ssl/certs instead of $outWilliam A. Kennington III2015-06-05
|
* Fix ca-bundle pathsWilliam A. Kennington III2015-05-29
|
* 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: 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).
* Add support for building cargo'ed Rust programsGeorges Dubus2015-04-21