|
2 | 2 | title: 'Environment types' |
3 | 3 | --- |
4 | 4 |
|
| 5 | +import { RecipeTabs } from "@site/src/components/RecipeTabs"; |
| 6 | + |
5 | 7 | One of the least intuitive things to grasp when beginning to work with conda recipes is what the |
6 | 8 | roles of the different environments are. Questions such as "does it go into `build:` or `host:`?" |
7 | 9 | or "what's the difference between those two?" are very common. This page provides a high-level |
@@ -71,6 +73,39 @@ to be present both at build time (for the linker to find the symbols therein, an |
71 | 73 | find them), as well as at runtime (when the dynamic linker goes looking for the symbols that have |
72 | 74 | been marked as externally provided during the build of `mypkg`). |
73 | 75 |
|
| 76 | +It's worth noting that the `run:` environment is never actually created during the build of `mypkg`. |
| 77 | +That's why testing packages is essential, not least to find if the resulting artefact can actually |
| 78 | +be installed as-is. Here, the recipe formats v0 (`meta.yaml`) and v1 (`recipe.yaml`) behave sligtly |
| 79 | +differently. Then, using the same notation as above: |
| 80 | + |
| 81 | +<RecipeTabs> |
| 82 | + |
| 83 | +```yaml |
| 84 | +requirements: # build/host/run as above |
| 85 | + [...] |
| 86 | + |
| 87 | +test: |
| 88 | + requires: # [runtime] linux-aarch64; the package we built above |
| 89 | + - pytest # ... plus (optionally) additional test-only dependencies |
| 90 | + |
| 91 | + |
| 92 | + |
| 93 | +``` |
| 94 | + |
| 95 | +```yaml |
| 96 | +requirements: # build/host/run as above |
| 97 | + [...] |
| 98 | + |
| 99 | +tests: |
| 100 | + - requirements: |
| 101 | + run: # [runtime] linux-aarch64; the package we built above |
| 102 | + - pytest # ... plus (optionally) additional test-only dependencies |
| 103 | + build: # not currently necessary in conda-forge, but future use-cases |
| 104 | + - ... # may need this (e.g., if conda-forge ever builds for emscripten) |
| 105 | +``` |
| 106 | +
|
| 107 | +</RecipeTabs> |
| 108 | +
|
74 | 109 | ### Native builds |
75 | 110 |
|
76 | 111 | When the architectures between `build:` and `host:` match, the situation is simplified, because |
|
0 commit comments