Merge pull request #71899 from decentriq/aslemmer/build-rust-package-add-target

build-support/rust: Add target option
This commit is contained in:
Jörg Thalheim
2019-11-01 15:46:47 +00:00
committed by GitHub
2 changed files with 16 additions and 3 deletions
+11
View File
@@ -68,6 +68,17 @@ build-time.
When `verifyCargoDeps` is set to `true`, the build will also verify that the
`cargoSha256` is not out of date by comparing the `Cargo.lock` file in both the `cargoDeps` and `src`. Note that this option changes the value of `cargoSha256` since it also copies the `Cargo.lock` in it. To avoid breaking backward-compatibility this option is not enabled by default but hopefully will be in the future.
### Building a crate for a different target
To build your crate with a different cargo `--target` simply specify the `target` attribute:
```nix
pkgs.rustPlatform.buildRustPackage {
(...)
target = "x86_64-fortanix-unknown-sgx";
}
```
## Compiling Rust crates using Nix instead of Cargo
### Simple operation