Merge pull request #142173 from baloo/baloo/rust/doc-target-escape

authored by

Sandro and committed by
GitHub
ced3db16 47d7fa29

-16
-16
doc/languages-frameworks/rust.section.md
··· 237 237 --target /nix/store/asdfasdfsadf-thumb-crazy.json # contains {"foo":"","bar":""} 238 238 ``` 239 239 240 - Finally, as an ad-hoc escape hatch, a computed target (string or JSON file 241 - path) can be passed directly to `buildRustPackage`: 242 - 243 - ```nix 244 - pkgs.rustPlatform.buildRustPackage { 245 - /* ... */ 246 - target = "x86_64-fortanix-unknown-sgx"; 247 - } 248 - ``` 249 - 250 - This is useful to avoid rebuilding Rust tools, since they are actually target 251 - agnostic and don't need to be rebuilt. But in the future, we should always 252 - build the Rust tools and standard library crates separately so there is no 253 - reason not to take the `stdenv.hostPlatform.rustc`-modifying approach, and the 254 - ad-hoc escape hatch to `buildRustPackage` can be removed. 255 - 256 240 Note that currently custom targets aren't compiled with `std`, so `cargo test` 257 241 will fail. This can be ignored by adding `doCheck = false;` to your derivation. 258 242