From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail1.windriver.com (mail1.windriver.com [147.11.146.13]) by mail.openembedded.org (Postfix) with ESMTP id 5A2B060E7C for ; Mon, 23 Dec 2013 02:10:11 +0000 (UTC) Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail1.windriver.com (8.14.5/8.14.5) with ESMTP id rBN2ABci011974 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL) for ; Sun, 22 Dec 2013 18:10:11 -0800 (PST) Received: from [128.224.162.153] (128.224.162.153) by ALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server (TLS) id 14.2.347.0; Sun, 22 Dec 2013 18:10:11 -0800 Message-ID: <52B79B80.4040007@windriver.com> Date: Mon, 23 Dec 2013 10:10:08 +0800 From: Ming Liu User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130330 Thunderbird/17.0.5 MIME-Version: 1.0 To: References: <1384426288-3534-1-git-send-email-ming.liu@windriver.com> In-Reply-To: <1384426288-3534-1-git-send-email-ming.liu@windriver.com> X-Originating-IP: [128.224.162.153] Subject: Re: [PATCH] sstate: Add optimizing logic for crosssdk setscene dependencies X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Dec 2013 02:10:11 -0000 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Hi, guys: Would anybody take a tech review to my patch? Thanks! the best, thank you On 11/14/2013 06:51 PM, Ming Liu wrote: > This patch mainly aims to add optimisation for crosssdk setscene dependency > validating which we haven't handled in current logic, and which I think we > could have as we've already implemented to native/cross, although there > are albeit not many crossdk tasks, we could still get some performance > enhancement. > > And it also fix a vulnerability of some certain workflow, think about the > following scenario with current logic: > bitbake nativesdk-eglibc-initial -c cleansstate > bitbake gcc-crosssdk-initial -c clean > bitbake gmp-native -c clean > bitbake libmpc-native -c clean > bitbake mpfr-native -c clean > bitbake gcc-crosssdk-initial > bitbake nativesdk-eglibc-initial > > Aboving will fail for absence of a few native libraries required by > gcc-crosssdk-initial. > > Also modified some places in current code except the optimisation, as > following: > 1 Remove isNative function since no code is referring it. > 2 Add do_package to the list that don't exist and are noexec. > > Signed-off-by: Ming Liu > --- > meta/classes/sstate.bbclass | 24 +++++++++++------------- > 1 file changed, 11 insertions(+), 13 deletions(-) > > diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass > index 517c100..49f92f9 100644 > --- a/meta/classes/sstate.bbclass > +++ b/meta/classes/sstate.bbclass > @@ -666,12 +666,10 @@ def setscene_depvalid(task, taskdependees, notneeded, d): > > bb.debug(2, "Considering setscene task: %s" % (str(taskdependees[task]))) > > - def isNative(x): > - return x.endswith("-native") > - def isNativeCross(x): > - return x.endswith("-native") or x.endswith("-cross") or x.endswith("-cross-initial") > + def isNativeCrossCrosssdk(x): > + return x.endswith("-native") or x.endswith("-cross") or x.endswith("-cross-initial") or x.endswith("-crosssdk") or x.endswith("-crosssdk-initial") > def isSafeDep(x): > - if x in ["quilt-native", "autoconf-native", "automake-native", "gnu-config-native", "libtool-native", "pkgconfig-native", "gcc-cross", "binutils-cross", "gcc-cross-initial"]: > + if x in ["quilt-native", "autoconf-native", "automake-native", "gnu-config-native", "libtool-native", "pkgconfig-native", "gcc-cross", "binutils-cross", "gcc-cross-initial", "gcc-crosssdk", "binutils-crosssdk", "gcc-crosssdk-initial"]: > return True > return False > def isPostInstDep(x): > @@ -701,8 +699,8 @@ def setscene_depvalid(task, taskdependees, notneeded, d): > if isPostInstDep(taskdependees[task][0]) and taskdependees[dep][1] in ['do_package_write_deb', 'do_package_write_ipk', 'do_package_write_rpm']: > return False > continue > - # Native/Cross packages don't exist and are noexec anyway > - if isNativeCross(taskdependees[dep][0]) and taskdependees[dep][1] in ['do_package_write_deb', 'do_package_write_ipk', 'do_package_write_rpm', 'do_packagedata']: > + # Native/Cross/Crosssdk packages don't exist and are noexec anyway > + if isNativeCrossCrosssdk(taskdependees[dep][0]) and taskdependees[dep][1] in ['do_package_write_deb', 'do_package_write_ipk', 'do_package_write_rpm', 'do_packagedata', 'do_package']: > continue > > # Consider sysroot depending on sysroot tasks > @@ -713,14 +711,14 @@ def setscene_depvalid(task, taskdependees, notneeded, d): > # Nothing need depend on libc-initial/gcc-cross-initial > if taskdependees[task][0].endswith("-initial"): > continue > - # Native/Cross populate_sysroot need their dependencies > - if isNativeCross(taskdependees[task][0]) and isNativeCross(taskdependees[dep][0]): > + # Native/Cross/Crosssdk populate_sysroot need their dependencies > + if isNativeCrossCrosssdk(taskdependees[task][0]) and isNativeCrossCrosssdk(taskdependees[dep][0]): > return False > - # Target populate_sysroot depended on by cross tools need to be installed > - if isNativeCross(taskdependees[dep][0]): > + # Target/Nativesdk populate_sysroot depended on by cross/crosssdk tools need to be installed > + if isNativeCrossCrosssdk(taskdependees[dep][0]): > return False > - # Native/cross tools depended upon by target sysroot are not needed > - if isNativeCross(taskdependees[task][0]): > + # Native,Cross/Crosssdk tools depended upon by target/nativesdk sysroot are not needed > + if isNativeCrossCrosssdk(taskdependees[task][0]): > continue > # Target populate_sysroot need their dependencies > return False