From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3147C02194 for ; Wed, 5 Feb 2025 12:12:17 +0000 (UTC) Received: from PA4PR04CU001.outbound.protection.outlook.com (PA4PR04CU001.outbound.protection.outlook.com [40.107.162.98]) by mx.groups.io with SMTP id smtpd.web10.10498.1738757530626694652 for ; Wed, 05 Feb 2025 04:12:12 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@weidmueller.com header.s=selector2 header.b=yMAtaQW7; spf=pass (domain: weidmueller.com, ip: 40.107.162.98, mailfrom: stefan.herbrechtsmeier-oss@weidmueller.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hvxo+E5aWwgqnvSI+6dy58ByeyQFc00k3WHhDtvaUyqnCql2Fv/hZfIy5ATXbtQqEeFciEEfs+PGC/iKR2+WwLojVvggr+BvzE7h0AxfVmUbeGuYDbweRsvGoH8rZI96eZPALu1nv7hsD7HBW3qSXuYbmG0Eiaf9Ah9eSbsAHUMS+HhhuCCchh7YNhkjtsuWq7lNV31IpEVwkYREskL6pvUK7NilPpXySqM8wwpl6hgPNiuTYDP669WO9dwt1ZA2wWTrt3aITduVrGUb/yecnyIqdrdl/V4Axk00Nxjt3x3h0qb0XdhLr9Yn5KFUmRV+pO1uwZnq2mwDw1q0/gjFSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=jCOpYwyDV0Tgw8iJ40hEj/97nDHgT/SgaJbCXdt5f3o=; b=w+iAhscI/rYkaLzkdv/RY/HLDlT3hlO9KDOG7W/ItnGVK2RjHGjTJqabiuZGDTkead+ddvtv2j3f7iQ601H046rSPt8iwzuTqkAkff4QIReDnieiLfghk1O/5MasaNuSp9pww+utNf0s74PY3HnK3/VoBmQt7d+7LS8JhLe1Bb17UNAuJJrhSKB1U07AtnFyn2I8q47TojYgldCsfFq0nTPr5CosbROw5QNIOUc1nU+lB4I6aE1eRkZoXS053Y3KDYhuhR/eLdL81YkHd00/6i5wazlFYCDIU42ZjIZtcG1z00qRBWLdQn/G0tpFvuWzPE47ZnA7+PML0UmEBsPuaQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=weidmueller.com; dmarc=pass action=none header.from=weidmueller.com; dkim=pass header.d=weidmueller.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=weidmueller.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jCOpYwyDV0Tgw8iJ40hEj/97nDHgT/SgaJbCXdt5f3o=; b=yMAtaQW7ivCYsba/HZWY1q+SU97eY2iC2qR6d4SFMNoZibZlB8svUgap86yrxWifar7rVi0V+g9HHOYJDbU3GcL7ULO1t3XK4gDEJSdlWiuEsGc8xe/HJ0cWMUay8AApNkxHTIM0iOcLGPZsuS/L4CZqNOpJBGG/f01klVG6qf/Tt+3owH00ADMV8cHRRLoY09IEEZo5eQ6kDFXn8vf1vf9mqeViVh5urshDWkcqKanRQFkex0zKzngfexaOra/Khbymuaz+XXoZ2yvRbnpRdU1bsB/4t5z4gj2lJ53n0LvGCFq3g/3BKOl7IdSgA5cCUGk6EmIW7N4cO615xTTLBA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=weidmueller.com; Received: from GV1PR08MB8426.eurprd08.prod.outlook.com (2603:10a6:150:8a::17) by GV2PR08MB8122.eurprd08.prod.outlook.com (2603:10a6:150:a8::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8422.11; Wed, 5 Feb 2025 12:12:05 +0000 Received: from GV1PR08MB8426.eurprd08.prod.outlook.com ([fe80::f9f5:b4bd:9e01:9013]) by GV1PR08MB8426.eurprd08.prod.outlook.com ([fe80::f9f5:b4bd:9e01:9013%7]) with mapi id 15.20.8422.011; Wed, 5 Feb 2025 12:12:05 +0000 Content-Type: multipart/alternative; boundary="------------iQQgwNC5pBObZ0aSYaJI4A8x" Message-ID: <027ed1ac-02ae-420b-a65f-d4e48bc86136@weidmueller.com> Date: Wed, 5 Feb 2025 13:12:03 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [bitbake-devel] [RFC PATCH 00/15] Make mirror replacement syntax explicit To: Richard Purdie , bitbake-devel@lists.openembedded.org Cc: Stefan Herbrechtsmeier References: <20250205071538.2681-1-stefan.herbrechtsmeier-oss@weidmueller.com> Content-Language: en-US From: Stefan Herbrechtsmeier In-Reply-To: X-ClientProxiedBy: FR0P281CA0052.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:48::20) To GV1PR08MB8426.eurprd08.prod.outlook.com (2603:10a6:150:8a::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1PR08MB8426:EE_|GV2PR08MB8122:EE_ X-MS-Office365-Filtering-Correlation-Id: 1b864b5d-efeb-4f95-e93d-08dd45de4de9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014|13003099007|8096899003; X-Microsoft-Antispam-Message-Info: =?utf-8?B?R283bFF2QWVOQlBNaDZzYlZsK05CWGZGUWdXTWdhOW9mRDRVcVNjTm1ZUUg2?= =?utf-8?B?WVUxakJVMm1pUGdXanJJVDVmU0ZiUnpvamExR3diQVRqNnJmbEZIMEJtV3JQ?= =?utf-8?B?Nk5UMytxRi9yOWR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MMGJ3M2tIRGc4SFlsL2ZYeHJSM3ZYRi8rdVRLNzFlSHpKNFFE?= =?utf-8?B?cjBwUTNUVXowQktXelBNRmErcGlJQmVFN1hzZG10d0hjSU5COCtGNUo5d2FB?= =?utf-8?B?ekQ5bHBuOTFldFlBOTdza2ZoRFkyVFVWTmNEb3dBMVpTWW1IWkxiamJ1L3dr?= =?utf-8?B?cFVvd3NkSmZkWmgyRmdXaXlFZk5XMlVHWFowRENRQnZkeHhpY0QwditEWTVP?= =?utf-8?B?VEk4QVpDKzJaVm9oM1BPMjd1eEV0c0M1MnFoUEhrM3N1c3ArY2FPTTYwVi96?= =?utf-8?B?S2dFMDk2V25DVXRHeS9vK3F6aDlYVVcrVEd1dDc5dzlNRmh6ZUZTa3poK2ND?= =?utf-8?B?MWdnSlZvOUxZc3RIUW5KanpnZDNLZ0R2YzFLb2xpQmV5ZklQQmNVUUJ2SXpF?= =?utf-8?B?d3lCZWxmR0hSQkVyK2MzY2Z2T2EzNGxEYlNuR25ra3F6aGFjMEcxWDN0c2E2?= =?utf-8?B?Z0E9PQ==?= X-OriginatorOrg: weidmueller.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1b864b5d-efeb-4f95-e93d-08dd45de4de9 X-MS-Exchange-CrossTenant-AuthSource: GV1PR08MB8426.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Feb 2025 12:12:05.0495 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e4289438-1c5f-4c95-a51a-ee553b8b18ec X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Fvm/ROsQS/m1kgFTWOSc6SY5h3ddBw5+z5x7MUECk+dWFtWYkf6eG7ADJxNX2BQOJT3yN0Bkvb5UA2iGRwg6qQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB8122 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 05 Feb 2025 12:12:17 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/17151 --------------iQQgwNC5pBObZ0aSYaJI4A8x Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Am 05.02.2025 um 11:34 schrieb Richard Purdie: > On Wed, 2025-02-05 at 08:15 +0100, Stefan Herbrechtsmeier via lists.openembedded.org wrote: >> The mirror replacement syntax contains many implicit transformations. >> The path of the URI always contains the base name of the downloaded >> filename. This makes it impossible to rename or remove the base name of >> the original path. It prevents upstream mirror for SRC_URIS with a >> downloadfilename parameter. The base name of the downloaded filename >> makes it impossible to use the download mirror for SRC_URIs with >> subfolders in the downloadfilename parameter. Altogether the implicit >> transformation complicates the understanding of the replacements. >> >> This series adds an additional replacement named DOWNLOADFILENAME. This >> replacement contains the relative filename of the downloaded file or >> mirror archive for git and hg. This allows the user to explicitly define >> the behavior. The usage is equivalent to the PATH replacement for the >> sstate mirror from file to https scheme. >> >> git://.*/.*http://downloads.yoctoproject.org/mirror/sources/DOWNLOADFILENAME >> https?://.*/.*http://downloads.yoctoproject.org/mirror/sources/DOWNLOADFILENAME >> file://.* https://sstate.yoctoproject.org/all/PATH;downloadfilename=PATH >> >> Without a replacement variable the mirror will use the same base name as >> the origin SRC_URI. This allows the usage of private package manager >> registry together with a downloadfilename parameter or the rename of the >> base name. >> >> https://registry.npmjs.org/ https://example.com/npm/registry/ >> https://example.com/example/1.0.0.tgz https://example.com/example/example-1.0.0.tgz >> >> The series adds heuristics to keep a backward compatibility to common >> styles. Because of the ambiguity of the old style, it is advisable to >> remove this compatibility sooner or later to avoid unexpected behavior. > Thanks for the patches, these look interesting with some good > improvements in there. A lot of the series looks like cleanups and > those look like good fixes to have. It may make sense to split this > series into two, the cleanups/fixes and the behaviour changes. > > I'm not entirely "sold" on the naming of DOWNLOADFILENAME. You have to > think about this from the perspective of someone writing a MIRROR or > PREMIRROR entry - would they understand what that means vs some of the > other names? I’m open for suggestions. Even ARCHIVE or TARBALL are hard to understand because it is only a relative path on the download mirror. Alternative we can mark the lines as upstream or download mirror and give the replacement different meanings. The path could be the original PATH for an upstream mirror or the relative path of the downloaded file for the download mirror. > I'm also a bit nervous about breaking compatibility with the older > syntaxes. It is unclear to me how or when we'd detect/deprecate older > formats. I do agree we probably do need to remove some support for some > syntax and move to something new though as what we have is turning into > some kind of nightmare. FWIW this is really old code that in many ways > predates my involvement so probably 20+ years old. The only possibility is to mark the new format because it is impossible to know if a replacement want to keep the base name of the path. As example the following replacement is used in the test: file:///some1where/.* file://some2where/ The plain regular expressions replaces the complete path with a new path but the old code appends only the base name of the path. What was the desired behavior? file:///some1where/ file://some2where/ file:///some1where/.* file://some2where/BASENAME_OF_DOWNLOADFILENAME The main problem is that we have to keep the bugs if we keep the old behavior. > I'll continue to give this some thought. If you could confirm which > patches are "cleanup" that would help though, we can see if we can get > those in a bit faster. The first 8 patches are cleanups. --------------iQQgwNC5pBObZ0aSYaJI4A8x Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
Am 05.02.2025 um 11:34 schrieb Richard Purdie:
On Wed, 2025-02-05 at 08:15 +0100, Stefan Herbrechtsmeier via lists.openembedded.org wrote:
The mirror replacement syntax contains many implicit transformations.
The path of the URI always contains the base name of the downloaded
filename. This makes it impossible to rename or remove the base name of
the original path. It prevents upstream mirror for SRC_URIS with a
downloadfilename parameter. The base name of the downloaded filename
makes it impossible to use the download mirror for SRC_URIs with
subfolders in the downloadfilename parameter. Altogether the implicit
transformation complicates the understanding of the replacements.

This series adds an additional replacement named DOWNLOADFILENAME. This
replacement contains the relative filename of the downloaded file or
mirror archive for git and hg. This allows the user to explicitly define
the behavior. The usage is equivalent to the PATH replacement for the
sstate mirror from file to https scheme.

git://.*/.*  http://downloads.yoctoproject.org/mirror/sources/DOWNLOADFILENAME
https?://.*/.*  http://downloads.yoctoproject.org/mirror/sources/DOWNLOADFILENAME
file://.*  https://sstate.yoctoproject.org/all/PATH;downloadfilename=PATH

Without a replacement variable the mirror will use the same base name as
the origin SRC_URI. This allows the usage of private package manager
registry together with a downloadfilename parameter or the rename of the
base name.

https://registry.npmjs.org/  https://example.com/npm/registry/
https://example.com/example/1.0.0.tgz  https://example.com/example/example-1.0.0.tgz

The series adds heuristics to keep a backward compatibility to common
styles. Because of the ambiguity of the old style, it is advisable to
remove this compatibility sooner or later to avoid unexpected behavior.
Thanks for the patches, these look interesting with some good
improvements in there. A lot of the series looks like cleanups and
those look like good fixes to have. It may make sense to split this
series into two, the cleanups/fixes and the behaviour changes.

I'm not entirely "sold" on the naming of DOWNLOADFILENAME. You have to
think about this from the perspective of someone writing a MIRROR or
PREMIRROR entry - would they understand what that means vs some of the
other names?

I’m open for suggestions. Even ARCHIVE or TARBALL are hard to understand because it is only a relative path on the download mirror. Alternative we can mark the lines as upstream or download mirror and give the replacement different meanings. The path could be the original PATH for an upstream mirror or the relative path of the downloaded file for the download mirror.

I'm also a bit nervous about breaking compatibility with the older
syntaxes. It is unclear to me how or when  we'd detect/deprecate older
formats. I do agree we probably do need to remove some support for some
syntax and move to something new though as what we have is turning into
some kind of nightmare. FWIW this is really old code that in many ways
predates my involvement so probably 20+ years old.

The only possibility is to mark the new format because it is impossible to know if a replacement want to keep the base name of the path.

As example the following replacement is used in the test:

file:///some1where/.* file://some2where/

The plain regular expressions replaces the complete path with a new path but the old code appends only the base name of the path. What was the desired behavior?

file:///some1where/ file://some2where/
file:///some1where/.* file://some2where/BASENAME_OF_DOWNLOADFILENAME

The main problem is that we have to keep the bugs if we keep the old behavior.

I'll continue to give this some thought. If you could confirm which
patches are "cleanup" that would help though, we can see if we can get
those in a bit faster.

The first 8 patches are cleanups.

--------------iQQgwNC5pBObZ0aSYaJI4A8x--