diff options
| author | Quentin Schulz <quentin.schulz@theobroma-systems.com> | 2023-10-17 13:45:29 +0200 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2023-10-25 04:45:51 -1000 |
| commit | 955796ad7e937ddd941e349f418578915c20703b (patch) | |
| tree | 49b0a94833d303ce8cf61e9eaf9ee3dbfc8aa16b /documentation | |
| parent | 650980791ea606cf08bc89426afd5265f5d19ebf (diff) | |
| download | poky-955796ad7e937ddd941e349f418578915c20703b.tar.gz | |
ref-manual: variables: provide no-match example for COMPATIBLE_MACHINE
COMPATIBLE_MACHINE is used to forbid the use of a recipe or its packages
for a specific set of machines.
In some cases, it may make more sense to have the logic inverted and
have the recipe always forbidden except for hand-picked machines. Such
could be the case for pieces of software that only support some
architectures. In that scenario, it is sometimes a bit easier on the eye
and for maintenance to use the OVERRIDES mechanism but for that, a
default should be set.
COMPATIBLE_MACHINE:aarch64 = "^(aarch64)$"
COMPATIBLE_MACHINE:mips64 = "^(mips64)$"
wouldn't do much because if COMPATIBLE_MACHINE isn't set, the recipe is
assumed compatible and therefore, if no default is provided we enter
that case.
Hence, we need to add
COMPATIBLE_MACHINE = "^$"
as default so that it only matches the empty string, which isn't
possible for MACHINEOVERRIDES.
Cc: Quentin Schulz <foss+yocto@0leil.net>
(From yocto-docs rev: d66b53eebe5b2320ce12926b309e48c9e32523f3)
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'documentation')
| -rw-r--r-- | documentation/ref-manual/variables.rst | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/documentation/ref-manual/variables.rst b/documentation/ref-manual/variables.rst index 5d45f4a9f9..38b13ecf8d 100644 --- a/documentation/ref-manual/variables.rst +++ b/documentation/ref-manual/variables.rst | |||
| @@ -1202,13 +1202,32 @@ system and gives an overview of their function and contents. | |||
| 1202 | speed since the build system skips parsing recipes not compatible | 1202 | speed since the build system skips parsing recipes not compatible |
| 1203 | with the current machine. | 1203 | with the current machine. |
| 1204 | 1204 | ||
| 1205 | If one wants to have a recipe only available for some architectures | ||
| 1206 | (here ``aarch64`` and ``mips64``), the following can be used:: | ||
| 1207 | |||
| 1208 | COMPATIBLE_MACHINE = "^$" | ||
| 1209 | COMPATIBLE_MACHINE:arch64 = "^(aarch64)$" | ||
| 1210 | COMPATIBLE_MACHINE:mips64 = "^(mips64)$" | ||
| 1211 | |||
| 1212 | The first line means "match all machines whose :term:`MACHINEOVERRIDES` | ||
| 1213 | contains the empty string", which will always be none. | ||
| 1214 | |||
| 1215 | The second is for matching all machines whose :term:`MACHINEOVERRIDES` | ||
| 1216 | contains one override which is exactly ``aarch64``. | ||
| 1217 | |||
| 1218 | The third is for matching all machines whose :term:`MACHINEOVERRIDES` | ||
| 1219 | contains one override which is exactly ``mips64``. | ||
| 1220 | |||
| 1221 | The same could be achieved with:: | ||
| 1222 | |||
| 1223 | COMPATIBLE_MACHINE = "^(aarch64|mips64)$" | ||
| 1224 | |||
| 1205 | .. note:: | 1225 | .. note:: |
| 1206 | 1226 | ||
| 1207 | When :term:`COMPATIBLE_MACHINE` is set in a recipe inherits from | 1227 | When :term:`COMPATIBLE_MACHINE` is set in a recipe inherits from |
| 1208 | native, the recipe is always skipped. All native recipes must be | 1228 | native, the recipe is always skipped. All native recipes must be |
| 1209 | entirely target independent and should not rely on :term:`MACHINE`. | 1229 | entirely target independent and should not rely on :term:`MACHINE`. |
| 1210 | 1230 | ||
| 1211 | |||
| 1212 | :term:`COMPLEMENTARY_GLOB` | 1231 | :term:`COMPLEMENTARY_GLOB` |
| 1213 | Defines wildcards to match when installing a list of complementary | 1232 | Defines wildcards to match when installing a list of complementary |
| 1214 | packages for all the packages explicitly (or implicitly) installed in | 1233 | packages for all the packages explicitly (or implicitly) installed in |
