From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6449247988281769984 X-Received: by 10.36.34.12 with SMTP id o12mr2851782ito.30.1501665870493; Wed, 02 Aug 2017 02:24:30 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 10.36.147.195 with SMTP id y186ls2774281itd.14.gmail; Wed, 02 Aug 2017 02:24:30 -0700 (PDT) X-Received: by 10.107.16.11 with SMTP id y11mr16647593ioi.89.1501665870232; Wed, 02 Aug 2017 02:24:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501665870; cv=none; d=google.com; s=arc-20160816; b=ug2P6R8CIfsH7NR2MDTyscksj/MOFxmkfLwr9i4bw4J/k1vCR/5ezqwsUJAKnAxgoh DMS2wppS0sSdkB9J7O3h5mWgXo6LOtKGqvI+xj/l6pMA+Bsu0rVwga/pAAotMX0kcTsa z9LbaJ6FWoVrCcRIP9ndZ9CTf+XstfnmhZD2iXBIA/z9xNd2+16m0JWIGSrWxHSUiB2i esboKIlSGyohfC3+j50cXPjVjvF0JTpZdTagInpWZhUYZV9mz0lxXosk0b+og8KCrcsB qK33IkvXw6jmS/MNmMdkkZLYjpnjoSL8/4/dGz8uOFqDBsXZH7MSdP+T5dGv5C2DMmZB zosQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:dkim-signature:arc-authentication-results; bh=zl/JthQlYUXkdDhX02geVF5V3tz9t75YB+Z8Z4AkFa8=; b=HEbmSuDtkqMtPAY6agCss6qaq5B18C1qOcMxemgLL6hDcI5PJEtbfbkVbPWofN/P23 yxlzSmjYdGycXB86L3GOg2Bc1HehzmkIv9ravbdXj+kOsy8Vj/NCyNKwqS8CnOU0zzxU MGqes3CQascgclHpcAecCB/l6vEi0/PC8grAcSHk4Lwx9whyhN5soH4XMh56+6eN76cz F2k5uYBz4vMD3tlZoaXuUZSDDYUTUzQGORs+bV5E9i8N43ScZhSFi2RlOde5FIgWT/Rc QJJRF2PqrGiUc39vc/loWN8YvK0YvNheMLhsg0IhtJbZNdvjIIucABcbcmxY7IEKg092 wH/A== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.b=EEH3CBWe; spf=pass (google.com: domain of alex.bluesman.smirnov@gmail.com designates 2607:f8b0:400d:c0d::243 as permitted sender) smtp.mailfrom=alex.bluesman.smirnov@gmail.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from mail-qt0-x243.google.com (mail-qt0-x243.google.com. [2607:f8b0:400d:c0d::243]) by gmr-mx.google.com with ESMTPS id v195si1302053ywg.3.2017.08.02.02.24.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Aug 2017 02:24:30 -0700 (PDT) Received-SPF: pass (google.com: domain of alex.bluesman.smirnov@gmail.com designates 2607:f8b0:400d:c0d::243 as permitted sender) client-ip=2607:f8b0:400d:c0d::243; Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.b=EEH3CBWe; spf=pass (google.com: domain of alex.bluesman.smirnov@gmail.com designates 2607:f8b0:400d:c0d::243 as permitted sender) smtp.mailfrom=alex.bluesman.smirnov@gmail.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: by mail-qt0-x243.google.com with SMTP id u19so4029442qtc.0 for ; Wed, 02 Aug 2017 02:24:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=zl/JthQlYUXkdDhX02geVF5V3tz9t75YB+Z8Z4AkFa8=; b=EEH3CBWeV0k8/ZHXmESRPAjSopa+iOgyNhBLicU0NOQNcJJ6yOxGlxt3wnm/eQj5qS fwXARCUaJIttWQC+Tbx+dgJ9qWjT0/t+mbF+UvP3ZO4nhmH83iZU5vOodDsR0Dbfa87c SacqGdLcFoExDk2IaRgtxowA9h0unyI0oNOnEhHoNsnRNVRZNPhvsMl4WMYQ6zC1E31S htiL/sid4YivZCbUb3HWLFKN9yqvvtSMlDvIu4XW4DSsUSDKPy5U0sJD2z3IBEmwQOZJ E8pxAVKkkxRywJg36oS/806WULKtSqYwWte3B/Rt0/0vCixduDEQwRn7SZt0AoMTU4MS nxxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=zl/JthQlYUXkdDhX02geVF5V3tz9t75YB+Z8Z4AkFa8=; b=lzsn86Z3aQGd/2peVtV/PSKg/PPoZ6T+bDJFfUznhol00rYJrexSinkCpPCYuCJ12w 2Dew+R72Wxodzu3s/gE42as++29uxCNWnGSZ5fwxWIN0/Agimx2UEvwXjXfNcgofqcE2 Vg5NySg90dsO6ZAZ8bkYuKpRny1Rs1rxvoJEgGijxH2sKxFJmh/q/4XmgWQFr2qdKcw5 O3YGwtt7+9pzWJKIHpL87iApriZsb7aNuNdW/VdVEN3plYpBZxwI2UbAIwylppYPK7Ib zC8El7nVMO/YpUczZDDiGZybZvFJS6q5YPLrp/0zJGkcYvHIlVw9QOXFoKMbfCM64fyP UmZw== X-Gm-Message-State: AIVw112HR0Y+vvonIWH2xViJQAnCreFd5ClbF8PXuJUmOiht2z1BDPOA I3R0liJc0t/Jx9BlAdLdSjdxYwVaJeJS X-Received: by 10.200.45.240 with SMTP id q45mr32548772qta.332.1501665869917; Wed, 02 Aug 2017 02:24:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.148.188 with HTTP; Wed, 2 Aug 2017 02:24:29 -0700 (PDT) In-Reply-To: <048e88d5072fc038c8bd6207334e9967d5a29e0c.1501582237.git.henning.schild@siemens.com> References: <048e88d5072fc038c8bd6207334e9967d5a29e0c.1501582237.git.henning.schild@siemens.com> From: Alexander Smirnov Date: Wed, 2 Aug 2017 12:24:29 +0300 Message-ID: Subject: Re: [PATCH 07/16] classes: use WORKDIR and get rid of BUILDROOT To: Henning Schild Cc: isar-users@googlegroups.com Content-Type: multipart/alternative; boundary="001a113a81f0bf72c50555c1d4c3" X-TUID: YGkCTQEy4QfO --001a113a81f0bf72c50555c1d4c3 Content-Type: text/plain; charset="UTF-8" 2017-08-01 13:17 GMT+03:00 Henning Schild : > Signed-off-by: Henning Schild > --- > meta/classes/dpkg.bbclass | 15 ++++++--------- > 1 file changed, 6 insertions(+), 9 deletions(-) > > diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass > index 3d7aafb..1d0132b 100644 > --- a/meta/classes/dpkg.bbclass > +++ b/meta/classes/dpkg.bbclass > @@ -10,9 +10,7 @@ do_unpack[deptask] = "do_build" > # Each package should have its own unique build folder, so use > # recipe name as identifier > PP = "/home/builder/${PN}" > -BUILDROOT = "${BUILDCHROOT_DIR}/${PP}" > - > -do_fetch[dirs] = "${DL_DIR}" > +WORKDIR = "${BUILDCHROOT_DIR}/${PP}" > WORKDIR is no the only folder to fetch sources to. This folder represents workspace for all operation with folder, for example $WORKDIR/temp contails log files. Initially Isar designed to follow OE/Yocto style where it's possible. Traditionally tmp/work folder contains all the packages workspaces with: build atifacts, patches, bitbake logs etc... So in general it looks like (roughly speaking): tmp/work/toolchain/package/* This conception ideally works with cross-compilation, when you can compile packages out of the rootfs tree. Isar implements native compilation, so we can't build package within current workspace. So the decision was to keep workspace as it is but relocate build folder to buildchroot. The main benefit of this approach, that there is a single package workspace for bitbake metadata, while there may be many buildchroots (different Debian distros and machines/architectures). In my opinion this change is another step away from OE/Yocto style. @Henning: could you please describe the motivation of this change? @All: any opinions are highly appreciated. > > # Fetch package from the source link > python do_fetch() { > @@ -28,10 +26,10 @@ python do_fetch() { > } > > addtask fetch before do_build > +do_fetch[dirs] = "${DL_DIR}" > > -do_unpack[dirs] = "${BUILDROOT}" > do_unpack[stamp-extra-info] = "${DISTRO}" > -S ?= "${BUILDROOT}" > +S ?= "${WORKDIR}" > S folder is used for unpacking sources. WORKDIR - is whole package workspace. S should not equal to WORKDIR, otherwise this will lead to mess between package sources and bitbake metadata. For example Also artifacts from FILESDIR are usually installed to the root of WORKDIR. > > # Unpack package and put it into working directory in buildchroot > python do_unpack() { > @@ -39,16 +37,15 @@ python do_unpack() { > if len(src_uri) == 0: > return > > - rootdir = d.getVar('BUILDROOT', True) > - > try: > fetcher = bb.fetch2.Fetch(src_uri, d) > - fetcher.unpack(rootdir) > + fetcher.unpack(d.getVar('WORKDIR', True)) > except bb.fetch2.BBFetchException as e: > raise bb.build.FuncFailed(e) > } > > addtask unpack after do_fetch before do_build > +do_unpack[dirs] = "${WORKDIR}" > > do_build[stamp-extra-info] = "${DISTRO}" > > @@ -62,7 +59,7 @@ do_install[stamp-extra-info] = "${MACHINE}" > # Install package to dedicated deploy directory > do_install() { > install -d ${DEPLOY_DIR_DEB} > - install -m 755 ${BUILDROOT}/*.deb ${DEPLOY_DIR_DEB}/ > + install -m 755 ${WORKDIR}/*.deb ${DEPLOY_DIR_DEB}/ > } > > addtask do_install after do_build > -- > 2.13.0 > > -- > You received this message because you are subscribed to the Google Groups > "isar-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to isar-users+unsubscribe@googlegroups.com. > To post to this group, send email to isar-users@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/isar-users/048e88d5072fc038c8bd6207334e9967d5a29e0c.1501582237.git. > henning.schild%40siemens.com. > For more options, visit https://groups.google.com/d/optout. > --001a113a81f0bf72c50555c1d4c3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
2017= -08-01 13:17 GMT+03:00 Henning Schild <henning.schild@siemens.com= >:
Signe= d-off-by: Henning Schild <= henning.schild@siemens.com>
---
=C2=A0meta/classes/dpkg.bbclass | 15 ++++++---------
=C2=A01 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index 3d7aafb..1d0132b 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -10,9 +10,7 @@ do_unpack[deptask] =3D "do_build"
=C2=A0# Each package should have its own unique build folder, so use
=C2=A0# recipe name as identifier
=C2=A0PP =3D "/home/builder/${PN}"
-BUILDROOT =3D "${BUILDCHROOT_DIR}/${PP}"
-
-do_fetch[dirs] =3D "${DL_DIR}"
+WORKDIR =3D "${BUILDCHROOT_DIR}/${PP}"

=
WORKDIR is no the only folder to fetch sources to. This folder r= epresents workspace for all operation with folder, for example $WORKDIR/tem= p contails log files.

Initially Isar designed= to follow OE/Yocto style where it's possible. Traditionally tmp/work f= older contains all the packages workspaces with: build atifacts, patches, b= itbake logs etc... So in general it looks like (roughly speaking):

=C2=A0 tmp/work/toolchain/package/*

This conception ideally works with cross-compilation, when you can compi= le packages out of the rootfs tree. Isar implements native compilation, so = we can't build package within current workspace. So the decision was to= keep workspace as it is but relocate build folder to buildchroot. The main= benefit of this approach, that there is a single package workspace for bit= bake metadata, while there may be many buildchroots (different Debian distr= os and machines/architectures).

In my opinio= n this change is another step away from OE/Yocto style.

@Henning: could you please describe the motivation of this change?
@All: any opinions are highly appreciated.
=C2=A0

=C2=A0# Fetch package from the source link
=C2=A0python do_fetch() {
@@ -28,10 +26,10 @@ python do_fetch() {
=C2=A0}

=C2=A0addtask fetch before do_build
+do_fetch[dirs] =3D "${DL_DIR}"

-do_unpack[dirs] =3D "${BUILDROOT}"
=C2=A0do_unpack[stamp-extra-info] =3D "${DISTRO}"
-S ?=3D "${BUILDROOT}"
+S ?=3D "${WORKDIR}"

S folder= is used for unpacking sources. WORKDIR - is whole package workspace. S sho= uld not equal to WORKDIR, otherwise this will lead to mess between package = sources and bitbake metadata. For example Also artifacts from FILESDIR are = usually installed to the root of WORKDIR.

=C2=A0

=C2=A0# Unpack package and put it into working directory in buildchroot
=C2=A0python do_unpack() {
@@ -39,16 +37,15 @@ python do_unpack() {
=C2=A0 =C2=A0 =C2=A0if len(src_uri) =3D=3D 0:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return

-=C2=A0 =C2=A0 rootdir =3D d.getVar('BUILDROOT', True)
-
=C2=A0 =C2=A0 =C2=A0try:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0fetcher =3D bb.fetch2.Fetch(src_uri, d) -=C2=A0 =C2=A0 =C2=A0 =C2=A0 fetcher.unpack(rootdir)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 fetcher.unpack(d.getVar('WORKDIR'= , True))
=C2=A0 =C2=A0 =C2=A0except bb.fetch2.BBFetchException as e:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0raise bb.build.FuncFailed(e)
=C2=A0}

=C2=A0addtask unpack after do_fetch before do_build
+do_unpack[dirs] =3D "${WORKDIR}"

=C2=A0do_build[stamp-extra-info] =3D "${DISTRO}"

@@ -62,7 +59,7 @@ do_install[stamp-extra-info] =3D "${MACHINE}" =C2=A0# Install package to dedicated deploy directory
=C2=A0do_install() {
=C2=A0 =C2=A0 =C2=A0install -d ${DEPLOY_DIR_DEB}
-=C2=A0 =C2=A0 install -m 755 ${BUILDROOT}/*.deb ${DEPLOY_DIR_DEB}/
+=C2=A0 =C2=A0 install -m 755 ${WORKDIR}/*.deb ${DEPLOY_DIR_DEB}/
=C2=A0}

=C2=A0addtask do_install after do_build
--
2.13.0

--
You received this message because you are subscribed to the Google Groups &= quot;isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to isar-u= sers+unsubscribe@googlegroups.com.
To post to this group, send email to isar-users@googlegroups.com.
To view this discussion on the web visit https= ://groups.google.com/d/msgid/isar-users/048e88d5072fc038c8bd62073= 34e9967d5a29e0c.1501582237.git.henning.schild%40siemens.com.<= br> For more options, visit https://groups.google.com/d/optout.

--001a113a81f0bf72c50555c1d4c3--