From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7057122428766388224 X-Received: by 2002:a05:600c:1795:: with SMTP id x21mr5174504wmo.63.1643791954466; Wed, 02 Feb 2022 00:52:34 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:600c:3487:: with SMTP id a7ls2515268wmq.2.canary-gmail; Wed, 02 Feb 2022 00:52:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJzYrI9XAjiorzcxHfUF+EcXjsaRJQd2C63P2OQMaSPvEv7pW3PYAJ3uQJDlOuTbmdNCuqSp X-Received: by 2002:a7b:c44d:: with SMTP id l13mr5037479wmi.46.1643791953550; Wed, 02 Feb 2022 00:52:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1643791953; cv=pass; d=google.com; s=arc-20160816; b=uq5F9IlJESbCljs+VT8gEXB255siJTRAubj4VeHU9/k9e3M2s9dnpTmAFD+Jq0dnn3 GTwKQqxAUgzm1GApHcLV59k1mJF/xr8n2OVTH1CCzvxYXzFaWnj80VRTK2lbqEnBLnEy /+jo8Pdh4g25auC51MXmPAhihu4zGRvwifKDCWTx1hXO2Ewuu6Gr9uJqeDBZh8bRqI6e fjGz+ijkfEhSn5IMKdO6kHItTwdfZuQs2I4TnhGlA8fQqVkSB/rHTG9YEekXvoWlTCGc 5D3Z4GkQLy1+m4BAQvxZhV9sbBF4859Xt4Kk8acNKMNmsyO4IYNlgDY1XhsKrQykdM8S QYeg== 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=4K2sCJcS+/8V6P/8rMR7Xt4b+48xLuBWsR0HcXfJwpU=; b=G1PQ1FdIjC8RBwXk63/6Y8ANNBvEiipjOFTpUln5BGKXLQWKdFGn7Wdl3ZdaSTWwUT FT2xGvyCyXtHDr1IWZ2Xuq1wS5DZEarBJdc2bY/IR0oebVDtvrw2SNS1ODUPkToiG54K ReDeap6agRktE3Na+b75/gsY7qPDRBEJc+Pm95KCaXdIS/zR0+biSVZvNKeb3maFdMYu TjjGS1/0jfY5cwMfHp9Y+J2FWYHqT5OOWL/PoJmr0EzDchWcBI1uSXIcHQ+vn3Qfg9FB VI343dG4L7aSendXU7WHKm0ZETHxr4/x+eFrOAbfJYV35gBSKh5YJLEpj9Hsy9hIejmJ UiQA== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=oOZsR6Vs; 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.14.73 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 EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140073.outbound.protection.outlook.com. [40.107.14.73]) by gmr-mx.google.com with ESMTPS id ay18si1308357wrb.1.2022.02.02.00.52.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Feb 2022 00:52:33 -0800 (PST) Received-SPF: pass (google.com: domain of jan.kiszka@siemens.com designates 40.107.14.73 as permitted sender) client-ip=40.107.14.73; Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=oOZsR6Vs; 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.14.73 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=C2RZApVQKthYpCjhnVJHdc9y9M/7RfJkvpd5Vm+lsZJDeoqucXAz9c7omVTl28uMf2Rd+lUxJq+zoI79tFAaLcUAdx22zVEngTyJFCMTvv8ObMPUteGlMoviqQu5G2HbsolegZvdGiV93/TGtR1QWP1uyQPCFkijeDkwwAFcubPtJAyTdFsKGw1NcEc9kxYcnuffOHCzv5O4ETBJ7MB9NFXB+DD25m/63xuYfEdEtVqd1wSQ9RKdJSU0V8RTTQ1WUg4QJ6a6XcL8NRJpDVyY8rRE6nDncZnaAY3HA0cWHhdZXyWOKBU87l8+ot7zb+ZB4m7jhGJiNcNQVonjpM02zg== 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=4K2sCJcS+/8V6P/8rMR7Xt4b+48xLuBWsR0HcXfJwpU=; b=bAtSPiHP6G+uWimd5qJ+IUCpQRNMDaeyvURqiKk8kxpZL7B79u6sdq8q0CZKndwFEcaxPk9kkISnqg9mc5ymq4pz2WEyseWhNoJdQClseYHF3Eah8+Rzz+WTJmlsdeZdFdG9alYkcoaeTaUPWRgZptdxz7uepb5/0PL3UvqIfvNPoca/Hz/b/4o68M3Ljw7KL9jB8s4z+Id/bPP2G4KJFCmClZsxJizII0BmjjIM01MiHxRbOBX0hQ7+VEhdLPIG/FQYhk+UdGaxAo4aNtJRxrjSJetCNOa24EYrtL41frPHXEo67OtBTrSRHfXc1qfIWOPHvTMvTg1OgUSMPfFk8A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 194.138.21.73) 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=4K2sCJcS+/8V6P/8rMR7Xt4b+48xLuBWsR0HcXfJwpU=; b=oOZsR6Vs4s3fnSgKXPoNZpLfirt1ffvwjzOOhnToZ5Q3YLusQZL11dR8pjmUZIT3C3qgNoYEHJZiPGPQQnvTNSmAlY+jKyklJCywm2jpMOCHortwPKTpm3DNdt07vSclZJOYFYjtH2viU7v212+tfJI2GZtjzOg7+4JsTBZZThQkK5XpwjH3FULprZbVz0msvLcYF5xU1fV8Z00tuH0tZowgmzATFKnkz9aoM5eczFratzzs293xj+e0r5TLBeyRssHwSjNObTc1JbchvnsY22ZU9pLKxOPMGpXPDYNHgZML9MwVN30Eq2qbsMxCYZ0IffdD0obUQ+Yk/9FClu2N1Q== Received: from SV0P279CA0036.NORP279.PROD.OUTLOOK.COM (2603:10a6:f10:12::23) by VI1PR10MB2206.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:803:81::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.17; Wed, 2 Feb 2022 08:52:31 +0000 Received: from HE1EUR01FT004.eop-EUR01.prod.protection.outlook.com (2603:10a6:f10:12:cafe::b6) by SV0P279CA0036.outlook.office365.com (2603:10a6:f10:12::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.12 via Frontend Transport; Wed, 2 Feb 2022 08:52:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 194.138.21.73) 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.73 as permitted sender) receiver=protection.outlook.com; client-ip=194.138.21.73; helo=hybrid.siemens.com; Received: from hybrid.siemens.com (194.138.21.73) by HE1EUR01FT004.mail.protection.outlook.com (10.152.1.233) 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 08:52:30 +0000 Received: from DEMCHDC8A0A.ad011.siemens.net (139.25.226.106) by DEMCHDC9SNA.ad011.siemens.net (194.138.21.73) 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 09:52:30 +0100 Received: from [139.25.68.37] (139.25.68.37) 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 09:52:30 +0100 Message-ID: Date: Wed, 2 Feb 2022 09:52:29 +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: "Moessbauer, Felix (T CED SES-DE)" , Uladzimir Bely , "isar-users@googlegroups.com" References: <20220201170038.5723-1-ubely@ilbers.de> <20220201170038.5723-8-ubely@ilbers.de> <0e396fe1-889c-8c38-de5d-91274222b955@siemens.com> <3317197.LZWGnKmheA@home> <9f8b4874-62b5-546f-5dc9-8d9c0bd5b1cf@siemens.com> From: Jan Kiszka In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-Path: jan.kiszka@siemens.com X-Originating-IP: [139.25.68.37] X-ClientProxiedBy: DEMCHDC89XA.ad011.siemens.net (139.25.226.103) To DEMCHDC8A0A.ad011.siemens.net (139.25.226.106) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f91ab3ba-b551-426a-e2db-08d9e62958ea X-MS-TrafficTypeDiagnostic: VI1PR10MB2206:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kwymVdTI5u8tuJB3hRgBKeltH4gFtI9nAzwI8Dx9pqU8EgVV1VJ4D3wobhu6rSH7DUkdFYFfsupxoYNvUJ3WqqRTpVQurwCzbGWuoiQa/2XmQCbSLcfxmZN8B3KDhEiDWsopesVz0TPM9p2lfMnjPdvUhocSHlrFY7uWhIQiS3idKLWGoIOPuM5FyUM3OSuL0E9Pb+f8l3AoS2h2jVd+G0Og1nHrMrLPfqNpzasKTGG9PflyT3metcH4B5Blc1mlyCzgTLLqdVHe3E1E+H+hJGgvOx6ev83JO+TCDkb8MImK/Ge9rZvRHMaGOvkxHomP4ZEHBhkafbJkvbp2zlV+ZY4zHvktsGjuPmKc/KQTzxCjsRBc6/YZZ3inwgt/rJ1Y41cdTsPBeYDMmfuLeNMknozcr8k1LUHbVRropaMp9ibofP3Ta+Z5vVxCi+s/cG6cyp7K/YBsftwwzSEwnvi/eWCOfnjpAhRbaPel19V45OkTtGTj7xxgiieGzAjM5BCDzbgLxspzGU6N3tVI4qWy7hBi6EuRn+bLmEUrV1QFti5PS69hScGyfMVaXFQJTimQ02oUuYWzORl956w0g7YFyndIDp2hqMvKnu46sF8sx7iKyFVmIKCh37f4wjXazMLvMQvX2JOyMXTvNdRr8jbfhCeDUbGgsiLr97ZwXiWk+LgjdLKBLH/d/QCFgA99GTe5W1KXBuGlDMskPVYgYNQ1XQpotHZfX2OAVYJ5eI00Z14OPAJ7bSGKVUJjIW6UI3KBLva3bMiHyAGazSBx+tgA3w== X-Forefront-Antispam-Report: CIP:194.138.21.73;CTRY:DE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:hybrid.siemens.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230001)(4636009)(36840700001)(40470700004)(46966006)(186003)(53546011)(5660300002)(2616005)(16526019)(26005)(44832011)(2906002)(956004)(82310400004)(47076005)(83380400001)(336012)(40460700003)(110136005)(86362001)(6706004)(81166007)(356005)(16576012)(70586007)(70206006)(82960400001)(8676002)(8936002)(36756003)(36860700001)(498600001)(31696002)(31686004)(3940600001)(36900700001)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2022 08:52:30.8690 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f91ab3ba-b551-426a-e2db-08d9e62958ea 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.73];Helo=[hybrid.siemens.com] X-MS-Exchange-CrossTenant-AuthSource: HE1EUR01FT004.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR10MB2206 X-TUID: /sveloHo/aoQ On 02.02.22 09:46, Moessbauer, Felix (T CED SES-DE) wrote: > >> -----Original Message----- >> From: isar-users@googlegroups.com On >> Behalf Of Jan Kiszka >> Sent: Wednesday, February 2, 2022 7:57 AM >> To: Uladzimir Bely ; isar-users@googlegroups.com >> Subject: Re: [PATCH v5 07/12] sbuild: support of shell exports from >> dpkg_runbuild_prepend >> >> 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. > > Using environment variables to control the build in Debian/rules is generally discouraged (except for DEB_BUILD_PROFILES and DEB_BUILD_OPTIONS). > But even for these variables, semantics are documented [1] and we / an ISAR user should strictly follow them when packaging. > > There are also reasons why you want to build a package in a clean environment (e.g. to avoid accidentally setting CC or CXX to icc or clang). > Hence, I highly vote for not forwarding the environment into the sbuild build environment. > ...without a warning about a grace period during that we will still do that to allow downstream migration. Then we have a plan, I would say. Jan -- Siemens AG, Technology Competence Center Embedded Linux