From: michael.opdenacker@bootlin.com
To: docs@lists.yoctoproject.org
Cc: Michael Opdenacker <michael.opdenacker@bootlin.com>,
Quentin Schulz <foss+yocto@0leil.net>,
Quentin Schulz <quentin.schulz@theobroma-systems.com>
Subject: [mickledore][PATCH 07/13] ref-manual: variables: provide no-match example for COMPATIBLE_MACHINE
Date: Tue, 24 Oct 2023 15:23:12 +0200 [thread overview]
Message-ID: <20231024132318.90209-8-michael.opdenacker@bootlin.com> (raw)
In-Reply-To: <20231024132318.90209-1-michael.opdenacker@bootlin.com>
From: Michael Opdenacker <michael.opdenacker@bootlin.com>
From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
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>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
---
documentation/ref-manual/variables.rst | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/documentation/ref-manual/variables.rst b/documentation/ref-manual/variables.rst
index 8d557495d4..eb19048db2 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.
speed since the build system skips parsing recipes not compatible
with the current machine.
+ If one wants to have a recipe only available for some architectures
+ (here ``aarch64`` and ``mips64``), the following can be used::
+
+ COMPATIBLE_MACHINE = "^$"
+ COMPATIBLE_MACHINE:arch64 = "^(aarch64)$"
+ COMPATIBLE_MACHINE:mips64 = "^(mips64)$"
+
+ The first line means "match all machines whose :term:`MACHINEOVERRIDES`
+ contains the empty string", which will always be none.
+
+ The second is for matching all machines whose :term:`MACHINEOVERRIDES`
+ contains one override which is exactly ``aarch64``.
+
+ The third is for matching all machines whose :term:`MACHINEOVERRIDES`
+ contains one override which is exactly ``mips64``.
+
+ The same could be achieved with::
+
+ COMPATIBLE_MACHINE = "^(aarch64|mips64)$"
+
.. note::
When :term:`COMPATIBLE_MACHINE` is set in a recipe inherits from
native, the recipe is always skipped. All native recipes must be
entirely target independent and should not rely on :term:`MACHINE`.
-
:term:`COMPLEMENTARY_GLOB`
Defines wildcards to match when installing a list of complementary
packages for all the packages explicitly (or implicitly) installed in
--
2.34.1
next prev parent reply other threads:[~2023-10-24 13:23 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-24 13:23 [mickledore][PATCH 00/13] mickledore documentation backports michael.opdenacker
2023-10-24 13:23 ` [mickledore][PATCH 01/13] ref-manual: Warn about COMPATIBLE_MACHINE skipping native recipes michael.opdenacker
2023-10-24 13:23 ` [mickledore][PATCH 02/13] bsp-guide: bsp: skip Intel machines no longer supported in Poky michael.opdenacker
2023-10-24 13:23 ` [mickledore][PATCH 03/13] sdk-manual: appendix-obtain: improve and update descriptions michael.opdenacker
2023-10-24 13:23 ` [mickledore][PATCH 04/13] dev-manual: new-recipe.rst: add missing parenthesis to "Patching Code" section michael.opdenacker
2023-10-24 13:23 ` [mickledore][PATCH 05/13] ref-manual: Fix PACKAGECONFIG term and add an example michael.opdenacker
2023-10-24 13:23 ` [mickledore][PATCH 06/13] profile-manual: aesthetic cleanups michael.opdenacker
2023-10-24 13:23 ` michael.opdenacker [this message]
2023-10-24 13:23 ` [mickledore][PATCH 08/13] dev-manual: layers: Add notes about layer.conf michael.opdenacker
2023-10-24 13:23 ` [mickledore][PATCH 09/13] brief-yoctoprojectqs: use new CDN mirror for sstate michael.opdenacker
2023-10-24 13:23 ` [mickledore][PATCH 10/13] dev-manual: start.rst: remove obsolete reference michael.opdenacker
2023-10-24 13:23 ` [mickledore][PATCH 11/13] ref-manual: variables: add RECIPE_SYSROOT and RECIPE_SYSROOT_NATIVE michael.opdenacker
2023-10-24 13:23 ` [mickledore][PATCH 12/13] ref-manual: variables: add TOOLCHAIN_OPTIONS variable michael.opdenacker
2023-10-24 13:23 ` [mickledore][PATCH 13/13] ref-manual: variables: add example for SYSROOT_DIRS variable michael.opdenacker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231024132318.90209-8-michael.opdenacker@bootlin.com \
--to=michael.opdenacker@bootlin.com \
--cc=docs@lists.yoctoproject.org \
--cc=foss+yocto@0leil.net \
--cc=quentin.schulz@theobroma-systems.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox