config.rust: update references from rustc
`rustc.config` is called `rust.rustcTarget` now, and
`{rustc -> rust}.platform`.
This is the new way (tm), and is preferred since
https://github.com/NixOS/nixpkgs/pull/271707 -
though the documentation still is outdated, and some expressions in
nixpkgs were using the old interface.
This updates both.
This commit is contained in:
@@ -254,7 +254,7 @@ By default, it takes the `stdenv.hostPlatform.config` and replaces components
|
|||||||
where they are known to differ. But there are ways to customize the argument:
|
where they are known to differ. But there are ways to customize the argument:
|
||||||
|
|
||||||
- To choose a different target by name, define
|
- To choose a different target by name, define
|
||||||
`stdenv.hostPlatform.rustc.config` as that name (a string), and that
|
`stdenv.hostPlatform.rust.rustcTarget` as that name (a string), and that
|
||||||
name will be used instead.
|
name will be used instead.
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
@@ -262,7 +262,7 @@ where they are known to differ. But there are ways to customize the argument:
|
|||||||
```nix
|
```nix
|
||||||
import <nixpkgs> {
|
import <nixpkgs> {
|
||||||
crossSystem = (import <nixpkgs/lib>).systems.examples.armhf-embedded // {
|
crossSystem = (import <nixpkgs/lib>).systems.examples.armhf-embedded // {
|
||||||
rustc.config = "thumbv7em-none-eabi";
|
rust.rustcTarget = "thumbv7em-none-eabi";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@@ -274,10 +274,10 @@ where they are known to differ. But there are ways to customize the argument:
|
|||||||
```
|
```
|
||||||
|
|
||||||
- To pass a completely custom target, define
|
- To pass a completely custom target, define
|
||||||
`stdenv.hostPlatform.rustc.config` with its name, and
|
`stdenv.hostPlatform.rust.rustcTarget` with its name, and
|
||||||
`stdenv.hostPlatform.rustc.platform` with the value. The value will be
|
`stdenv.hostPlatform.rust.platform` with the value. The value will be
|
||||||
serialized to JSON in a file called
|
serialized to JSON in a file called
|
||||||
`${stdenv.hostPlatform.rustc.config}.json`, and the path of that file
|
`${stdenv.hostPlatform.rust.rustcTarget}.json`, and the path of that file
|
||||||
will be used instead.
|
will be used instead.
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
@@ -285,8 +285,8 @@ where they are known to differ. But there are ways to customize the argument:
|
|||||||
```nix
|
```nix
|
||||||
import <nixpkgs> {
|
import <nixpkgs> {
|
||||||
crossSystem = (import <nixpkgs/lib>).systems.examples.armhf-embedded // {
|
crossSystem = (import <nixpkgs/lib>).systems.examples.armhf-embedded // {
|
||||||
rustc.config = "thumb-crazy";
|
rust.rustcTarget = "thumb-crazy";
|
||||||
rustc.platform = { foo = ""; bar = ""; };
|
rust.platform = { foo = ""; bar = ""; };
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ rec {
|
|||||||
|
|
||||||
armv7a-android-prebuilt = {
|
armv7a-android-prebuilt = {
|
||||||
config = "armv7a-unknown-linux-androideabi";
|
config = "armv7a-unknown-linux-androideabi";
|
||||||
rustc.config = "armv7-linux-androideabi";
|
rust.rustcTarget = "armv7-linux-androideabi";
|
||||||
sdkVer = "28";
|
sdkVer = "28";
|
||||||
ndkVer = "24";
|
ndkVer = "24";
|
||||||
useAndroidPrebuilt = true;
|
useAndroidPrebuilt = true;
|
||||||
@@ -67,7 +67,7 @@ rec {
|
|||||||
|
|
||||||
aarch64-android-prebuilt = {
|
aarch64-android-prebuilt = {
|
||||||
config = "aarch64-unknown-linux-android";
|
config = "aarch64-unknown-linux-android";
|
||||||
rustc.config = "aarch64-linux-android";
|
rust.rustcTarget = "aarch64-linux-android";
|
||||||
sdkVer = "28";
|
sdkVer = "28";
|
||||||
ndkVer = "24";
|
ndkVer = "24";
|
||||||
useAndroidPrebuilt = true;
|
useAndroidPrebuilt = true;
|
||||||
@@ -207,7 +207,7 @@ rec {
|
|||||||
aarch64-embedded = {
|
aarch64-embedded = {
|
||||||
config = "aarch64-none-elf";
|
config = "aarch64-none-elf";
|
||||||
libc = "newlib";
|
libc = "newlib";
|
||||||
rustc.config = "aarch64-unknown-none";
|
rust.rustcTarget = "aarch64-unknown-none";
|
||||||
};
|
};
|
||||||
|
|
||||||
aarch64be-embedded = {
|
aarch64be-embedded = {
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ let
|
|||||||
cross = import ../../../.. {
|
cross = import ../../../.. {
|
||||||
system = hostPlatform.system;
|
system = hostPlatform.system;
|
||||||
crossSystem = lib.systems.examples."${arch}-embedded" // {
|
crossSystem = lib.systems.examples."${arch}-embedded" // {
|
||||||
rustc.config = "${arch}-unknown-none";
|
rust.rustcTarget = "${arch}-unknown-none";
|
||||||
rustc.platform = lib.importJSON target;
|
rust.platform = lib.importJSON target;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user