summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuentin Schulz <quentin.schulz@theobroma-systems.com>2023-10-17 13:45:29 +0200
committerSteve Sakoman <steve@sakoman.com>2023-10-25 04:51:01 -1000
commit1680e558e15755a8ef03207f8fd1096336009872 (patch)
tree3e15811cbbec7744542507ff2ea05f684fe9d67c
parent4d79b36d461de8bfd37654eb7eb73b0d0ff0169f (diff)
downloadpoky-1680e558e15755a8ef03207f8fd1096336009872.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: 051f868d1da1cbcd5726eb4c1e3f25946ce690e3) 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>
-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 0e11ab2f68..abd361bf63 100644
--- a/documentation/ref-manual/variables.rst
+++ b/documentation/ref-manual/variables.rst
@@ -1362,13 +1362,32 @@ system and gives an overview of their function and contents.
1362 speed since the build system skips parsing recipes not compatible 1362 speed since the build system skips parsing recipes not compatible
1363 with the current machine. 1363 with the current machine.
1364 1364
1365 If one wants to have a recipe only available for some architectures
1366 (here ``aarch64`` and ``mips64``), the following can be used::
1367
1368 COMPATIBLE_MACHINE = "^$"
1369 COMPATIBLE_MACHINE:arch64 = "^(aarch64)$"
1370 COMPATIBLE_MACHINE:mips64 = "^(mips64)$"
1371
1372 The first line means "match all machines whose :term:`MACHINEOVERRIDES`
1373 contains the empty string", which will always be none.
1374
1375 The second is for matching all machines whose :term:`MACHINEOVERRIDES`
1376 contains one override which is exactly ``aarch64``.
1377
1378 The third is for matching all machines whose :term:`MACHINEOVERRIDES`
1379 contains one override which is exactly ``mips64``.
1380
1381 The same could be achieved with::
1382
1383 COMPATIBLE_MACHINE = "^(aarch64|mips64)$"
1384
1365 .. note:: 1385 .. note::
1366 1386
1367 When :term:`COMPATIBLE_MACHINE` is set in a recipe inherits from 1387 When :term:`COMPATIBLE_MACHINE` is set in a recipe inherits from
1368 native, the recipe is always skipped. All native recipes must be 1388 native, the recipe is always skipped. All native recipes must be
1369 entirely target independent and should not rely on :term:`MACHINE`. 1389 entirely target independent and should not rely on :term:`MACHINE`.
1370 1390
1371
1372 :term:`COMPLEMENTARY_GLOB` 1391 :term:`COMPLEMENTARY_GLOB`
1373 Defines wildcards to match when installing a list of complementary 1392 Defines wildcards to match when installing a list of complementary
1374 packages for all the packages explicitly (or implicitly) installed in 1393 packages for all the packages explicitly (or implicitly) installed in