summary refs log tree commit diff
path: root/doc
diff options
context:
space:
mode:
authorJörg Thalheim <Mic92@users.noreply.github.com>2019-11-01 15:46:47 +0000
committerGitHub <noreply@github.com>2019-11-01 15:46:47 +0000
commit56240d7f20a2cc4b931a89617c37403586dc5b74 (patch)
treee6ed3a95889bb58037d35525df1309aeaa3699ba /doc
parenta8ebd0b0c05bcca2d870d6172d9387fc6dd1638e (diff)
parentbb7184d6a62f3eefdadb069091f8985871279b15 (diff)
downloadnixpkgs-56240d7f20a2cc4b931a89617c37403586dc5b74.tar
nixpkgs-56240d7f20a2cc4b931a89617c37403586dc5b74.tar.gz
nixpkgs-56240d7f20a2cc4b931a89617c37403586dc5b74.tar.bz2
nixpkgs-56240d7f20a2cc4b931a89617c37403586dc5b74.tar.lz
nixpkgs-56240d7f20a2cc4b931a89617c37403586dc5b74.tar.xz
nixpkgs-56240d7f20a2cc4b931a89617c37403586dc5b74.tar.zst
nixpkgs-56240d7f20a2cc4b931a89617c37403586dc5b74.zip
Merge pull request #71899 from decentriq/aslemmer/build-rust-package-add-target
build-support/rust: Add target option
Diffstat (limited to 'doc')
-rw-r--r--doc/languages-frameworks/rust.section.md11
1 files changed, 11 insertions, 0 deletions
diff --git a/doc/languages-frameworks/rust.section.md b/doc/languages-frameworks/rust.section.md
index 31f1abd197b..8b9aa5dc168 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