From patchwork Thu Sep 26 03:39:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "cedric.hombourger@siemens.com" X-Patchwork-Id: 3831 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Thu, 26 Sep 2024 05:43:53 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-qk1-f191.google.com (mail-qk1-f191.google.com [209.85.222.191]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 48Q3hh7f017078 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 26 Sep 2024 05:43:44 +0200 Received: by mail-qk1-f191.google.com with SMTP id af79cd13be357-7a9cc150294sf367485a.1 for ; Wed, 25 Sep 2024 20:43:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1727322217; cv=pass; d=google.com; s=arc-20240605; b=IOb/2VhMDoZDrkvMNnV8RoG5kIy+muBMcNiDAEVkomEI3q1xuwrNWT8OSakm8K74eY MKABfAljHVRr0YyH53l8X55/DhrFHwbxyyqzqC7Q3UffeIVh6M/nLte5FrhgeF1MMEm9 Twkb2s+u++WhgR56Gy90KLMjbf8FbnyJmlfxKfqNVJt7uA9pDtKutna8f1eM0FiAbltj KI2/GAXV7EDRNbzO8h5pAyl7j3Q+Kad1LpCuHefFWfiPsUOHYbwlbUux4uWHYcSrIt7h YxYocOm5muLoq+MVybxzKefHKpiz0Lfo5RyA94/LXpUO5Cl6BjNJShKyc8+5OV1Jftpp Qqow== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:feedback-id:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=tl9TKMQLhcnBEM/9Laeb+XKaYFbysUo9MBAwulhWw1k=; fh=E1obIYcDhnfCqQtEUAly3ORaYgnx8rR86Yk5Y/u2+YA=; b=MQe9k3PxjVJjJUz40ueGYLvGiFdA2oL4BIkU/Q4cHZOZh/mqtvLlznII12szDBPPbS Uje8kJW++jZgQE43mPS0fcAin/M6PLUkSduiERscvWWDNkHR4GWqmXGrr8z+bR/It/T6 B0vX/0x8CZgARr4+O5SEgSzQK6VUrVyqFrKXxD7cBh40K7eKXdlz9ir9AdhYoib0iMSE x+cSXfzzESktED2CrobtfhjAnyX4/rzZT+e557/LLdiAP6YNuRNW06DVx4znMoQW/Ybj scNWSmbYwSzi32SpBaFL1N4D9x+ePi7VHZkidSD86wUkq+vdj0914gSVrSo3iVLlTYyc Rxuw==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=opJser4D; spf=pass (google.com: domain of fm-1212295-202409260343358f05ab404e6db0c122-8wjpfe@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) smtp.mailfrom=fm-1212295-202409260343358f05ab404e6db0c122-8wjPfe@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1727322217; x=1727927017; darn=isar-build.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:feedback-id :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=tl9TKMQLhcnBEM/9Laeb+XKaYFbysUo9MBAwulhWw1k=; b=aMvJ3z6ksDMUbd273lLABz+jp4TgXX61tpm/yYrq5xk3UwZ2Zbc1cdjLcmGRLWZw5L TbAkcqamh6bV+Xwp1JXEtN6HLtdHFKWzawX+yxtWWAjPC+O5EgKKhYr+AUlzEdQhc9T/ QQBzOrTitZX5mlq8VePmDvoA/8GzuGekVxzRdVJLLlytxyYIfFb6vLBmrKHxFeXEZ5e2 6j5vyHPWj0hLWBk5d7Bx+dY1MKIUVBmWkjxckVw5Gv6/Ggb7BrvTknTfOCaJDuUI1cue dZu+eP+FrNMiadM54K1PVOdWRfKtpHmtYgareJKbIGiPgW71wHpavY7+C18szBES3zSt YbLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727322217; x=1727927017; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:feedback-id :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-beenthere:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=tl9TKMQLhcnBEM/9Laeb+XKaYFbysUo9MBAwulhWw1k=; b=IJSND0pJc6PjN0EHBtAoqKK+suwqIrsaOvUjXO4yc2oyXhXYV/O4K5vvGafJzN+wKE /6cWsQrGyXQpFsL+WVZyEDouMeL14O4y2nVJvymTm1Cd9p9k1aw3etC+8uKi4gmQ6/uV SmuXTPGtxp/jRJHvSswQdx/RNKvcd8o6Ff3Rt2yv4iBLNgwRIrbPkz9SckyIKLYrmJ/g 2nPTyJG4JTJh2k3Qi7jZetcx9ERKFoECDstgVv03hPs4/jsB34UvPdt7LtnexrXW57r0 8W84XaPLxAfu6pLhidibv9ARhaS4yMfvvrrQSvz3gZFCDIzVL7wIxt6+6LwVHulAmkE3 Jd8A== X-Forwarded-Encrypted: i=2; AJvYcCWcBqJj5wo+i68lIBl4dVOvqKYg4FLcASsdJD+O/4DybS/WbERgkmLirGir2k8upVvTD5Dk85Q=@isar-build.org X-Gm-Message-State: AOJu0YxlAHN3oSHhS3+a18h30GQDU+TXYPh5WfVj9T1WiMYxoPmskP5e sU73P47R4Uv0VdZpcz9f4HjVxNgtgG9TDpgxXs63h1ntWokid3+t X-Google-Smtp-Source: AGHT+IE+TivAegkf1QcUQc0eAMdopn8+qFaGxvDtlVewIOc2T8M18KKbHur8qS/11F8tvIqvUndU9g== X-Received: by 2002:a05:620a:460d:b0:7a8:491:2a04 with SMTP id af79cd13be357-7ace7157bf5mr354319885a.0.1727322217558; Wed, 25 Sep 2024 20:43:37 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:ac8:7d4a:0:b0:458:1588:173e with SMTP id d75a77b69052e-45c94adc664ls6984991cf.1.-pod-prod-03-us; Wed, 25 Sep 2024 20:43:36 -0700 (PDT) X-Received: by 2002:ac8:57ce:0:b0:455:b00:f02d with SMTP id d75a77b69052e-45b5e05004dmr67160371cf.49.1727322216418; Wed, 25 Sep 2024 20:43:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727322216; cv=none; d=google.com; s=arc-20240605; b=S5eZXtwecogQ7aUDiajgQ6NHE3hwbLxp9z0s10mfSWLgzCj5NaV1B+0eRNxJNs2uIP No5DMcjoHyGhLiBFcrsTuilKgXwxLsdm3a/NOa9IF5sCm7SX30192BATOwk/ep9PspN1 wWGPye+i4B47UzcqhGcDdOeEV7JuNrJuLHtL52I6tYOVixKR2QGqJCBGQy2DsKhAGVPK IYlNbIJ2aI3id/hXTsgvSZShuJ/crkKshoQ99jV/v/9Qw0cXuIJ2R01J2/bAhIsXX42u 28mo7PMlmxpxGdb/qIHTsuBXfzmBf2vGR4TqtwiSMRqsHEH4eXn/6aNlqwSy4o86l40B EABw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=feedback-id:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=z3QSLXUOhyQ/MzBTez8rUgiw0BgSvp79tYAc4oqYBIU=; fh=1z37pEVhqwMLlkT4FDzOga7XBsM6Rzv6sXOq0pipxqo=; b=ApfSTdB9byPdiShhwGAXDfJZeUlE6fDbU82ZraqZXeCsbgy3eZ6a/IXHzAWeKjp2wl 1gek7UIyoJE9tH4KMyIuu/AF16Ec5gDJIy/Vok58gNfJt2OUZIyQV8lZaCXYkbTWuUdA FfKr36C2Q1GmD5utw6mI0ytOq3YPz+XXZTyvEYrpBNHuz8FV22tQAiXeErvHdl4Tm9ht r4RjhYMwEq46Ukxo5hsLVTFQuXp6cOGE+1I/l6zx5PZrA8LCz0OXDBqTcU4xVnqExkwQ xacrrHmJqXuUiwiLHZGSNC6yypH0aaowSBeQ3BLZ1t1BUE0SZ/8a1MB0PdPgJy3pnk4z G82w==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=opJser4D; spf=pass (google.com: domain of fm-1212295-202409260343358f05ab404e6db0c122-8wjpfe@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) smtp.mailfrom=fm-1212295-202409260343358f05ab404e6db0c122-8wjPfe@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-65-227.siemens.flowmailer.net (mta-65-227.siemens.flowmailer.net. [185.136.65.227]) by gmr-mx.google.com with ESMTPS id d75a77b69052e-45b5274fc5csi2464971cf.3.2024.09.25.20.43.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Sep 2024 20:43:36 -0700 (PDT) Received-SPF: pass (google.com: domain of fm-1212295-202409260343358f05ab404e6db0c122-8wjpfe@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) client-ip=185.136.65.227; Received: by mta-65-227.siemens.flowmailer.net with ESMTPSA id 202409260343358f05ab404e6db0c122 for ; Thu, 26 Sep 2024 05:43:35 +0200 X-Patchwork-Original-From: "'Cedric Hombourger' via isar-users" From: "cedric.hombourger@siemens.com" To: isar-users@googlegroups.com Cc: Cedric Hombourger Subject: [PATCH v3 1/3] multiarch: introduce some helpers to later handle corner cases Date: Thu, 26 Sep 2024 05:39:33 +0200 Message-Id: <20240926033935.2955085-2-cedric.hombourger@siemens.com> In-Reply-To: <20240926033935.2955085-1-cedric.hombourger@siemens.com> References: <20240926033935.2955085-1-cedric.hombourger@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1212295:519-21489:flowmailer X-Original-Sender: cedric.hombourger@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=opJser4D; spf=pass (google.com: domain of fm-1212295-202409260343358f05ab404e6db0c122-8wjpfe@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) smtp.mailfrom=fm-1212295-202409260343358f05ab404e6db0c122-8wjPfe@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com X-Original-From: Cedric Hombourger Reply-To: Cedric Hombourger Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-Spam-Status: No, score=-4.9 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,RCVD_IN_RP_CERTIFIED,RCVD_IN_RP_RNBL,RCVD_IN_RP_SAFE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= -native / -compat do not always apply and some corner cases were found. Introduce some helper functions to refactor the existing code without changing its semantics for now. Signed-off-by: Cedric Hombourger --- meta/classes/multiarch.bbclass | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/meta/classes/multiarch.bbclass b/meta/classes/multiarch.bbclass index bb0f7983..802686d5 100644 --- a/meta/classes/multiarch.bbclass +++ b/meta/classes/multiarch.bbclass @@ -5,25 +5,35 @@ inherit compat python() { + archDiffers = d.getVar('HOST_ARCH') != d.getVar('DISTRO_ARCH') + + def pn_multiarch_target(pn): + return pn.endswith('-native') or pn.endswith('-compat') + + def extend_provides(pn, provides, d): + if not pn_multiarch_target(pn): + all_provides = (d.getVar('PROVIDES') or '').split() + for p in all_provides: + if not pn_multiarch_target(p): + d.appendVar('PROVIDES', f' {p}-{provides}') + d.appendVar('PROVIDES', f' {pn}-{provides}') + # provide compat only when we can build it if isar_can_build_compat(d): d.appendVar('BBCLASSEXTEND', ' compat') # build native separately only when it differs from the target variant - if d.getVar('HOST_ARCH') == d.getVar('DISTRO_ARCH'): + if archDiffers is False: pn = d.getVar('PN') - if not pn.endswith('-native') and not pn.endswith('-compat'): - provides = (d.getVar('PROVIDES') or '').split() - for p in provides: - d.appendVar('PROVIDES', f' {p}-native') - d.appendVar('PROVIDES', f' {pn}-native') + if pn_multiarch_target(pn) is False: + extend_provides(pn, 'native', d) else: d.appendVar('BBCLASSEXTEND', ' native') # drop own -native build dependencies at recipe level if building natively # and not for the builder architecture depends = d.getVar('DEPENDS') - if depends is not None and d.getVar('HOST_ARCH') != d.getVar('DISTRO_ARCH') \ + if depends is not None and archDiffers \ and not bb.utils.to_boolean(d.getVar('ISAR_CROSS_COMPILE')): new_deps = [] for dep in depends.split():