Skip to content

Commit cc90cdc

Browse files
committed
docs: Update to reference host_platform instead of target_platform
Update the documentation throughout to replace the references to `target_platform` with `host_platform` where appropriate. That said, unless I've missed some fine point, this means pretty much everywhere.
1 parent 09e33f1 commit cc90cdc

5 files changed

Lines changed: 21 additions & 20 deletions

File tree

docs/compilers.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
To use a compiler in your project, it's best to use the `${{ compiler('lang')
44
}}` template function. The compiler function works by taking a language,
55
determining the configured compiler for that language, and adding some
6-
information about the target platform to the selected compiler. To configure a
6+
information about the host platform to the selected compiler. To configure a
77
compiler for a specific language, the `variant_config.yaml` file can be used.
88

99
For example, in a recipe that uses a C-compiler, you can use the following code:
@@ -35,7 +35,7 @@ variant config.
3535

3636
Cross-compilation is supported by `rattler-build` and the compiler template
3737
function is part of what makes it possible. When you want to cross-compile from
38-
`linux-64` to `linux-aarch64` (i.e. intel to ARM), you can pass `--target-platform
38+
`linux-64` to `linux-aarch64` (i.e. intel to ARM), you can pass `--host-platform
3939
linux-aarch64` to the `rattler-build` command. This will cause the compiler
4040
template function to select a compiler that is configured for `linux-aarch64`.
4141
The above example would resolve to `gcc_linux-aarch64 9.3.0`. Provided that the
@@ -57,7 +57,7 @@ build:
5757
- cmake
5858
- ${{ compiler('c') }}
5959
# packages that we want to link against in the architecture we are
60-
# cross-compiling to the target_platform
60+
# cross-compiling to the host_platform
6161
host:
6262
- libcurl
6363
- openssl

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ For the `curl` library recipe, two additional script files (`build.sh` and `buil
324324
# Get an updated config.sub and config.guess
325325
cp $BUILD_PREFIX/share/libtool/build-aux/config.* .
326326
327-
if [[ $target_platform =~ linux.* ]]; then
327+
if [[ $host_platform =~ linux.* ]]; then
328328
USESSL="--with-openssl=${PREFIX}"
329329
else
330330
USESSL="--with-secure-transport"

docs/reference/jinja.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ functions and filters that can be used in the recipe.
88
### The compiler function
99

1010
The compiler function can be used to put together a compiler that works for the
11-
current platform and the compilation "`target_platform`". The syntax looks like:
11+
current platform and the compilation "`host_platform`". The syntax looks like:
1212
`${{ compiler('c') }}` where `'c'` signifies the programming language that is
1313
used.
1414

15-
This function evaluates to `<compiler>_<target_platform> <compiler_version>`.
15+
This function evaluates to `<compiler>_<host_platform> <compiler_version>`.
1616
For example, when compiling _on_ `linux` and _to_ `linux-64`, this function
1717
evaluates to `gcc_linux-64`.
1818

@@ -38,9 +38,9 @@ c_compiler_version:
3838
```
3939
4040
The variables shown above would select the `clang` compiler in version `9.0`.
41-
Note that the final output will still contain the `target_platform`, so that the
41+
Note that the final output will still contain the `host_platform`, so that the
4242
full compiler will read `clang_linux-64 9.0` when compiling with
43-
`--target-platform linux-64`.
43+
`--host-platform linux-64`.
4444

4545
`rattler-build` defines some default compilers for the following languages
4646
(inherited from `conda-build`):
@@ -54,11 +54,11 @@ full compiler will read `clang_linux-64 9.0` when compiling with
5454

5555
The `stdlib` function closely mirrors the compiler function. It can be used to
5656
put together a standard library that works for the current platform and the
57-
compilation "`target_platform`".
57+
compilation "`host_platform`".
5858

5959
Usage: `${{ stdlib('c') }}`
6060

61-
Results in `<stdlib>_<target_platform> <stdlib_version>`. And uses the variant
61+
Results in `<stdlib>_<host_platform> <stdlib_version>`. And uses the variant
6262
variables `<lang>_stdlib` and `<lang>_stdlib_version` to influence the output.
6363

6464
#### Usage in a recipe:

docs/selectors.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ host:
5454
Other examples often found in the wild:
5555
5656
```yaml
57-
if: build_platform != target_platform ... # true if cross-platform build
57+
if: build_platform != host_platform ... # true if cross-platform build
5858
if: osx and arm64 ... # true for apple silicon (osx-arm64)
5959
if: linux and (aarch64 or ppc64le)) ... # true for linux ppc64le or linux-aarch64
6060
```
@@ -65,12 +65,13 @@ The following variables are available during rendering of the recipe:
6565
6666
| Variable | Description |
6767
|----------------------|------------------------------------------------------------------------|
68-
| `target_platform` | the configured `target_platform` for the build |
6968
| `build_platform` | the configured `build_platform` for the build |
70-
| `linux` | "true" if `target_platform` is Linux |
71-
| `osx` | "true" if `target_platform` is OSX / macOS |
72-
| `win` | "true" if `target_platform` is Windows |
73-
| `unix` | "true" if `target_platform` is a Unix (macOS or Linux) |
69+
| `host_platform` | the configured `host_platform` for the build |
70+
| `target_platform` | the configured `target_platform` for the build |
71+
| `linux` | "true" if `host_platform` is Linux |
72+
| `osx` | "true" if `host_platform` is OSX / macOS |
73+
| `win` | "true" if `host_platform` is Windows |
74+
| `unix` | "true" if `host_platform` is a Unix (macOS or Linux) |
7475
| `x86`, `x86_64` | x86 32/64-bit Architecture |
7576
| `aarch64`, `arm64` | 64-bit Arm (these are the same but are both supported for legacy) |
7677
| `armV6l`, `armV7l` | 32-bit Arm |
@@ -149,9 +150,9 @@ Some notable options are:
149150
```yaml
150151
- if: python == "3.8" # equal
151152
- if: python != "3.8" # not equal
152-
- if: python and linux # true if python variant is set and the target_platform is linux
153-
- if: python and not linux # true if python variant is set and the target_platform is not linux
154-
- if: python and (linux or osx) # true if python variant is set and the target_platform is linux or osx
153+
- if: python and linux # true if python variant is set and the host_platform is linux
154+
- if: python and not linux # true if python variant is set and the host_platform is not linux
155+
- if: python and (linux or osx) # true if python variant is set and the host_platform is linux or osx
155156
```
156157

157158
[minijinja]: https://github.com/mitsuhiko/minijinja

docs/tutorials/rust.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ about:
4141
4242
!!! note
4343
The `${{ compiler(...) }}` functions are very useful in the context of cross-compilation.
44-
When the function is evaluated it will insert the correct compiler (as selected with the variant config) as well the `target_platform`.
44+
When the function is evaluated it will insert the correct compiler (as selected with the variant config) as well the `host_platform`.
4545
The "rendered" compiler will look like `rust_linux-64` when you are targeting the `linux-64` platform.
4646

4747
You can read more about this in the [cross-compilation](../compilers.md) section.

0 commit comments

Comments
 (0)