From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6854631734520053760 X-Received: by 2002:a5d:6311:: with SMTP id i17mr20529572wru.195.1612801087321; Mon, 08 Feb 2021 08:18:07 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a1c:4482:: with SMTP id r124ls7595426wma.1.canary-gmail; Mon, 08 Feb 2021 08:18:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJx+3WZYBftUwPEC1M00ZFGkxYV/38HZYg3k5Lu8GMQJW/BFwzHo2RYx29b7ZuDiimYWdh4n X-Received: by 2002:a1c:39d5:: with SMTP id g204mr14865185wma.127.1612801086098; Mon, 08 Feb 2021 08:18:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612801086; cv=none; d=google.com; s=arc-20160816; b=A5gIo8U3Q0CtuQoifvkexdhighC17Q0wCZb9t97iLcphQnAFVJafufd1Pexd9hteGC diWkFpri6Zq8waDw/wvzdE76FcHFPo+zW11bS5TV8VeXjzhvLJ5v0wTI1S2iUdbUwuxJ h7pMZ9+BbNBLeKMmUgI/YaRvmDWQG5sd341BWyaUADZGSSY5LszAS7fuwx95hD/kHltN PI0HiOm7Gs4BJScYDVOYZ1NMYXLkBMDcLXzP3yFEhPSEGFjzCvE20Kcvlm7Ywo4HooVA 0QZ7bhLuP6eGx1rmEt5a1ZrGDhP31TZSly2ZP35mPNvYdxlN+u3Oxo+9JITQ3XgTWroO RgkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date; bh=5R/VIRsfcmf0B/cx8tAbPNY37JNToqKSBBRucGYrl1o=; b=vG+D9F1fDt7GDcNFeJZ0HKs6HbFLau7uOfkS79Dy12aTQiaAh3+lxo+Zp2RHgAXxBo uN5Cv+w4yGXESHDlheaTO5pSSpJgqDuhQoGEjqLf0pRspXrA26vi7NJacdv8agTp4g8x CNVfV6Hjxul0LydQ7bFi4g/iQwgA8Na73FQDMEX7xK5q/Ho+hcND90NPfzsonb/jeKrs 2+WgSrpMwC0XBfh+isvPTj6+VgGSClj7qZQ09Uh6irFWGf7hnBJO7fevV4bA3WXWQ/xP Hhnd/TjjYVJrKCbT+L+VcUKb2ReB59HNJs/KvZhQKuJt+WE8JGkttXYWC3N6MQgRfdxd SebA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id z206si784276wmc.0.2021.02.08.08.18.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Feb 2021 08:18:05 -0800 (PST) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.2 as permitted sender) client-ip=192.35.17.2; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id 118GI4ib030846 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 8 Feb 2021 17:18:04 +0100 Received: from md1za8fc.ad001.siemens.net ([167.87.42.244]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 118GI4dY025929; Mon, 8 Feb 2021 17:18:04 +0100 Date: Mon, 8 Feb 2021 17:18:03 +0100 From: Henning Schild To: Anton Mikanovich Cc: Jan Kiszka , , "Schmidt, Adriaan (CT RDA IOT SES-DE)" Subject: Re: [PATCH 1/2] patch: special-case quilt in debian Message-ID: <20210208171803.79e09832@md1za8fc.ad001.siemens.net> In-Reply-To: <08fdb9c9-2f17-5c93-d46c-e059b2731167@ilbers.de> References: <20200728203153.792-1-henning.schild@siemens.com> <20200729170843.3131dabf@md1za8fc.ad001.siemens.net> <8b30269f-fef1-f351-4e36-bb514666b3e8@siemens.com> <20200729214842.16a15ae2@md1za8fc.ad001.siemens.net> <08fdb9c9-2f17-5c93-d46c-e059b2731167@ilbers.de> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: ZNS77cXjArX/ Am Mon, 8 Feb 2021 18:50:00 +0300 schrieb Anton Mikanovich : > Hello, that is the status of patch rebuild? This one stays open. The other one - the git one - is ready to go. Henning > > 29.07.2020 22:48, Henning Schild wrote: > > On Wed, 29 Jul 2020 17:31:34 +0200 > > Jan Kiszka wrote: > > > >> On 29.07.20 17:08, Henning Schild wrote: > >>> Hi, > >>> > >>> working on that and getting some feedback from Adriaan the whole > >>> issue is harder so solve than i initially thought. > >>> > >>> Having Isar and Debian use quilt is hard if not impossible to get > >>> right. Here i propose to detect Debian-quilt usage and hook into > >>> it. While that is a nice idea and actually does work, it has one > >>> major problem. We will not be able to patch "debian/" with it, > >>> which some patches might want to do. > >>> > >>> Now why cant we use two quilts (in some cases): > >>> 1. in addition to the "patches" dir quilt creates a dir with its > >>> state, and it finds that directory on more levels than it finds > >>> "patches". That actually means that the first call to quilt will > >>> potentially break the other caller, because it will find the wrong > >>> state dir and work on the wrong patches. We do not even know which > >>> instance comes first, if we fetch with "apt://" debian comes > >>> first, otherwise isar comes first. 2. isar never should come > >>> first because patching before debian applies its patches means > >>> potentially breaking the debian-series, isar needs to patch last > >>> ... maybe unless it patches "debian/" ... > >>> > >>> So i suggest to stick to what i propose with that patch and add a > >>> special patching method just for "debian/" and just for the > >>> "debian-uses-quilt" case. The user would have to mark the patches > >>> somehow, maybe with a naming convention or a SRC_URI paramter. Now > >>> we need a special patch method to apply those outside of the > >>> debian-quilt universe. > >>> SRC_URI+="foo.patch;apply-with-isar=1" What do you think? > >> If we are to add a special flag, I would say "debian-patch". > >> Semantic would be "inject into the debian package patch queue (and, > >> implicitly, "apply=no" for Isar). > > I am not sure about the user interface, when patching the source we > > should magically hook into debians quilt by default, because we > > need to be after debian. That breaks legacy recipes that patch > > "debian/" ... > > > > And "debian-patch" could also be misunderstood as patching > > "debian/". Let me come up with an implementation and discuss those > > details later. > >>> The two quilts getting into each others ways can potentially also > >>> be avoided if we prepare a QUILTRC for the Isar side. In that > >>> case we can maybe still use two quilts and give users an option > >>> to hook individual patches into debian instead of isar. Because > >>> isar should not actually patch before debian does it ... In fact > >>> if debian uses quilt any change that debian did not apply itself > >>> will trigger build errors, only patches to "debian/" will be ok. > >> Indeed. We likely need to split patches into those that target the > >> source and those that address debian/. The former should be hooked > >> into debian/, the latter could be applied the classic way. > > I am afraid the "classic way" wont work, unless we manage to > > convince quilt to work on S/patches and do not fall for > > S/debian/patches in case of "apt://". I think it is not only > > "apt://" but might also affect partial rebuilds where somehow > > debians quilt already ran before isars quilt enters the stage. Let > > us see. > > > > Henning > > > >> Jan > >> > >>> Henning > >>> > >>> On Tue, 28 Jul 2020 22:31:52 +0200 > >>> Henning Schild wrote: > >>> > >>>> From: Henning Schild > >>>> > >>>> The OE patch lib uses quilt and so do many debian packages as > >>>> well. Those two do not work well together, it is really hard to > >>>> create a patch that will apply and not break what debian does > >>>> later. debian is very pedantic about unexpected changes so even > >>>> if patching works, building might not. > >>>> > >>>> Introduce a special-case where we detect quilt usage of a debian > >>>> package and hook in there. Also make sure we are on top of debian > >>>> so we do not risk breaking patches we inherit from there. > >>>> > >>>> If anyone ever managed to create a patch that works well in the > >>>> face of two quilts, that might break with this change. You can > >>>> set PATCHTOOL to "quilt" in your recipe to disable the magic. > >>>> > >>>> Signed-off-by: Henning Schild > >>>> --- > >>>> meta/classes/patch.bbclass | 28 ++++++++++++++++++++++++++++ > >>>> 1 file changed, 28 insertions(+) > >>>> > >>>> diff --git a/meta/classes/patch.bbclass > >>>> b/meta/classes/patch.bbclass index 3060755a5c..06f32a2197 100644 > >>>> --- a/meta/classes/patch.bbclass > >>>> +++ b/meta/classes/patch.bbclass > >>>> @@ -91,6 +91,28 @@ def should_apply(parm, d): > >>>> > >>>> should_apply[vardepsexclude] = "DATE SRCDATE" > >>>> > >>>> +def patch_do_debian_quilt(patchdir, d): > >>>> + import oe.patch > >>>> + class DummyPatchSet(oe.patch.PatchSet): > >>>> + def Clean(self): > >>>> + True > >>>> + > >>>> + def Import(self, patch, force): > >>>> + os.putenv('QUILT_PATCHES', 'debian/patches') > >>>> + # push all so we are on top of debian > >>>> + pushed = False > >>>> + if os.path.exists(os.path.join(self.dir, > >>>> 'debian/patches/series')): > >>>> + oe.patch.runcmd(["quilt", "push", "-a"], > >>>> self.dir) > >>>> + pushed = True > >>>> + oe.patch.runcmd(["quilt", "import", "-f", > >>>> os.path.join(d.getVar('WORKDIR'), > >>>> os.path.basename(patch['file']))], self.dir) > >>>> + if pushed: > >>>> + oe.patch.runcmd(["quilt", "pop", "-a"], > >>>> self.dir) + > >>>> + def Push(self, force = False): > >>>> + True > >>>> + > >>>> + return DummyPatchSet(patchdir, d) > >>>> + > >>>> python patch_do_patch() { > >>>> import sys > >>>> > >>>> @@ -118,6 +140,12 @@ python patch_do_patch() { > >>>> > >>>> s = d.getVar('S') > >>>> > >>>> + debianformat = os.path.join(s, 'debian/source/format') > >>>> + if os.path.exists(debianformat) and d.getVar('PATCHTOOL') != > >>>> 'quilt': > >>>> + with open(debianformat, 'r+') as f: > >>>> + if f.readline() == '3.0 (quilt)\n': > >>>> + cls = patch_do_debian_quilt > >>>> + > >>>> os.putenv('PATH', d.getVar('PATH')) > >>>> > >>>> # We must use one TMPDIR per process so that the "patch" > >>>> processes > >>> >