nixpkgs/pkgs/development/compilers/rust
Maximilian Bosch 6b23cfe689
rustPlatform: add buildAndTestSubdir-argument
There are several tarballs (such as the `rust-lang/rust`-source) with a
`Cargo.toml` at root and several sub-packages (with their own Cargo.toml)
without using workspaces[1].

In such a case it's needed to move into a subdir to only build the
specified sub-package (e.g. `rustfmt` or `rsl`), however the artifacts
are at `/target` in the root-dir of the build environment. This breaks
the build since `buildRustPackage` searches for executables in `target`
(which is at the build-env's root) at the end of the `buildPhase`.

With the optional `buildAndTestSubdir`-argument, the builder moves into
the specified subdir using `pushd`/`popd` during `buildPhase` and
`checkPhase`.

Also moved the logic to find executables and libs to the end of the `buildPhase`
from a custom `postBuild`-hook to fix packages with custom `build`/`install`-procedures
such as `uutils-coreutils`.

[1] https://doc.rust-lang.org/book/ch14-03-cargo-workspaces.html
2020-05-13 01:47:17 +02:00
..
rls rustPlatform: add buildAndTestSubdir-argument 2020-05-13 01:47:17 +02:00
0001-Allow-getting-no_std-from-the-config-file.patch rustc: 1.41.0 -> 1.42.0 2020-03-13 19:51:52 +00:00
1_42.nix rust_1_38, rust_1_42: drop patch version from attr 2020-03-13 21:24:07 +00:00
binary.nix treewide: Per RFC45, remove all unquoted URLs 2020-04-10 17:54:53 +01:00
bootstrap.nix rust: add support for armv6l-linux and armv7l-linux 2019-11-23 19:19:31 -05:00
cargo.nix rustPlatform: add buildAndTestSubdir-argument 2020-05-13 01:47:17 +02:00
clippy.nix rustPlatform: add buildAndTestSubdir-argument 2020-05-13 01:47:17 +02:00
default.nix Merge pull request #82882 from obsidiansystems/armv6-embedded 2020-03-19 10:38:22 -04:00
print-hashes.sh rust: add support for armv6l-linux and armv7l-linux 2019-11-23 19:19:31 -05:00
rust-src.nix
rustc.nix rustc: remove test-only git dependency 2020-03-29 06:36:06 +01:00
rustfmt.nix rustPlatform: add buildAndTestSubdir-argument 2020-05-13 01:47:17 +02:00
setup-hook.sh