From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6520143438976909312 X-Received: by 10.80.242.130 with SMTP id f2mr1146983edm.5.1518207519015; Fri, 09 Feb 2018 12:18:39 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 10.80.169.98 with SMTP id m31ls3919463edc.0.gmail; Fri, 09 Feb 2018 12:18:38 -0800 (PST) X-Google-Smtp-Source: AH8x226PxqXWAzhxMUg1fb0b2Q58aqnqgs3nBDQ2SLjm56EJrb1yHbvpAK67sEu5JRp0ydjOY26n X-Received: by 10.80.242.130 with SMTP id f2mr1146973edm.5.1518207518341; Fri, 09 Feb 2018 12:18:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518207518; cv=none; d=google.com; s=arc-20160816; b=JJr7qQFRIYVmdEsP9v2QU6+rKXGSbOz7+EdhLzp7V323rOeiJVSpHtfzfStb5nXgDN jqf8bQWxXR3uihgUu4bQi+OidY6U7BWwR3mExyobuEKFM7Zo5mooGfz5O5VK8s7rIvXV uDkRq0sgB1baTgU7GgKrJFYC0BoFU/ZWDMaQ2QGCyN8wTNuxu3dWzED5zViqJG/RuMd0 4d7NtAy9EpC8n1QvuEryNgGKDZvrCqNPI86bpkIfsNFP8cpIe7RJc1D4+1bgQHN5Z45Q a7s1yL/Xto2EzAzOhb+C3COS4bLxDJbYrzC71BJrfR40Va17/a0D6PBkPh3iStssznOF 5HKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:subject:user-agent :references:in-reply-to:message-id:date:cc:to:from :arc-authentication-results; bh=Kg/9ekXljVpXOhkqEromstyt5XyARsK4gcTHYbMxabk=; b=pWJxLuGosl4IHzRu5SO2yYa/s2SP/2QiFfSnguOCHyLt/HGjGqAfijaL2EY6qfCrXX HZurI6Qg5270BCdx9/vXkYN4Z+A0zWoObr7scf7u/7MjsMv9uIA/FSEUGOtTEhoLN5B1 HiuUweQ+cosBpZ6RXRvjcAh6EMZTwQQXKaBEXtgEH33lJoQDiWO1BDmfgL8SAGhVEnf5 SJyHaupd0dlZCLMD4+oErgWwFUv2a6ZzuOrCJFGMUaeMaiXBFZBQxn4mH6N9c6NCoRt0 o+nfFv41f4CkaNoSvApkmBzMjCSxuSJAlthT/7sTM8OTznvd+PqPzvpmmcCsJ8+ARVS+ 7uQw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=asmirnov@ilbers.de Return-Path: Received: from aqmola.ilbers.de (aqmola.ilbers.de. [85.214.62.211]) by gmr-mx.google.com with ESMTPS id z17si217506edz.1.2018.02.09.12.18.38 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Feb 2018 12:18:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) client-ip=85.214.62.211; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=asmirnov@ilbers.de Received: from [192.168.1.235] ([188.227.110.165]) (authenticated bits=0) by aqmola.ilbers.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP id w19KIXMC017580; Fri, 9 Feb 2018 21:18:34 +0100 From: Alexander Smirnov To: Henning Schild CC: , Claudius Heine Date: Fri, 09 Feb 2018 23:18:46 +0300 Message-ID: <1617c386470.27ac.034a6b0541ed39b7fb4e17f4ac219eaa@ilbers.de> In-Reply-To: <20180209203339.5752c103@mmd1pvb1c.ad001.siemens.net> References: <20180209172850.28852-1-asmirnov@ilbers.de> <20180209191610.161916ad@mmd1pvb1c.ad001.siemens.net> <1617bdffba0.27ac.034a6b0541ed39b7fb4e17f4ac219eaa@ilbers.de> <20180209203339.5752c103@mmd1pvb1c.ad001.siemens.net> User-Agent: AquaMail/1.10.0-403 (build: 101000001) Subject: Re: [PATCH v2] meta/classes/base: Fix showdata and liststasks after bitbake update MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="UTF-8" Content-Transfer-Encoding: 8bit X-TUID: IIxfkIxDqALU Henning Schild 9 февраля 2018 г. 22:33:48 написал: > Am Fri, 9 Feb 2018 21:42:12 +0300 > schrieb Alexander Smirnov : > >> Henning Schild 9 февраля 2018 г. >> 21:16:17 написал: >> >> > Mhh this one rings a bell ;) >> > >> > https://groups.google.com/d/msg/isar-users/Raq3ayrqtnc/oqTt6_sSBQAJ >> > >> > Someone has to reread that and check whether my symlink approach was >> > rejected rightfully, or whether it was just one of the many >> > misunderstandings we had in the past. >> >> This approach was rejected due to several reasons: >> >> - According to the bitbake documentation, you need to create your >> own base.bbclass. I consider this as a signal - do not reply on >> default one. >> >> https://www.yoctoproject.org/docs/1.6/bitbake-user-manual/bitbake-user-manual.html#hello-world-example >> >> - Default base.bbclass provides inevitable default settings that >> should be overwritten in custom class. Moreover this class should be >> included to *all* the Isar recipes manually. Inherit something to >> overwrite it immediately still doesn't look reasonable for me. >> >> In addition: >> >> - do_listtasks in this patch seems to be taken from oe-core, not >> from bitbake, so inheritance doesn't help here. > > Ok, thanks for summing it up again. It might be a good idea to write a > developer doc on how to upgrade bitbake (and wic) and what to test when > doing so. Otherwise we risk introducing the same problems over and over > again. > But that could also be a testcase. > Definitely agree. This was the first bitbake update and it brought several unexpected issues, that still appears. I think it's a good time to summarize this experience and make the document/test. Also I'd like to consider git modules for bitbake, like Jan proposed. So I could do this. Apart from above I see here several other topics: - How introduce 3rd party software. At the moment we have bitbake and wic. The last one is derived from OE, so do we need to mention this explicitly? - I assume that this patch is not the last one, which brings pieces of code from other projects. How this code should be marked? In the top in the file's header? Inline in the file? - Jan already proposed to define unified Isar header with copyrights. For example our base.class has no Isar copyright at all. Regarding bitbake updates, seems Yocto and OE handle this manually, the have their own set of classes which updated according to the current bitbake version. Alex > Henning > >> Alex >> >> > >> > Henning >> > >> > Am Fri, 9 Feb 2018 20:28:50 +0300 >> > schrieb Alexander Smirnov : >> > >> >> From: Claudius Heine >> >> >> >> 8<-- >> >> >> >> Just added references to origin code in comment. Didn't touch the >> >> code. >> >> >> >> 8<-- >> >> >> >> Those tasks were broken, this patchs fixes by implementing them >> >> similar to how openembedded-core does it. >> >> >> >> Signed-off-by: Claudius Heine >> >> --- >> >> meta/classes/base.bbclass | 30 +++++++++++++++++++----------- >> >> 1 file changed, 19 insertions(+), 11 deletions(-) >> >> >> >> diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass >> >> index 7d44f72..ae84677 100644 >> >> --- a/meta/classes/base.bbclass >> >> +++ b/meta/classes/base.bbclass >> >> @@ -37,25 +37,33 @@ bbfatal() { >> >> exit 1 >> >> } >> >> >> >> +# Derived from bitbake: bitbake/classes/base.bbclass >> >> addtask showdata >> >> do_showdata[nostamp] = "1" >> >> python do_showdata() { >> >> - import sys >> >> - # emit variables and shell functions >> >> - bb.data.emit_env(sys.__stdout__, d, True) >> >> - # emit the metadata which isnt valid shell >> >> - for e in bb.data.keys(d): >> >> - if bb.data.getVarFlag(e, 'python', d): >> >> - sys.__stdout__.write("\npython %s () >> >> {\n%s}\n" % (e, bb.data.getVar(e, d, 1))) >> >> + for e in d.keys(): >> >> + if d.getVarFlag(e, 'python'): >> >> + bb.plain("\npython %s () {\n%s}\n" % (e, d.getVar(e, >> >> True))) } >> >> >> >> +# Derived from Open Embedded: >> >> openembedded-core/meta/classes/utility-tasks.bbclass addtask >> >> listtasks do_listtasks[nostamp] = "1" >> >> python do_listtasks() { >> >> - import sys >> >> - for e in bb.data.keys(d): >> >> - if bb.data.getVarFlag(e, 'task', d): >> >> - sys.__stdout__.write("%s\n" % e) >> >> + taskdescs = {} >> >> + maxlen = 0 >> >> + for e in d.keys(): >> >> + if d.getVarFlag(e, 'task'): >> >> + maxlen = max(maxlen, len(e)) >> >> + if e.endswith('_setscene'): >> >> + desc = "%s (setscene version)" % >> >> (d.getVarFlag(e[:-9], 'doc') or '') >> >> + else: >> >> + desc = d.getVarFlag(e, 'doc') or '' >> >> + taskdescs[e] = desc >> >> + >> >> + tasks = sorted(taskdescs.keys()) >> >> + for taskname in tasks: >> >> + bb.plain("%s %s" % (taskname.ljust(maxlen), >> >> taskdescs[taskname])) } >> >> >> >> do_fetch[dirs] = "${DL_DIR}" >> > >> -- >> With best regards, >> Alexander Smirnov >> >> ilbers GmbH >> Baierbrunner Str. 28c >> D-81379 Munich >> +49 (89) 122 67 24-0 >> http://ilbers.de/ >> Commercial register Munich, HRB 214197 >> General manager: Baurzhan Ismagulov >> >> > -- With best regards, Alexander Smirnov ilbers GmbH Baierbrunner Str. 28c D-81379 Munich +49 (89) 122 67 24-0 http://ilbers.de/ Commercial register Munich, HRB 214197 General manager: Baurzhan Ismagulov