From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7057122428766388224 X-Received: by 2002:ac8:7d87:: with SMTP id c7mr22031994qtd.277.1643785048040; Tue, 01 Feb 2022 22:57:28 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6214:2a48:: with SMTP id jf8ls10315245qvb.8.gmail; Tue, 01 Feb 2022 22:57:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJyfX8b3ZSe9goSJ24rTW63v8JprEp/VSDEa5wE4eNRIJhSBqoJhGboTAL4mI4Exm387Y9Eh X-Received: by 2002:a05:6214:262c:: with SMTP id gv12mr26235438qvb.74.1643785047635; Tue, 01 Feb 2022 22:57:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1643785047; cv=pass; d=google.com; s=arc-20160816; b=AchknrYZsqFMGrxzDx/LfSgwsUeqs/+WxqsbQDnOHnANexOYzejlUy+VNYcjO9NWnQ xCnBUlPi58djoHm+cIWlugJqkfs0g7xVSYc7VMDw767sgG4oiAH5LonSH2s9c67Mo4LT u3JUM9xZgD9vDXYyV5nqZYtjB7kJL9T9weQgpcfIQ7kn/GEBYDMABlRXVSP3Io7By0bK 6HMULQzHwJ/CHdluhSMiEX3WaVU3eIBLdX10SxSngZJlA3M92ZN62KHG7rbCZlDj3OZY CAaqfMLaR5K7q84IJAH5VlSFhcW+P3eojMc8ocX5lw2ekskCCSc/PwlwrkoL2JBu4pGA 5hcg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :dkim-signature; bh=VibLjZvBAuy5dR3a5jHefaoiWd006o6U53P4Rw6Kiso=; b=JtTFu/idbVF4ZyJPbJxEzzJHJX3xE7oQn5jLEoeXIHRrJ5M2I8G6CpseH3qUo5klRz 4I+HXsmag45RpCzE1ej5qx4iPtt1nIQHtmjIY2N8BAMB5H8BNOTe8omIbBCobUiXPp8w P09B5qXkSsNXBc4OXlgD6vbjGuMijtneY+iVnpyApM3bWioyK5G7i3FDrwrL4+vMfSVk Xv6x6SHVTurUg0KJ2bO7kKnHF0WQXckbxFja06iZuRBpQK6HS/Osw0P6dQd49zJSqT9x Py+d8TuSlFKJJx7V3ni1f+HMrkXGxRv6HNgz1UbY33ZshcG+U61xIjUL68kOoBqJZx+1 7Xxg== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=oBciI15y; arc=pass (i=1 spf=pass spfdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of jan.kiszka@siemens.com designates 40.107.5.58 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50058.outbound.protection.outlook.com. [40.107.5.58]) by gmr-mx.google.com with ESMTPS id bm4si3893937qkb.6.2022.02.01.22.57.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Feb 2022 22:57:27 -0800 (PST) Received-SPF: pass (google.com: domain of jan.kiszka@siemens.com designates 40.107.5.58 as permitted sender) client-ip=40.107.5.58; Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=oBciI15y; arc=pass (i=1 spf=pass spfdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of jan.kiszka@siemens.com designates 40.107.5.58 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GnW1udv2VnWwwb37G0XbJQqB/2iyy1VaqeEm3zwS+okAviOMWeyPF2+U7bRp9HtVodP+G483Mk1mJ3aewEb+8VqNcs/a3rCpzYaiXbypG1qv136AvTylpH8EcsLTsK9pCT5AuLTYot0hW6/4iXW5sLgJ/tSiHYsXOqqRwQBiIh2YBYtS0wBgWfTA/bxT+P6Rt1NXDNOhPMQw9oVla1sQjMmFNa4SvAfG5+89ELW6Es6j5YAh1j2ZSX45W7hfodvX3bE+XmpX92dPUjJTZ2kH6eMKWAXOk8ufjMMceDcFbewOkohMKWvMDbwXAcGbr93ijiSxZjwQUp99PBM89VI1Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VibLjZvBAuy5dR3a5jHefaoiWd006o6U53P4Rw6Kiso=; b=FoQ8KbjWMp6QWPLDZFm6itmjIk2sHQvAjJiCz06RektQ3OdM2XBpr1ymcFY1kq8ihZUA3Onng8PqnJtKM4YEATppoTAiSfk/WswwZuJBh/NEA2olwt/8+WwKtPRmRv0kZACbeQtogoA9DyhyZS8dT7H/IKat5D3GyR/SeZBFaKI2gmNSFEsf+rctfHD+bHhzaubiQ9x8GOy8X/+S5gKbTjyPwdMRXBvzGlcx3RenenpPTr8rJPx3EtUzBQP9o48d0VphU6+li0v9ta8wnLx5SN1Yoz4DEVR8pFBHaVc6SY6Xbzjify7cugpCZiVcLTWLF30lO56UYj827IK4ev5UAw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 194.138.21.71) smtp.rcpttodomain=ilbers.de smtp.mailfrom=siemens.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=siemens.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=siemens.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VibLjZvBAuy5dR3a5jHefaoiWd006o6U53P4Rw6Kiso=; b=oBciI15y1Gh6d8cKETEuX3hGrTeaw/a7aZdlpdsXm5pocRfSdXHgCy+UQ+Baue7T7PfbOlgCZ/yw97tMthnqePTxEvRVwht6Zib+lVIBLRB2QiLwkTMeLokayZY1RgiiogMMbE9GJsmb4kWWGXm3Xtw5IRq97GIsXlYQGKA+SX2gQgM7XETXdzEqHgA0/0Xosht5lwvUvAi+W0gc+6IwXkJPl9qmjssiwC1EDWYuTvr58BUff6GlthMSyhhHgp72JKrFd2euCVej51af2YuC66e2l2z/E4FP+L0bQlmuaZGHPkzn7E6y1x5P8ietd2Hxq8qSJ+eSE/+W/KewPOu/bQ== Received: from DU2PR04CA0268.eurprd04.prod.outlook.com (2603:10a6:10:28e::33) by PR3PR10MB4286.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:102:aa::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.18; Wed, 2 Feb 2022 06:57:25 +0000 Received: from DB5EUR01FT032.eop-EUR01.prod.protection.outlook.com (2603:10a6:10:28e:cafe::3a) by DU2PR04CA0268.outlook.office365.com (2603:10a6:10:28e::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.22 via Frontend Transport; Wed, 2 Feb 2022 06:57:25 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 194.138.21.71) smtp.mailfrom=siemens.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=siemens.com; Received-SPF: Pass (protection.outlook.com: domain of siemens.com designates 194.138.21.71 as permitted sender) receiver=protection.outlook.com; client-ip=194.138.21.71; helo=hybrid.siemens.com; Received: from hybrid.siemens.com (194.138.21.71) by DB5EUR01FT032.mail.protection.outlook.com (10.152.4.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4951.12 via Frontend Transport; Wed, 2 Feb 2022 06:57:25 +0000 Received: from DEMCHDC8A0A.ad011.siemens.net (139.25.226.106) by DEMCHDC9SKA.ad011.siemens.net (194.138.21.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.18; Wed, 2 Feb 2022 07:57:24 +0100 Received: from [167.87.1.21] (167.87.1.21) by DEMCHDC8A0A.ad011.siemens.net (139.25.226.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Wed, 2 Feb 2022 07:57:23 +0100 Message-ID: <9f8b4874-62b5-546f-5dc9-8d9c0bd5b1cf@siemens.com> Date: Wed, 2 Feb 2022 07:57:22 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v5 07/12] sbuild: support of shell exports from dpkg_runbuild_prepend Content-Language: en-US To: Uladzimir Bely , References: <20220201170038.5723-1-ubely@ilbers.de> <20220201170038.5723-8-ubely@ilbers.de> <0e396fe1-889c-8c38-de5d-91274222b955@siemens.com> <3317197.LZWGnKmheA@home> From: Jan Kiszka In-Reply-To: <3317197.LZWGnKmheA@home> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-Path: jan.kiszka@siemens.com X-Originating-IP: [167.87.1.21] X-ClientProxiedBy: DEMCHDC89YA.ad011.siemens.net (139.25.226.104) To DEMCHDC8A0A.ad011.siemens.net (139.25.226.106) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ee579b97-9f99-4f57-2868-08d9e61944b9 X-MS-TrafficTypeDiagnostic: PR3PR10MB4286:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ElLOITwW5SfXr/2lzYq+5jKeYZnghfUss8Zooa067r248iGGUohnQOp/UY6oVIjLP7j3p6+MNt0aj+9xgbULjZc4w5Bit+qTqGsxex+ym0ZTfaZMrX9fzq4UEpPrmlAxP2Z8dBXDJGv2mh9s3Bjwv6g9vL1BVRa5htHAUNuQYVmNOk0h/i4H9B+zYTPpyCd0ddXl2Gnpe5LQCSI+A5XVQ0XtFSLn6SpKvlgXpB4hfILaZVW3rydm1yI/f1T/uyaHRgihYmZUdLXUEUj7RAuhUzy2/5CUcJ7vHAwV/WqcQvDj+8gT0MhO4a+4wlY4+BOE4rSOMPqD8pGXteUDDeRgSivcwB7EUCsbfuO6RJzXqn0knupCW93U/cS1jqMqDX+aiKqH/NV48Gk5P1e8yDebi0II/TEICRB0Z7DBBJ5gyX6Rc/H9spPrRCFY93xFtiP9bpiwuDLBskPa0/aK4Ex4gQTij8e5EQz51LB5+TX18Pw3z7pxjDyNcuCJixUMYVB7n1MSD4hhQu6C9I/SQy/gBk6mu2xse2cP8fm/X/DmcJdCNIGkcmARG7ePiwbAiNMBupXgnZy7R0dnB7dC4/SXK7tJUPgl5UOXN/rs/qCu4RJeM3vwErP4FB46fMMwMpEH7MpBcFOZl9wTjHuR5/qWSZCV160ZZ/numY0PMwvpY2TZfX4Yj2SWlVV6+Gam8+ssG8J1bQUh6HVPLLzScXZi/Huqn5WuT9Yopm7IeTzu0hIU0cM+AkVR7s0SDgDolkR9FHvxYK0ix3ONgJEyu7KPSQ== X-Forefront-Antispam-Report: CIP:194.138.21.71;CTRY:DE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:hybrid.siemens.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230001)(4636009)(46966006)(36840700001)(40470700004)(44832011)(70206006)(31686004)(70586007)(82960400001)(336012)(2616005)(31696002)(40460700003)(8936002)(5660300002)(8676002)(86362001)(83380400001)(2906002)(356005)(36756003)(81166007)(26005)(53546011)(186003)(956004)(16576012)(16526019)(47076005)(6706004)(110136005)(508600001)(36860700001)(316002)(82310400004)(3940600001)(36900700001)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2022 06:57:25.0254 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ee579b97-9f99-4f57-2868-08d9e61944b9 X-MS-Exchange-CrossTenant-Id: 38ae3bcd-9579-4fd4-adda-b42e1495d55a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=38ae3bcd-9579-4fd4-adda-b42e1495d55a;Ip=[194.138.21.71];Helo=[hybrid.siemens.com] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR01FT032.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR10MB4286 X-TUID: qC2u85NeYBk6 On 01.02.22 19:41, Uladzimir Bely wrote: > In the email from Tuesday, 1 February 2022 21:09:07 +03 user Jan Kiszka wrote: >> On 01.02.22 18:00, Uladzimir Bely wrote: >>> Many of recipes often use shell exports done in dpkg_run_prepend, so that >>> this changed environment is used during build. >>> >>> While sbuild is performed in isolated environment, we need a way to >>> pass these variables to it. This is done by storing environment before >>> dpkg_runbuild (after prepare_build) and finding just before the actual >>> build what was changed or added. >>> >>> Signed-off-by: Uladzimir Bely >>> --- >>> >>> meta/classes/dpkg.bbclass | 18 ++++++++++++++++++ >>> 1 file changed, 18 insertions(+) >>> >>> diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass >>> index 66db7ec5..c252e9b3 100644 >>> --- a/meta/classes/dpkg.bbclass >>> +++ b/meta/classes/dpkg.bbclass >>> @@ -29,12 +29,30 @@ do_install_builddeps[lockfiles] += >>> "${REPO_ISAR_DIR}/isar.lock"> >>> addtask devshell after do_install_builddeps >>> >>> +DPKG_PREBUILD_ENV_FILE="${WORKDIR}/dpkg_prebuild.env" >>> + >>> +do_prepare_build_append() { >>> + env > ${DPKG_PREBUILD_ENV_FILE} >>> +} >>> + >>> >>> # Build package from sources using build script >>> dpkg_runbuild() { >>> >>> E="${@ isar_export_proxies(d)}" >>> E="${@ isar_export_ccache(d)}" >>> export PARALLEL_MAKE="${PARALLEL_MAKE}" >>> >>> + env | while read -r line; do >>> + # Filter the same lines >>> + grep -q "^${line}" ${DPKG_PREBUILD_ENV_FILE} && continue >>> + # Filter some standard variables >>> + echo ${line} | grep -q "^HOME=" && continue >>> + echo ${line} | grep -q "^PWD=" && continue >>> + >>> + var=$(echo "${line}" | cut -d '=' -f1) >>> + value=$(echo "${line}" | cut -d '=' -f2-) >>> + sbuild_export $var "$value" >>> + done >>> + >>> >>> profiles=$(grep "DEB_BUILD_PROFILES" ${SBUILD_CONFIG} | tail -n1 | >>> cut -d "'" -f 4) if [ ${ISAR_CROSS_COMPILE} -eq 1 ]; then >>> >>> profiles="${profiles} cross nocheck" >> >> So, this basically decouples "Avoid using shell environment during the >> build" and similar conversions downstream from this series, right? It's >> indeed good to have a compat path now. >> >> However, what are the patterns we want to push? Avoiding exports? Then >> we should probably warn here that this compat path should be avoided and >> might be removed in the future. >> >> If we want to keep both, we can probably leave several recipes alone in >> that other series. >> >> Jan > > You might be right. Current solution doesn't force users to avoid using > exports while they are silently supported. > > The first internal solution was keeping dpkg_build_export function but also > passing custom shell exports (from dpkg_runbuild_prepend) to sbuild > environment. And a warning about migration was shown. > > Later I removed this to make new patchset less invasive for downstreams. > Anyway, if we agree that "dpkg_build_export" (like API function) is more > preferable, I can get back this solution with warnings. > This is not necessarily what I'm suggesting. Your conversion series works without that API, primarily using template. We also have build profiles. But we first of all need to define what we actually want. The benefit of pushing things into the build env, rather than feeding it from the recipe, is likely that the resulting deb-src of such generated packages can actually be used for rebuilding independently of Isar. So there is likely value in deprecating classic export. Jan -- Siemens AG, Technology Competence Center Embedded Linux