From bb7184d6a62f3eefdadb069091f8985871279b15 Mon Sep 17 00:00:00 2001 From: exfalso <0slemi0@gmail.com> Date: Fri, 1 Nov 2019 14:19:39 +0000 Subject: [PATCH] buildRustPackage: Add readme comment on target option --- doc/languages-frameworks/rust.section.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/languages-frameworks/rust.section.md b/doc/languages-frameworks/rust.section.md index 83b7b159bd6..5fb5d380d8b 100644 --- a/doc/languages-frameworks/rust.section.md +++ b/doc/languages-frameworks/rust.section.md @@ -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