From patchwork Fri Mar 3 10:20:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Schmidt, Adriaan" X-Patchwork-Id: 78 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Fri, 03 Mar 2023 11:20:58 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-lf1-f58.google.com (mail-lf1-f58.google.com [209.85.167.58]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 323AKv3l028314 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 3 Mar 2023 11:20:57 +0100 Received: by mail-lf1-f58.google.com with SMTP id e21-20020a196755000000b004a28ba148bbsf864140lfj.22; Fri, 03 Mar 2023 02:20:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1677838851; cv=pass; d=google.com; s=arc-20160816; b=O0zguw9hnL/1CT108JKogCHQksa8RFFABM4Wj4Zbewho+zV4/428GHnxJ3gdJKH6Ia YeovFyqPPoP/gaZhCc03ICktl3G6ugetDX2u99S8ln94E5XxSgR2agbtgPrsmPlitYbb uv39+HftnBKBFZ2w+UQkNrMXe9esXxWIZuUN7YVjQldFx0rM0HVvMlBPC6OigiFhg5sq KY6KqeGfHWYs/dCH+pmFIitqBD0KPGxhPXBPRoGVjRzBj4NuBfo3dXNW0hORmbD/JHaw HZWSPoG8QYsa102igbtHMoJjTqbINgsMHMgKRbU2Tlvly5YCYu+xlFVgAGjdO0r/HrAO kTxA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:feedback-id:mime-version:message-id :date:subject:cc:to:from:sender:dkim-signature; bh=zl2aPqBpnO+XsQqLG4j7+qvWO0oiF0dGd6PvhVJHA8A=; b=ISxeTBmmB8vELSifDu7hJpvfgX3IXv56YKL987xXsDqPkR9f1ccZu8RHfebMVRCRcM UgI3nQThVq02hAD8yxaiRLEgZzHOV6lOtZXs+LL83i0soihph8g4Ihlsn3EEKOX2pmRw IdqVnj9gnJw1BfEXsvMe0+bjg2gKG7AhTdAJ/T+eg/5CoZ8aSFaRyvcvaJC+3cSsIXRs iKNtmA178hJ28cOJKmVQiXtIiERS4//wFqjWkRV4PvsRUlqt6O+9YqPAJYh2a6iEUhgb IPn07OB0BwANOMi9bSxXge6PniRopd5WokkllxAXLu1tZ1aP/BSIiiGWklRiwAbMhdPq 9r8w== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=Kl7kh3o9; spf=pass (google.com: domain of fm-526363-202303031020477dee7728a62092cfc0-xxjv1k@rts-flowmailer.siemens.com designates 185.136.65.225 as permitted sender) smtp.mailfrom=fm-526363-202303031020477dee7728a62092cfc0-xxjv1k@rts-flowmailer.siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; t=1677838851; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:feedback-id:mime-version:message-id:date:subject :cc:to:from:sender:from:to:cc:subject:date:message-id:reply-to; bh=zl2aPqBpnO+XsQqLG4j7+qvWO0oiF0dGd6PvhVJHA8A=; b=NLF5PlN0RO3shHFSBoeAEegxWucsejUPlci7POOFHiAed0r7rVGr1z04gQBS1ZYYfN sgsg3j1eVcBBU6y47pP8aCFXVn+Laq+EYmbIl2VVwQOXZgrQTjhrFh8qWjfb0cmlBvLh 8Z5nys86DOYtfm6FJNZNlttx0alHzpM+gzoLGwNdsYSh2nNbb0Qk15Rj2meAccvh66NS Q+dGEYbpPZSz0SzuiS3mEwpu8smxEavpypHT+cVAWW/Y4PGwK2CXyq9PE3q1AzweW81s u87kW8/p5zCTvnIKxtdfjV0X3j6AUT63cQgEQWNPw/XdQiOZLnQMG8I/ZHYdbVhn1+FH 2MXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677838851; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:feedback-id :mime-version:message-id:date:subject:cc:to:from:x-gm-message-state :sender:from:to:cc:subject:date:message-id:reply-to; bh=zl2aPqBpnO+XsQqLG4j7+qvWO0oiF0dGd6PvhVJHA8A=; b=of0SIQPJ42fr9S016PYJEaS6zGI0u4hIwpLclaqY64MsuCbaMQcQ6u6E8n721HYrc4 OkJ6mCuQzzu0Y0d7CFNBS6ujmRh/BCLVe+Pzq1p3MMYZXDhqKEj/5UjU1Q+Kxgb1uMyN HoreEyQdyaT2AQmqkhqs0/BQeGtu50loaP1+Ye/1diCbB06+d+I82zEGmkeihMxgsYpZ 2DkxzZ31vs8X0gWWsAWuQnFIpmPWdYm5YZGfUq7cdUPqBgEeHmwxFJcMOoEd9cbpIGW7 1cEw7NiKCoeU0TJJgOgmm1oTzrxIl7ra7AthkOSN0BerJqePICwBpDR/rdN8jF0Z50W7 SB8Q== Sender: isar-users@googlegroups.com X-Gm-Message-State: AO0yUKVZjeMTnu7RTAFqdl8nXPsTxw0yjUpeVqn+Je5mi1F+lzkywnTd l9226koNk6JrNAAU0sJNor8= X-Google-Smtp-Source: AK7set9yJNjvJhVOnB+FAf2p2gRN7MOP+a8Cf10Qh1pifci5F4bq4vpbGimjHhN0YK5nWzm3BNKa4w== X-Received: by 2002:ac2:43d5:0:b0:4db:266c:4337 with SMTP id u21-20020ac243d5000000b004db266c4337mr475649lfl.1.1677838851387; Fri, 03 Mar 2023 02:20:51 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:651c:220b:b0:28b:d53d:2e29 with SMTP id y11-20020a05651c220b00b0028bd53d2e29ls502726ljq.2.-pod-prod-gmail; Fri, 03 Mar 2023 02:20:49 -0800 (PST) X-Received: by 2002:a05:651c:54c:b0:295:9010:6f76 with SMTP id q12-20020a05651c054c00b0029590106f76mr526662ljp.1.1677838849809; Fri, 03 Mar 2023 02:20:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677838849; cv=none; d=google.com; s=arc-20160816; b=Mj3WRekgIXK6AqyFYMi2DY3nDzJ9Zpzzk7m5nEguQpdK/QuyCrGAEderuToccJ2Epf PCD7YA/rlSrtVrg36DPk4/1vhRA6aDqnmAi45vgV0AZCG792AM1tG1k+m8qpAu71ug4T Q8hTnqIJWfUdMMwTTKYe64Ca41Nd3WMeszOr6Qhe1jKiyi78CLdl0+GIfQSLbUWbcZQO q4mHt1/EmFt2By2ysMzcJjIyJlVnIKYqedyU7THo3ymC2AG6E0lEW5ruJCicVtPTYIns WSW+Jo6U5RG5WX8D6wqEUsfZcGxXkj49fCWIPjg8nJdmZrBzyUqIIE/9dkQcqTCRwNOq 3A7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=feedback-id:content-transfer-encoding:mime-version:message-id:date :subject:cc:to:from:dkim-signature; bh=ovZ3qEA8O9kKQByec0xkOisAEygPA+rCpu8Gm1551Zo=; b=qKfoEnnw+SqwloB2cGEetITu+kbBCKNAv2L4p4YwchPZZf/0dQA4JSX0xqos8Tt54v 20mDrzsqil+T5NJKVBzPMI1mYEM6/XJM2VHeFHh+pXSHEGbsrqXsZLjVjMpOd/FkQAoI jj4gZAP/7HFaIKZgQBabd5tT+k2fC5G+/cPXlbz32nDxJnmPGdCOmf0l3+aM5r9HswMF m4PITPY2YdnbOxHHREVsipuydu0ez3k01Q+It7yoqcSu3+vv+vroeblHbJ15K6HtUCbe hc7SgRLuflpQf+j2lPBJgsLBZ7DzjE3/LMfOHE4tq0KQJQREZ0X+QCfsBKjPYhcW7Trq 5Kow== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=Kl7kh3o9; spf=pass (google.com: domain of fm-526363-202303031020477dee7728a62092cfc0-xxjv1k@rts-flowmailer.siemens.com designates 185.136.65.225 as permitted sender) smtp.mailfrom=fm-526363-202303031020477dee7728a62092cfc0-xxjv1k@rts-flowmailer.siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mta-65-225.siemens.flowmailer.net (mta-65-225.siemens.flowmailer.net. [185.136.65.225]) by gmr-mx.google.com with ESMTPS id y14-20020a05651c154e00b00295a255ee26si69981ljp.6.2023.03.03.02.20.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Mar 2023 02:20:49 -0800 (PST) Received-SPF: pass (google.com: domain of fm-526363-202303031020477dee7728a62092cfc0-xxjv1k@rts-flowmailer.siemens.com designates 185.136.65.225 as permitted sender) client-ip=185.136.65.225; Received: by mta-65-225.siemens.flowmailer.net with ESMTPSA id 202303031020477dee7728a62092cfc0 for ; Fri, 03 Mar 2023 11:20:47 +0100 From: Adriaan Schmidt To: isar-users@googlegroups.com Cc: Adriaan Schmidt Subject: [PATCH v4 0/4] multiarch support Date: Fri, 3 Mar 2023 11:20:41 +0100 Message-Id: <20230303102045.4140027-1-adriaan.schmidt@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-526363:519-21489:flowmailer X-Original-Sender: adriaan.schmidt@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=Kl7kh3o9; spf=pass (google.com: domain of fm-526363-202303031020477dee7728a62092cfc0-xxjv1k@rts-flowmailer.siemens.com designates 185.136.65.225 as permitted sender) smtp.mailfrom=fm-526363-202303031020477dee7728a62092cfc0-xxjv1k@rts-flowmailer.siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com 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=-0.9 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,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?= This adds `-compat` and `-native` bitbake targets to all recipes inheriting dpkg-base. The new -compat build variant replaces the old compat mechanism. Note that `ISAR_ENABLE_COMPAT_ARCH="1"` is still required to ensure that the bootstrap and buildchroot is prepared correctly. Regarding testing of the new features: - we have (limited) testing of compat, by adding `hello-isar-compat` to amd64 and arm64 builds. - currently no testing of native. There are two main use cases for the feature: - SDK that needs `-native`. This could be turned into a test easily, by setting/appending SDK_INSTALL. Would require a new option in testsuite, similar to `image_install` introduced in 57a0ade9a. - A build tool that is provided by a recipe, when using it in cross compilation. E.g. if someone needed a patched cmake, they would write cmake.bb, and applications that need it would (in case cross compilation is enabled) DEPEND+="cmake-native". Or, another real-world example from a downstream layer: packaging applications with goreleaser, which is not found in the Debian apt repos. Instead, I'm fetching it via a dpkg-prebuilt recipe, written to support multiple architectures (architecture is part of the download URL). Now if I want to cross compile go applications, they DEPEND+="goreleaser-native", and DEBIAN_BUILD_DEPENDS_append=", goreleaser:native". These cases are more complex, but maybe we can find an example along those lines and add it to meta-isar. As testing of the native feature would (in the simple case) need an extension of the test classes (for SDK_INSTALL), or introduce something completely new into meta-isar, I'd like to do that after discussion, in a later series. Adriaan changes since v3: - removed the unneeded (expand=)True argument from d.getVar() calls - changed "calculate" to "determine" in comment - added note to RECIPE-API-CHANGELOG changes since v2: - fixed a bug that completely broke things for targets without a compat arch (e.g., i386). The compat variant of packages is now only available when it can actually be built. - the native variant is only generated if it differs from the target. If DISTRO_ARCH==HOST_ARCH, then `-native` is automatically provided by the target package. - also do the bitbake-target->debian-package transformation on SDK_INSTALL - fix compat packages in testsuite: when we add hello-isar-compat, we need to remove hello-isar. changes since v1: - fixed an issue that prevented arch overrides of ISAR_ENABLE_COMPAT_ARCH, which is used in testsuite - added `-native` expansion to contents of IMAGE_INSTALL - documentation in user_manual Adriaan Schmidt (4): bitbake.conf: use PACKAGE_ARCH in overrides add multiarch support remove obsolete compat-arch override doc: add compat/native targets to user manual RECIPE-API-CHANGELOG.md | 8 ++ doc/user_manual.md | 19 ++-- .../recipes-app/hello-isar/hello-isar.bb | 3 - meta-isar/recipes-app/libhello/libhello.bb | 3 - .../recipes-app/samefile/samefile_2.14.bb | 2 +- meta/classes/compat.bbclass | 40 +++++++++ meta/classes/debianize.bbclass | 2 +- meta/classes/dpkg-base.bbclass | 1 + meta/classes/image.bbclass | 4 +- meta/classes/multiarch.bbclass | 88 +++++++++++++++++++ meta/classes/native.bbclass | 10 +++ meta/classes/sdk.bbclass | 2 +- meta/conf/bitbake.conf | 6 +- .../isar-bootstrap/isar-bootstrap.inc | 2 + .../sbuild-chroot/sbuild-chroot.inc | 14 +-- testsuite/cibuilder.py | 4 + 16 files changed, 182 insertions(+), 26 deletions(-) create mode 100644 meta/classes/compat.bbclass create mode 100644 meta/classes/multiarch.bbclass create mode 100644 meta/classes/native.bbclass