···237 --target /nix/store/asdfasdfsadf-thumb-crazy.json # contains {"foo":"","bar":""}
238 ```
239240-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-256Note that currently custom targets aren't compiled with `std`, so `cargo test`
257will fail. This can be ignored by adding `doCheck = false;` to your derivation.
258
···237 --target /nix/store/asdfasdfsadf-thumb-crazy.json # contains {"foo":"","bar":""}
238 ```
2390000000000000000240Note that currently custom targets aren't compiled with `std`, so `cargo test`
241will fail. This can be ignored by adding `doCheck = false;` to your derivation.
242