summary refs log tree commit diff
path: root/pkgs/build-support/rust
Commit message (Collapse)AuthorAge
* Merge pull request #75563 from andir/cleanup-buildRustCrateAndreas Rammhold2020-01-02
|\ | | | | Cleanup buildRustCrate expression
| * buildRustCrate: move common build functions to a dedicated fileAndreas Rammhold2019-12-12
| | | | | | | | | | This means we aren't rebuilding hat file for each crate we are building and the buildPhase expression is a lot easier to comprehent.
| * buildRustCrate: deduplicate dependency override codeAndreas Rammhold2019-12-12
| | | | | | | | | | | | The previous lines were only different in the kind of dependencies but otherwise exactly the same. It makes the entire thing a bit more readable by moving this into a function that takes care of this.
| * buildRustCrate: use less bash for the build scriptAndreas Rammhold2019-12-12
| | | | | | | | | | | | | | | | | | | | | | | | | | We can get rid of a bunch of workarounds that were in the build script before by just passing on the `crateBin` attribute. Before we converted the list of attributes to a string only to convert it back in bash during the build phase. We can do the entire looping through builds in Nix and thus need no conversion and parsing of attributes over and over again. The big part that still remains bash is the heuristic that cargo introduced and that we can't do at eval time.
| * buildRustCrate: reflow the way `extraRustcOpts` is constructedAndreas Rammhold2019-12-11
| | | | | | | | | | This should make it more obvious that we have three parts to it and not just one long gibberish string that makes up all of it.
| * buildRustCrate: rename `makeDeps` function to `mkRustcDepArgs`Andreas Rammhold2019-12-11
| | | | | | | | | | This should carry the function better then `makeDeps` as it isn't producing deps but the rustc arguments required to link against those.
| * buildRustCrate: document and cleanup the symbol seedingAndreas Rammhold2019-12-11
| | | | | | | | | | | | That code had been in the derivation for a while but no explanation was given why that is needed. It might be helpful to our future selfs to document why things are done the way they are.
| * buildRustCrate: use tr instead of sed (it reads a bit nicer)Andreas Rammhold2019-12-11
| | | | | | | | | | I already have a few changes in here that will trigger rebuilds so I might as well do that substitution now.
| * buildRustCrate: move the color loggign & remove some runtime checksAndreas Rammhold2019-12-11
| | | | | | | | | | | | | | | | The expression is already long and confusing enough without the color stuff sprinkled in. Moving it to a dedicated file makes sense. I switched a bit of the color support code to pure Nix since there wasn't much point in doing that in bash while we can just do it in Nix.
| * buildRustCrate: builtins -> lib where possibleAndreas Rammhold2019-12-11
| | | | | | | | | | | | We can just use `lib` instead of `builtins` in all cases but the `hashString` case. Also changed a few lines to make use of some optional helpers from lib.
* | rustPlatform.fetchcargo: exposeAlyssa Ross2019-12-23
| |
* | rustPlatform: forward unpackPhase to fetchcargoAlyssa Ross2019-12-23
| | | | | | | | | | If a custom unpackPhase is used for the package, it needs to also be used for fetchcargo so the same source is available for vendoring.
* | 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.
* rust: add support for armv6l-linux and armv7l-linux (#73472)Jörg Thalheim2019-11-29
|\ | | | | rust: add support for armv6l-linux and armv7l-linux
| * rust: add support for armv6l-linux and armv7l-linuxBen Wolsieffer2019-11-23
| |
* | buildRustCrate: add lib outputAndreas Rammhold2019-11-26
|/ | | | | | | | | | | | | | | | | | | | | | | | This cuts down the dependency tree on some rust builds where a crate not just exposes a binary but also a library. `$out/lib` contained a bunch of extra support files that among other information carry linker flags (including the full path to link-time dependencies). Worst case this led to some binary outputs depending on the full build closure of rust crates. Moving all the `$out/lib` files to `$lib/lib` solves this nicely. `lib` might be a bit weird here as they are most of the time just rlib files (rust libraries). Those are essential only required during compilation but they can also be shared objects (like with traditional C-style packages). Which is why I went with `lib` for the new output. One of the caveats we are running into here is that we do not (always) know ahead of time of a crate produces just a library or just a binary. Cargo allows for some ambiguity regarding whether or not a crate provides one, two, … binaries and libraries as it's outputs. Ideally we would be able to rely on the `crateType` entirely but so far that isn't the case. More work on that area might show how difficult that actually is.
* Merge pull request #71899 from decentriq/aslemmer/build-rust-package-add-targetJörg Thalheim2019-11-01
|\ | | | | build-support/rust: Add target option
| * build-support/rust: Add target optionexfalso2019-10-24
| |
* | buildRustPackage: support checkFlags and checkFlagsArrayAndreas Rammhold2019-10-20
|/
* 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.
* Merge pull request #69345 from joachifm/feat/split-versionJoachim F2019-09-27
|\ | | | | Replace uses of splitString for splitting version strings
| * tree-wide: replace uses of splitString "." with lib.versionsJoachim Fasting2019-09-26
| | | | | | | | | | | | | | | | | | Quoting from the splitString docstring: NOTE: this function is not performant and should never be used. This replaces trivial uses of splitString for splitting version strings with the (potentially builtin) splitVersion.
* | 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
* Merge pull request #66617 from ↵Yegor Timoshenko2019-09-19
|\ | | | | | | | | transumption-unstable/201908/rust-aarch64-linux-musl buildRustPackage: fix cross-compilation to aarch64-unknown-linux-musl
| * buildRustPackage: fix cross-compilation to aarch64-unknown-linux-muslYegor Timoshenko2019-09-12
| |
* | Merge pull request #68296 from danieldk/crateRenamesAndreas Rammhold2019-09-10
|\ \ | | | | | | buildRustCrate: add support for renaming crates
| * | buildRustCrate: add support for renaming cratesDaniël de Kok2019-09-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change, buildRustCrate always called rustc with --extern libName=[...]libName[...] However, Cargo permits using a different name under which a dependency is known to a crate. For example, rand 0.7.0 uses: [dependencies] getrandom_package = { version = "0.1.1", package = "getrandom", optional = true } Which introduces the getrandom dependency such that it is known as getrandom_package to the rand crate. In this case, the correct extern flag is of the form --extern getrandom_package=[...]getrandom[...] which is currently not supported. In order to support such cases, this change introduces a crateRenames argument to buildRustCrate. This argument is an attribute set of dependencies that should be renamed. In this case, crateRenames would be: { "getrandom" = "getrandom_package"; } The extern options are then built such that if the libName occurs as an attribute in this set, it value will be used as the local name. Otherwise libName will be used as before.
* | | treewide: remove redundant recvolth2019-08-28
| | |
* | | treewide: remove redundant quotesvolth2019-08-26
|/ /
* | Merge master into staging-nextFrederik Rietdijk2019-08-17
|\ \
| * | buildRustPackage: link against pthreads-w32 on x86_64-pc-mingw32Yegor Timoshenko2019-08-15
| | |
| * | buildRustPackage: support cross-compilation to x86_64-pc-mingw32Yegor Timoshenko2019-08-15
| |/
* | Merge staging-next into stagingFrederik Rietdijk2019-08-01
|\|
| * Merge master into staging-nextFrederik Rietdijk2019-08-01
| |\
| | * buildRustPackage: fix cargo flag for release/debug build (#61521)Adelbert Chang2019-07-31
| | | | | | | | | | | | | | | Previous behavior did not actually allow for "debug" build as it would try to pass --debug to cargo, which is not a valid flag.
| | * buildRustPackage: by default use Rust's platformsMario Rodas2019-07-21
| | |
* | | buildRustPackage: Remove unneeded catAtkins2019-07-30
| | |
* | | buildRustPackage: Avoid altering `.cargo/config` in sourceAtkins2019-07-30
|/ /
* / gdk-pixbuf: rename from gdk_pixbufworldofpeace2019-07-22
|/
* treewide: use dontUnpackworldofpeace2019-07-01
|
* treewide: remove unused variables (#63177)volth2019-06-16
| | | | | | * treewide: remove unused variables * making ofborg happy
* Fix #60125 - buildRustCrate: Always set CARGO_PKG_VERSION_PRE and ↵Peter Kolloch2019-04-23
| | | | | | CARGO_PKG_HOMEPAGE (as cargo does)
* cargo-vendor: fix build on DarwinAndreas Rammhold2019-04-21
| | | | | | This is supposedly fixing the build of the cargo crate on Drawin [1]. [1] https://github.com/NixOS/nixpkgs/pull/57017#pullrequestreview-228868016
* cargo: fix build on DarwinAndreas Rammhold2019-04-21
| | | | | | This is supposedly fixing the build of the cargo crate on Drawin [1]. [1] https://github.com/NixOS/nixpkgs/pull/57017#pullrequestreview-228868016
* cargo-vendor: 0.1.13 -> 0.1.23Alexander Krupenkin2019-04-21
|
* Merge master into staging-nextFrederik Rietdijk2019-04-09
|\
| * Merge pull request #58394 from P-E-Meunier/carnix-0.10Andreas Rammhold2019-04-08
| |\ | | | | | | Carnix: 0.9 -> 0.10
| | * Carnix: 0.9 -> 0.10Pierre-Étienne Meunier2019-03-26
| | |
* | | Merge branch 'master' into stagingJan Tojnar2019-04-05
|\| |
| * | Merge pull request #57936 from andir/build-rust-crate-nix-build-coresAndreas Rammhold2019-03-29
| |\ \ | | |/ | |/| buildRustCrate: use $NIX_BUILD_CORES for each of the crates