summaryrefslogtreecommitdiffstats
path: root/documentation/ref-manual
diff options
context:
space:
mode:
authorQuentin Schulz <quentin.schulz@theobroma-systems.com>2023-10-17 13:45:29 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-10-20 14:40:29 +0100
commitefd54e4d1dfcf99926ebd80bf9f091fc2d9a9508 (patch)
tree5f99c43ad2bd1bc6ce66d0384a3920bbdade4991 /documentation/ref-manual
parent7bd773fc00f00904bf4e4efa721eb6a8642a15f6 (diff)
downloadpoky-efd54e4d1dfcf99926ebd80bf9f091fc2d9a9508.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: 52196d39bc85de267daffb0074eb59786751f57d) Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com> Reviewed-by: Michael Opdenacker <michael.opdenacker@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation/ref-manual')
-rw-r--r--documentation/ref-manual/variables.rst21
1 files changed, 20 insertions, 1 deletions
diff --git a/documentation/ref-manual/variables.rst b/documentation/ref-manual/variables.rst
index cf69d5a86c..26a5aed827 100644
--- a/documentation/ref-manual/variables.rst
+++ b/documentation/ref-manual/variables.rst
@@ -1358,13 +1358,32 @@ system and gives an overview of their function and contents.
1358 speed since the build system skips parsing recipes not compatible 1358 speed since the build system skips parsing recipes not compatible
1359 with the current machine. 1359 with the current machine.
1360 1360
1361 If one wants to have a recipe only available for some architectures
1362 (here ``aarch64`` and ``mips64``), the following can be used::
1363
1364 COMPATIBLE_MACHINE = "^$"
1365 COMPATIBLE_MACHINE:arch64 = "^(aarch64)$"
1366 COMPATIBLE_MACHINE:mips64 = "^(mips64)$"
1367
1368 The first line means "match all machines whose :term:`MACHINEOVERRIDES`
1369 contains the empty string", which will always be none.
1370
1371 The second is for matching all machines whose :term:`MACHINEOVERRIDES`
1372 contains one override which is exactly ``aarch64``.
1373
1374 The third is for matching all machines whose :term:`MACHINEOVERRIDES`
1375 contains one override which is exactly ``mips64``.
1376
1377 The same could be achieved with::
1378
1379 COMPATIBLE_MACHINE = "^(aarch64|mips64)$"
1380
1361 .. note:: 1381 .. note::
1362 1382
1363 When :term:`COMPATIBLE_MACHINE` is set in a recipe inherits from 1383 When :term:`COMPATIBLE_MACHINE` is set in a recipe inherits from
1364 native, the recipe is always skipped. All native recipes must be 1384 native, the recipe is always skipped. All native recipes must be
1365 entirely target independent and should not rely on :term:`MACHINE`. 1385 entirely target independent and should not rely on :term:`MACHINE`.
1366 1386
1367
1368 :term:`COMPLEMENTARY_GLOB` 1387 :term:`COMPLEMENTARY_GLOB`
1369 Defines wildcards to match when installing a list of complementary 1388 Defines wildcards to match when installing a list of complementary
1370 packages for all the packages explicitly (or implicitly) installed in 1389 packages for all the packages explicitly (or implicitly) installed in