Re: [OE-core] [PATCH 1/2] staging: Add extra hash handling code

2022-02-03 Thread Matt Madison
On Thu, Feb 3, 2022 at 3:25 AM Richard Purdie
 wrote:
>
> Target build output, stored in do_populate_sysroot or do_package can depend
> not only upon direct dependencies but also indirect ones. A good example is
> linux-libc-headers. The toolchain depends on this but most target recipes do
> not. There are some headers which are not used by the toolchain build and do
> not change the toolchain task output, hence the task hashes can change without
> changing the sysroot output of that recipe yet they can influence others.
>
> A specific example is rtc.h which can change rtcwake.c in util-linux but is 
> not
> used in the glibc or gcc build. To account for this, we need to account for 
> the
> populate_sysroot hashes in the task output hashes.
>
> Signed-off-by: Richard Purdie 
> ---
>  meta/classes/sstate.bbclass  |  2 +-
>  meta/classes/staging.bbclass | 35 ++-
>  2 files changed, 35 insertions(+), 2 deletions(-)
>
> diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
> index 17dcf4cc175..fd9acbab9b4 100644
> --- a/meta/classes/sstate.bbclass
> +++ b/meta/classes/sstate.bbclass
> @@ -94,7 +94,7 @@ SSTATE_ARCHS[vardepsexclude] = "ORIGNATIVELSBSTRING"
>
>  SSTATE_MANMACH ?= "${SSTATE_PKGARCH}"
>
> -SSTATECREATEFUNCS = "sstate_hardcode_path"
> +SSTATECREATEFUNCS += "sstate_hardcode_path"
>  SSTATECREATEFUNCS[vardeps] = "SSTATE_SCAN_FILES"
>  SSTATEPOSTCREATEFUNCS = ""
>  SSTATEPREINSTFUNCS = ""
> diff --git a/meta/classes/staging.bbclass b/meta/classes/staging.bbclass
> index 25f77c77350..3ea9c974eb5 100644
> --- a/meta/classes/staging.bbclass
> +++ b/meta/classes/staging.bbclass
> @@ -21,7 +21,7 @@ SYSROOT_DIRS_NATIVE = " \
>  "
>  SYSROOT_DIRS:append:class-native = " ${SYSROOT_DIRS_NATIVE}"
>  SYSROOT_DIRS:append:class-cross = " ${SYSROOT_DIRS_NATIVE}"
> -SYSROOT_DIRS:append:class-crosssdk = " ${SYSROOT_DIRS_NATIVE}"
> +SYSROOT_DIRS:app:class-crosssdk = " ${SYSROOT_DIRS_NATIVE}"

Did you intend to drop the "end" from "append" here?

-M

>
>  # These directories will not be staged in the sysroot
>  SYSROOT_DIRS_BLACKLIST = " \
> @@ -624,3 +624,36 @@ python staging_taskhandler() {
>  }
>  staging_taskhandler[eventmask] = "bb.event.RecipeTaskPreProcess"
>  addhandler staging_taskhandler
> +
> +
> +#
> +# Target build output, stored in do_populate_sysroot or do_package can depend
> +# not only upon direct dependencies but also indirect ones. A good example is
> +# linux-libc-headers. The toolchain depends on this but most target recipes 
> do
> +# not. There are some headers which are not used by the toolchain build and 
> do
> +# not change the toolchain task output, hence the task hashes can change 
> without
> +# changing the sysroot output of that recipe yet they can influence others.
> +#
> +# A specific example is rtc.h which can change rtcwake.c in util-linux but 
> is not
> +# used in the glibc or gcc build. To account for this, we need to account 
> for the
> +# populate_sysroot hashes in the task output hashes.
> +#
> +python target_add_sysroot_deps () {
> +current_task = "do_" + d.getVar("BB_CURRENTTASK")
> +if current_task not in ["do_populate_sysroot", "do_package"]:
> +return
> +
> +pn = d.getVar("PN")
> +if pn.endswith("-native"):
> +return
> +
> +taskdepdata = d.getVar("BB_TASKDEPDATA", False)
> +deps = {}
> +for dep in taskdepdata.values():
> +if dep[1] == "do_populate_sysroot" and not 
> dep[0].endswith(("-native", "-initial")) and "-cross-" not in dep[0]:
> +deps[dep[0]] = dep[6]
> +
> +d.setVar("HASHEQUIV_EXTRA_SIGDATA", "\n".join("%s: %s" % (k, deps[k]) 
> for k in sorted(deps.keys(
> +}
> +SSTATECREATEFUNCS += "target_add_sysroot_deps"
> +
> --
> 2.32.0
>
>
> 
>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#161274): 
https://lists.openembedded.org/g/openembedded-core/message/161274
Mute This Topic: https://lists.openembedded.org/mt/0595/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core][PATCH 0/4] Move crate fetcher to OE_IMPORTS

2022-01-14 Thread Matt Madison
On Tue, Dec 21, 2021 at 10:15 AM Matt Madison via
lists.openembedded.org 
wrote:
>
> On Tue, Dec 21, 2021 at 6:07 AM Paul Barker  wrote:
> >
> > On 20/12/2021 22:34, Richard Purdie wrote:
> > > On Mon, 2021-12-20 at 17:01 +, Paul Barker wrote:
> > >> On 17/12/2021 15:36, Matt Madison wrote:
> > >>> This patch series switches to using the OE_IMPORTS mechanism
> > >>> for installing the crate fetcher. This simplifies the addition
> > >>> and clears up issues with interactions between SRCPV and
> > >>> the shared-state fetching logic.
> > >>>
> > >>> Matt Madison (4):
> > >>> lib/crate.py: install crate fetcher on import
> > >>> base.bbclass: add crate to OE_IMPORTS
> > >>> cargo_common.bbclass: remove inherit of crate-fetch
> > >>> classes: remove crate-fetch.bbclass
> > >>>
> > >>>meta/classes/base.bbclass |  2 +-
> > >>>meta/classes/cargo_common.bbclass |  2 --
> > >>>meta/classes/crate-fetch.bbclass  | 28 
> > >>>meta/lib/crate.py |  2 ++
> > >>>4 files changed, 3 insertions(+), 31 deletions(-)
> > >>>delete mode 100644 meta/classes/crate-fetch.bbclass
> > >>>
> > >>
> > >> Would a better solution here be to move the crate fetcher into
> > >> lib/bb/fetch2/ in bitbake?
> > >
> > > I've been wondering about this too.
> > >
> > > Does anyone remember how the fetcher lines up against the general fetcher
> > > requirements we have and is there a list of anything that remained to be 
> > > done
> > > before it could be added to bitbake?
> >
> > If I remember correctly, it just needed some test cases writing. The
> > crate fetcher is a subclass of the wget fetcher with changes to how
> > urldata is set up and how unpack is handled, so it should integrate well
> > into bitbake.
>
> One thing I see that's a bit worrisome is that it disables
> recommends_checksum for the downloaded files,
> and populates metadata for use (I assume) by cargo with the calculated
> SHA256 on the download.

Any other thoughts on this?  I've modified my distro to work around
the problem that led me to propose these patches, but something needs
to be fixed here. crate-fetch.bbclass should not be setting SRCPV.

Thanks,
-Matt

>
> -Matt
>
> >
> > Thanks,
> >
> > --
> > Paul Barker
> > Principal Software Engineer
> > SanCloud Ltd
> >
> > e: paul.bar...@sancloud.com
> > w: https://sancloud.co.uk/
>
> 
>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#160562): 
https://lists.openembedded.org/g/openembedded-core/message/160562
Mute This Topic: https://lists.openembedded.org/mt/87791267/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core][PATCH] qemu.bbclass: drop OLDEST_KERNEL reference

2022-01-09 Thread Matt Madison
On Sun, Jan 9, 2022 at 5:52 AM Peter Kjellerstedt
 wrote:
>
> > -Original Message-
> > From: Matt Madison 
> > Sent: den 9 januari 2022 13:04
> > To: Peter Kjellerstedt 
> > Cc: Konrad Weihmann ; Richard Purdie
> > ; Patches and discussions about the
> > oe-core layer 
> > Subject: Re: [OE-core][PATCH] qemu.bbclass: drop OLDEST_KERNEL reference
> >
> > On Sun, Jan 9, 2022 at 3:32 AM Peter Kjellerstedt
> >  wrote:
> > >
> > > > -Original Message-
> > > > From: openembedded-core@lists.openembedded.org  > > > c...@lists.openembedded.org> On Behalf Of Konrad Weihmann
> > > > Sent: den 9 januari 2022 10:24
> > > > To: Richard Purdie 
> > > > Cc: Patches and discussions about the oe-core layer  > > > c...@lists.openembedded.org>
> > > > Subject: Re: [OE-core][PATCH] qemu.bbclass: drop OLDEST_KERNEL
> > reference
> > > >
> > > > On 08.01.22 16:13, Richard Purdie wrote:
> > > > > On Sat, 2022-01-08 at 07:10 -0800, Matt Madison wrote:
> > > > >> On Sat, Jan 8, 2022 at 6:34 AM Richard Purdie
> > > > >>  wrote:
> > > > >>>
> > > > >>> On Fri, 2022-01-07 at 06:44 -0800, Matt Madison wrote:
> > > > >>>> On Fri, Jan 7, 2022 at 4:56 AM Richard Purdie
> > > > >>>>  wrote:
> > > > >>>>>
> > > > >>>>> On Fri, 2022-01-07 at 12:51 +, Richard Purdie via
> > > > lists.openembedded.org
> > > > >>>>> wrote:
> > > > >>>>>> On Fri, 2022-01-07 at 04:36 -0800, Matt Madison wrote:
> > > > >>>>>>> On Fri, Jan 7, 2022 at 3:19 AM Richard Purdie
> > > > >>>>>>>  wrote:
> > > > >>>>>>>>
> > > > >>>>>>>> On Wed, 2021-12-15 at 12:16 -0800, Matt Madison wrote:
> > > > >>>>>>>>> which is introducing task hash changes for some
> > > > >>>>>>>>> allarch package builds, and should no longer
> > > > >>>>>>>>> be needed with recent versions of qemu.
> > > > >>>>>>>>>
> > > > >>>>>>>>> Signed-off-by: Matt Madison 
> > > > >>>>>>>>> ---
> > > > >>>>>>>>>   meta/classes/qemu.bbclass | 2 +-
> > > > >>>>>>>>>   1 file changed, 1 insertion(+), 1 deletion(-)
> > > > >>>>>>>>>
> > > > >>>>>>>>> diff --git a/meta/classes/qemu.bbclass
> > > > b/meta/classes/qemu.bbclass
> > > > >>>>>>>>> index 01a7b86ae1..333202b7c4 100644
> > > > >>>>>>>>> --- a/meta/classes/qemu.bbclass
> > > > >>>>>>>>> +++ b/meta/classes/qemu.bbclass
> > > > >>>>>>>>> @@ -54,7 +54,7 @@ def qemu_run_binary(data, rootfs_path,
> > > > binary):
> > > > >>>>>>>>>   # this dance). For others (e.g. arm) a -cpu option is not
> > > > necessary, since the
> > > > >>>>>>>>>   # qemu-arm default CPU supports all required architecture
> > > > levels.
> > > > >>>>>>>>>
> > > > >>>>>>>>> -QEMU_OPTIONS = "-r ${OLDEST_KERNEL}
> > > > ${@d.getVar("QEMU_EXTRAOPTIONS_%s" % d.getVar('PACKAGE_ARCH')) or ""}"
> > > > >>>>>>>>> +QEMU_OPTIONS = "${@d.getVar("QEMU_EXTRAOPTIONS_%s" %
> > > > d.getVar('PACKAGE_ARCH')) or ""}"
> > > > >>>>>>>>>   QEMU_OPTIONS[vardeps] +=
> > "QEMU_EXTRAOPTIONS_${PACKAGE_ARCH}"
> > > > >>>>>>>>>
> > > > >>>>>>>>>   QEMU_EXTRAOPTIONS_ppce500v2 = " -cpu e500v2"
> > > > >>>>>>>>
> > > > >>>>>>>> I've sent a revert for this since the commit message isn't
> > true,
> > > > this is causing
> > > > >>>>>>>> autobuilder failures and there was also a user report of
> > issues
> > > > with it.
> > > > >>>

Re: [OE-core][PATCH] qemu.bbclass: drop OLDEST_KERNEL reference

2022-01-09 Thread Matt Madison
On Sun, Jan 9, 2022 at 3:32 AM Peter Kjellerstedt
 wrote:
>
> > -Original Message-
> > From: openembedded-core@lists.openembedded.org  > c...@lists.openembedded.org> On Behalf Of Konrad Weihmann
> > Sent: den 9 januari 2022 10:24
> > To: Richard Purdie 
> > Cc: Patches and discussions about the oe-core layer  > c...@lists.openembedded.org>
> > Subject: Re: [OE-core][PATCH] qemu.bbclass: drop OLDEST_KERNEL reference
> >
> > On 08.01.22 16:13, Richard Purdie wrote:
> > > On Sat, 2022-01-08 at 07:10 -0800, Matt Madison wrote:
> > >> On Sat, Jan 8, 2022 at 6:34 AM Richard Purdie
> > >>  wrote:
> > >>>
> > >>> On Fri, 2022-01-07 at 06:44 -0800, Matt Madison wrote:
> > >>>> On Fri, Jan 7, 2022 at 4:56 AM Richard Purdie
> > >>>>  wrote:
> > >>>>>
> > >>>>> On Fri, 2022-01-07 at 12:51 +, Richard Purdie via
> > lists.openembedded.org
> > >>>>> wrote:
> > >>>>>> On Fri, 2022-01-07 at 04:36 -0800, Matt Madison wrote:
> > >>>>>>> On Fri, Jan 7, 2022 at 3:19 AM Richard Purdie
> > >>>>>>>  wrote:
> > >>>>>>>>
> > >>>>>>>> On Wed, 2021-12-15 at 12:16 -0800, Matt Madison wrote:
> > >>>>>>>>> which is introducing task hash changes for some
> > >>>>>>>>> allarch package builds, and should no longer
> > >>>>>>>>> be needed with recent versions of qemu.
> > >>>>>>>>>
> > >>>>>>>>> Signed-off-by: Matt Madison 
> > >>>>>>>>> ---
> > >>>>>>>>>   meta/classes/qemu.bbclass | 2 +-
> > >>>>>>>>>   1 file changed, 1 insertion(+), 1 deletion(-)
> > >>>>>>>>>
> > >>>>>>>>> diff --git a/meta/classes/qemu.bbclass
> > b/meta/classes/qemu.bbclass
> > >>>>>>>>> index 01a7b86ae1..333202b7c4 100644
> > >>>>>>>>> --- a/meta/classes/qemu.bbclass
> > >>>>>>>>> +++ b/meta/classes/qemu.bbclass
> > >>>>>>>>> @@ -54,7 +54,7 @@ def qemu_run_binary(data, rootfs_path,
> > binary):
> > >>>>>>>>>   # this dance). For others (e.g. arm) a -cpu option is not
> > necessary, since the
> > >>>>>>>>>   # qemu-arm default CPU supports all required architecture
> > levels.
> > >>>>>>>>>
> > >>>>>>>>> -QEMU_OPTIONS = "-r ${OLDEST_KERNEL}
> > ${@d.getVar("QEMU_EXTRAOPTIONS_%s" % d.getVar('PACKAGE_ARCH')) or ""}"
> > >>>>>>>>> +QEMU_OPTIONS = "${@d.getVar("QEMU_EXTRAOPTIONS_%s" %
> > d.getVar('PACKAGE_ARCH')) or ""}"
> > >>>>>>>>>   QEMU_OPTIONS[vardeps] += "QEMU_EXTRAOPTIONS_${PACKAGE_ARCH}"
> > >>>>>>>>>
> > >>>>>>>>>   QEMU_EXTRAOPTIONS_ppce500v2 = " -cpu e500v2"
> > >>>>>>>>
> > >>>>>>>> I've sent a revert for this since the commit message isn't true,
> > this is causing
> > >>>>>>>> autobuilder failures and there was also a user report of issues
> > with it.
> > >>>>>>>
> > >>>>>>> Bummer.  I think this is because our OLDEST_KERNEL setting for
> > aarch64
> > >>>>>>> (3.14.0) is
> > >>>>>>> higher than the UNAME_MINIMUM_RELEASE definition in QEMU (3.8.0).
> > >>>>>>>
> > >>>>>>>>
> > https://autobuilder.yoctoproject.org/typhoon/#/builders/42/builds/4559/ste
> > ps/13/logs/stdio
> > >>>>>>>> (centos7 aarch64 build)
> > >>>>>>>>
> > >>>>>>>> We'll have to find a different way to fix the allarch issue (more
> > details
> > >>>>>>>> welcome on which package shows the issue).
> > >>>>>>>
> > >>>>>>> I ran into the issue with cantarell-fonts and wayland-protocols,
> > but
> > >>>>>>> any recipe that inherits both allarch and meson should trigger it.
> > >>>>&g

Re: [OE-core][PATCH] qemu.bbclass: drop OLDEST_KERNEL reference

2022-01-08 Thread Matt Madison
On Sat, Jan 8, 2022 at 6:34 AM Richard Purdie
 wrote:
>
> On Fri, 2022-01-07 at 06:44 -0800, Matt Madison wrote:
> > On Fri, Jan 7, 2022 at 4:56 AM Richard Purdie
> >  wrote:
> > >
> > > On Fri, 2022-01-07 at 12:51 +, Richard Purdie via 
> > > lists.openembedded.org
> > > wrote:
> > > > On Fri, 2022-01-07 at 04:36 -0800, Matt Madison wrote:
> > > > > On Fri, Jan 7, 2022 at 3:19 AM Richard Purdie
> > > > >  wrote:
> > > > > >
> > > > > > On Wed, 2021-12-15 at 12:16 -0800, Matt Madison wrote:
> > > > > > > which is introducing task hash changes for some
> > > > > > > allarch package builds, and should no longer
> > > > > > > be needed with recent versions of qemu.
> > > > > > >
> > > > > > > Signed-off-by: Matt Madison 
> > > > > > > ---
> > > > > > >  meta/classes/qemu.bbclass | 2 +-
> > > > > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > > > >
> > > > > > > diff --git a/meta/classes/qemu.bbclass b/meta/classes/qemu.bbclass
> > > > > > > index 01a7b86ae1..333202b7c4 100644
> > > > > > > --- a/meta/classes/qemu.bbclass
> > > > > > > +++ b/meta/classes/qemu.bbclass
> > > > > > > @@ -54,7 +54,7 @@ def qemu_run_binary(data, rootfs_path, binary):
> > > > > > >  # this dance). For others (e.g. arm) a -cpu option is not 
> > > > > > > necessary, since the
> > > > > > >  # qemu-arm default CPU supports all required architecture levels.
> > > > > > >
> > > > > > > -QEMU_OPTIONS = "-r ${OLDEST_KERNEL} 
> > > > > > > ${@d.getVar("QEMU_EXTRAOPTIONS_%s" % d.getVar('PACKAGE_ARCH')) or 
> > > > > > > ""}"
> > > > > > > +QEMU_OPTIONS = "${@d.getVar("QEMU_EXTRAOPTIONS_%s" % 
> > > > > > > d.getVar('PACKAGE_ARCH')) or ""}"
> > > > > > >  QEMU_OPTIONS[vardeps] += "QEMU_EXTRAOPTIONS_${PACKAGE_ARCH}"
> > > > > > >
> > > > > > >  QEMU_EXTRAOPTIONS_ppce500v2 = " -cpu e500v2"
> > > > > >
> > > > > > I've sent a revert for this since the commit message isn't true, 
> > > > > > this is causing
> > > > > > autobuilder failures and there was also a user report of issues 
> > > > > > with it.
> > > > >
> > > > > Bummer.  I think this is because our OLDEST_KERNEL setting for aarch64
> > > > > (3.14.0) is
> > > > > higher than the UNAME_MINIMUM_RELEASE definition in QEMU (3.8.0).
> > > > >
> > > > > > https://autobuilder.yoctoproject.org/typhoon/#/builders/42/builds/4559/steps/13/logs/stdio
> > > > > > (centos7 aarch64 build)
> > > > > >
> > > > > > We'll have to find a different way to fix the allarch issue (more 
> > > > > > details
> > > > > > welcome on which package shows the issue).
> > > > >
> > > > > I ran into the issue with cantarell-fonts and wayland-protocols, but
> > > > > any recipe that inherits both allarch and meson should trigger it.
> > > > >
> > > > > In my case, I have a layer check job for meta-tegra that runs
> > > > > yocto-check-layer with the --machines option specifying qemux86 and
> > > > > one of the (aarch64) machines in my layer, and that was reporting the
> > > > > signature changes between the two architectures.
> > > >
> > > > I wonder why we don't detect that with our standard tests? :/
> > > >
> > > > There may be another fix:
> > > >
> > > > diff --git a/meta/classes/allarch.bbclass b/meta/classes/allarch.bbclass
> > > > index 5bd5c44a276..0aadf7bfba6 100644
> > > > --- a/meta/classes/allarch.bbclass
> > > > +++ b/meta/classes/allarch.bbclass
> > > > @@ -43,6 +43,9 @@ python () {
> > > >  d.setVar("TARGET_LDFLAGS", "none")
> > > >  d.setVar("POPULATESYSROOTDEPS", "")
> > > >
> > > > +if bb.data.inherits_class("meson", d):
> > > > +d.setVar("do_write_config", ":")
> > > > +
> > > >  # Avoid this being unnecessarily different due to nuances of
> > > >  # the target machine that aren't important for "all" arch
> > > >  # packages.
> > > >
> > > >
> > >
> > > Sorry, that isn't quite right. We want to just remove the append to 
> > > write_config
> > > which generates the qemu wrapper which will probably need a little more 
> > > invasive
> > > juggling of the code to make it easier...
> >
> > Your patch to disable the qemu wrapper for allarch looks like a good 
> > solution.
> > Hopefully, that will work OK across the board.
>
> It seemed to be so I've merged it. Am hoping this resolves things!

Drat. Unfortunately, it only works if allarch is inherited after meson
(which inherits qemu).  So cantarell-fonts checks out OK,
but wayland-protocols doesn't, since it inherits allarch first.

-Matt

>
> Cheers,
>
> Richard
>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#160276): 
https://lists.openembedded.org/g/openembedded-core/message/160276
Mute This Topic: https://lists.openembedded.org/mt/87752526/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core][PATCH] qemu.bbclass: drop OLDEST_KERNEL reference

2022-01-07 Thread Matt Madison
On Fri, Jan 7, 2022 at 4:56 AM Richard Purdie
 wrote:
>
> On Fri, 2022-01-07 at 12:51 +, Richard Purdie via lists.openembedded.org
> wrote:
> > On Fri, 2022-01-07 at 04:36 -0800, Matt Madison wrote:
> > > On Fri, Jan 7, 2022 at 3:19 AM Richard Purdie
> > >  wrote:
> > > >
> > > > On Wed, 2021-12-15 at 12:16 -0800, Matt Madison wrote:
> > > > > which is introducing task hash changes for some
> > > > > allarch package builds, and should no longer
> > > > > be needed with recent versions of qemu.
> > > > >
> > > > > Signed-off-by: Matt Madison 
> > > > > ---
> > > > >  meta/classes/qemu.bbclass | 2 +-
> > > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > >
> > > > > diff --git a/meta/classes/qemu.bbclass b/meta/classes/qemu.bbclass
> > > > > index 01a7b86ae1..333202b7c4 100644
> > > > > --- a/meta/classes/qemu.bbclass
> > > > > +++ b/meta/classes/qemu.bbclass
> > > > > @@ -54,7 +54,7 @@ def qemu_run_binary(data, rootfs_path, binary):
> > > > >  # this dance). For others (e.g. arm) a -cpu option is not necessary, 
> > > > > since the
> > > > >  # qemu-arm default CPU supports all required architecture levels.
> > > > >
> > > > > -QEMU_OPTIONS = "-r ${OLDEST_KERNEL} 
> > > > > ${@d.getVar("QEMU_EXTRAOPTIONS_%s" % d.getVar('PACKAGE_ARCH')) or ""}"
> > > > > +QEMU_OPTIONS = "${@d.getVar("QEMU_EXTRAOPTIONS_%s" % 
> > > > > d.getVar('PACKAGE_ARCH')) or ""}"
> > > > >  QEMU_OPTIONS[vardeps] += "QEMU_EXTRAOPTIONS_${PACKAGE_ARCH}"
> > > > >
> > > > >  QEMU_EXTRAOPTIONS_ppce500v2 = " -cpu e500v2"
> > > >
> > > > I've sent a revert for this since the commit message isn't true, this 
> > > > is causing
> > > > autobuilder failures and there was also a user report of issues with it.
> > >
> > > Bummer.  I think this is because our OLDEST_KERNEL setting for aarch64
> > > (3.14.0) is
> > > higher than the UNAME_MINIMUM_RELEASE definition in QEMU (3.8.0).
> > >
> > > > https://autobuilder.yoctoproject.org/typhoon/#/builders/42/builds/4559/steps/13/logs/stdio
> > > > (centos7 aarch64 build)
> > > >
> > > > We'll have to find a different way to fix the allarch issue (more 
> > > > details
> > > > welcome on which package shows the issue).
> > >
> > > I ran into the issue with cantarell-fonts and wayland-protocols, but
> > > any recipe that inherits both allarch and meson should trigger it.
> > >
> > > In my case, I have a layer check job for meta-tegra that runs
> > > yocto-check-layer with the --machines option specifying qemux86 and
> > > one of the (aarch64) machines in my layer, and that was reporting the
> > > signature changes between the two architectures.
> >
> > I wonder why we don't detect that with our standard tests? :/
> >
> > There may be another fix:
> >
> > diff --git a/meta/classes/allarch.bbclass b/meta/classes/allarch.bbclass
> > index 5bd5c44a276..0aadf7bfba6 100644
> > --- a/meta/classes/allarch.bbclass
> > +++ b/meta/classes/allarch.bbclass
> > @@ -43,6 +43,9 @@ python () {
> >  d.setVar("TARGET_LDFLAGS", "none")
> >  d.setVar("POPULATESYSROOTDEPS", "")
> >
> > +if bb.data.inherits_class("meson", d):
> > +d.setVar("do_write_config", ":")
> > +
> >  # Avoid this being unnecessarily different due to nuances of
> >  # the target machine that aren't important for "all" arch
> >  # packages.
> >
> >
>
> Sorry, that isn't quite right. We want to just remove the append to 
> write_config
> which generates the qemu wrapper which will probably need a little more 
> invasive
> juggling of the code to make it easier...

Your patch to disable the qemu wrapper for allarch looks like a good solution.
Hopefully, that will work OK across the board.

Thanks,
-Matt

>
> Cheers,
>
> Richard
>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#160262): 
https://lists.openembedded.org/g/openembedded-core/message/160262
Mute This Topic: https://lists.openembedded.org/mt/87752526/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core][PATCH] qemu.bbclass: drop OLDEST_KERNEL reference

2022-01-07 Thread Matt Madison
On Fri, Jan 7, 2022 at 3:19 AM Richard Purdie
 wrote:
>
> On Wed, 2021-12-15 at 12:16 -0800, Matt Madison wrote:
> > which is introducing task hash changes for some
> > allarch package builds, and should no longer
> > be needed with recent versions of qemu.
> >
> > Signed-off-by: Matt Madison 
> > ---
> >  meta/classes/qemu.bbclass | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/meta/classes/qemu.bbclass b/meta/classes/qemu.bbclass
> > index 01a7b86ae1..333202b7c4 100644
> > --- a/meta/classes/qemu.bbclass
> > +++ b/meta/classes/qemu.bbclass
> > @@ -54,7 +54,7 @@ def qemu_run_binary(data, rootfs_path, binary):
> >  # this dance). For others (e.g. arm) a -cpu option is not necessary, since 
> > the
> >  # qemu-arm default CPU supports all required architecture levels.
> >
> > -QEMU_OPTIONS = "-r ${OLDEST_KERNEL} ${@d.getVar("QEMU_EXTRAOPTIONS_%s" % 
> > d.getVar('PACKAGE_ARCH')) or ""}"
> > +QEMU_OPTIONS = "${@d.getVar("QEMU_EXTRAOPTIONS_%s" % 
> > d.getVar('PACKAGE_ARCH')) or ""}"
> >  QEMU_OPTIONS[vardeps] += "QEMU_EXTRAOPTIONS_${PACKAGE_ARCH}"
> >
> >  QEMU_EXTRAOPTIONS_ppce500v2 = " -cpu e500v2"
>
> I've sent a revert for this since the commit message isn't true, this is 
> causing
> autobuilder failures and there was also a user report of issues with it.

Bummer.  I think this is because our OLDEST_KERNEL setting for aarch64
(3.14.0) is
higher than the UNAME_MINIMUM_RELEASE definition in QEMU (3.8.0).

> https://autobuilder.yoctoproject.org/typhoon/#/builders/42/builds/4559/steps/13/logs/stdio
> (centos7 aarch64 build)
>
> We'll have to find a different way to fix the allarch issue (more details
> welcome on which package shows the issue).

I ran into the issue with cantarell-fonts and wayland-protocols, but
any recipe that inherits both allarch and meson should trigger it.

In my case, I have a layer check job for meta-tegra that runs
yocto-check-layer with the --machines option specifying qemux86 and
one of the (aarch64) machines in my layer, and that was reporting the
signature changes between the two architectures.

-Matt

>
> Cheers,
>
> Richard
>
>
>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#160255): 
https://lists.openembedded.org/g/openembedded-core/message/160255
Mute This Topic: https://lists.openembedded.org/mt/87752526/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH 4/6] go-runtime.inc: do not make installation set dependent on host

2022-01-02 Thread Matt Madison
On Sat, Jan 1, 2022 at 3:30 AM Alexander Kanavin  wrote:
>
> This cannot be right: what we install for the target should not
> depend on what host it's being built on. If this was fixing
> some problem, there needs to be a different solution.

IIRC, I added this because the go toolchain doesn't really do
host/target separation like gcc does. The runtime packages for both
host and target get populated during the compilation, and if the
target architecture matches the build host's architecture, you'd get
just one copy in the tree. And back then, at least, the go-runtime
package needed those files, so the check was there to make sure they
didn't get deleted just because the two architectures were the same.

That's the way things were 5 years ago, though, and the toolchain has
changed a lot since then. It might not be needed any more.

-Matt

>
> Signed-off-by: Alexander Kanavin 
> ---
>  meta/recipes-devtools/go/go-runtime.inc | 6 ++
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/meta/recipes-devtools/go/go-runtime.inc 
> b/meta/recipes-devtools/go/go-runtime.inc
> index a08d44dd3a..106017bd89 100644
> --- a/meta/recipes-devtools/go/go-runtime.inc
> +++ b/meta/recipes-devtools/go/go-runtime.inc
> @@ -43,10 +43,8 @@ do_compile[cleandirs] += "${GOTMPDIR} ${B}/bin ${B}/pkg"
>  do_install() {
> install -d ${D}${libdir}/go/src
> cp --preserve=mode,timestamps -R ${B}/pkg ${D}${libdir}/go/
> -   if [ "${BUILD_GOTUPLE}" != "${TARGET_GOTUPLE}" ]; then
> -   rm -rf ${D}${libdir}/go/pkg/${BUILD_GOTUPLE}
> -   rm -rf ${D}${libdir}/go/pkg/obj/${BUILD_GOTUPLE}
> -   fi
> +   rm -rf ${D}${libdir}/go/pkg/${BUILD_GOTUPLE}
> +   rm -rf ${D}${libdir}/go/pkg/obj/${BUILD_GOTUPLE}
> rm -rf ${D}${libdir}/go/pkg/tool
> rm -rf ${D}${libdir}/go/pkg/obj
> rm -rf ${D}${libdir}/go/pkg/bootstrap
> --
> 2.20.1
>
>
> 
>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#160100): 
https://lists.openembedded.org/g/openembedded-core/message/160100
Mute This Topic: https://lists.openembedded.org/mt/88071321/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core][PATCH 0/4] Move crate fetcher to OE_IMPORTS

2021-12-21 Thread Matt Madison
On Tue, Dec 21, 2021 at 6:07 AM Paul Barker  wrote:
>
> On 20/12/2021 22:34, Richard Purdie wrote:
> > On Mon, 2021-12-20 at 17:01 +, Paul Barker wrote:
> >> On 17/12/2021 15:36, Matt Madison wrote:
> >>> This patch series switches to using the OE_IMPORTS mechanism
> >>> for installing the crate fetcher. This simplifies the addition
> >>> and clears up issues with interactions between SRCPV and
> >>> the shared-state fetching logic.
> >>>
> >>> Matt Madison (4):
> >>> lib/crate.py: install crate fetcher on import
> >>> base.bbclass: add crate to OE_IMPORTS
> >>> cargo_common.bbclass: remove inherit of crate-fetch
> >>> classes: remove crate-fetch.bbclass
> >>>
> >>>meta/classes/base.bbclass |  2 +-
> >>>meta/classes/cargo_common.bbclass |  2 --
> >>>meta/classes/crate-fetch.bbclass  | 28 
> >>>meta/lib/crate.py |  2 ++
> >>>4 files changed, 3 insertions(+), 31 deletions(-)
> >>>delete mode 100644 meta/classes/crate-fetch.bbclass
> >>>
> >>
> >> Would a better solution here be to move the crate fetcher into
> >> lib/bb/fetch2/ in bitbake?
> >
> > I've been wondering about this too.
> >
> > Does anyone remember how the fetcher lines up against the general fetcher
> > requirements we have and is there a list of anything that remained to be 
> > done
> > before it could be added to bitbake?
>
> If I remember correctly, it just needed some test cases writing. The
> crate fetcher is a subclass of the wget fetcher with changes to how
> urldata is set up and how unpack is handled, so it should integrate well
> into bitbake.

One thing I see that's a bit worrisome is that it disables
recommends_checksum for the downloaded files,
and populates metadata for use (I assume) by cargo with the calculated
SHA256 on the download.

-Matt

>
> Thanks,
>
> --
> Paul Barker
> Principal Software Engineer
> SanCloud Ltd
>
> e: paul.bar...@sancloud.com
> w: https://sancloud.co.uk/

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#159928): 
https://lists.openembedded.org/g/openembedded-core/message/159928
Mute This Topic: https://lists.openembedded.org/mt/87791267/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core][PATCH 2/4] base.bbclass: add crate to OE_IMPORTS

2021-12-20 Thread Matt Madison
On Fri, Dec 17, 2021 at 8:37 AM Alexander Kanavin
 wrote:
>
> Should this be named oe.crate for consistency and avoiding potential clashes?

I retained the existing name for this change set.  The same thought
had occurred to me, though.

-Matt

>
> Alex
>
> On Fri, 17 Dec 2021 at 18:37, Matt Madison  wrote:
>>
>> to install the crate:// fetch handler.
>>
>> Signed-off-by: Matt Madison 
>> ---
>>  meta/classes/base.bbclass | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
>> index b709777f24..ee9950f207 100644
>> --- a/meta/classes/base.bbclass
>> +++ b/meta/classes/base.bbclass
>> @@ -12,7 +12,7 @@ inherit logging
>>
>>  OE_EXTRA_IMPORTS ?= ""
>>
>> -OE_IMPORTS += "os sys time oe.path oe.utils oe.types oe.package 
>> oe.packagegroup oe.sstatesig oe.lsb oe.cachedpath oe.license oe.qa 
>> oe.reproducible ${OE_EXTRA_IMPORTS}"
>> +OE_IMPORTS += "os sys time oe.path oe.utils oe.types oe.package 
>> oe.packagegroup oe.sstatesig oe.lsb oe.cachedpath oe.license oe.qa 
>> oe.reproducible crate ${OE_EXTRA_IMPORTS}"
>>  OE_IMPORTS[type] = "list"
>>
>>  PACKAGECONFIG_CONFARGS ??= ""
>> --
>> 2.32.0
>>
>>
>> 
>>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#159891): 
https://lists.openembedded.org/g/openembedded-core/message/159891
Mute This Topic: https://lists.openembedded.org/mt/87791269/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core][PATCH] qemu.bbclass: drop OLDEST_KERNEL reference

2021-12-20 Thread Matt Madison
On Sun, Dec 19, 2021 at 3:36 PM Richard Purdie
 wrote:
>
> On Wed, 2021-12-15 at 12:16 -0800, Matt Madison wrote:
> > which is introducing task hash changes for some
> > allarch package builds, and should no longer
> > be needed with recent versions of qemu.
> >
> > Signed-off-by: Matt Madison 
> > ---
> >  meta/classes/qemu.bbclass | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/meta/classes/qemu.bbclass b/meta/classes/qemu.bbclass
> > index 01a7b86ae1..333202b7c4 100644
> > --- a/meta/classes/qemu.bbclass
> > +++ b/meta/classes/qemu.bbclass
> > @@ -54,7 +54,7 @@ def qemu_run_binary(data, rootfs_path, binary):
> >  # this dance). For others (e.g. arm) a -cpu option is not necessary, since 
> > the
> >  # qemu-arm default CPU supports all required architecture levels.
> >
> > -QEMU_OPTIONS = "-r ${OLDEST_KERNEL} ${@d.getVar("QEMU_EXTRAOPTIONS_%s" % 
> > d.getVar('PACKAGE_ARCH')) or ""}"
> > +QEMU_OPTIONS = "${@d.getVar("QEMU_EXTRAOPTIONS_%s" % 
> > d.getVar('PACKAGE_ARCH')) or ""}"
> >  QEMU_OPTIONS[vardeps] += "QEMU_EXTRAOPTIONS_${PACKAGE_ARCH}"
> >
> >  QEMU_EXTRAOPTIONS_ppce500v2 = " -cpu e500v2"
>
> Rather worryingly this breaks a few docs packages for reproducibility:
>
> http://autobuilder.yocto.io/pub/repro-fail/oe-reproducible-20211219-6kkv1f8k/packages/diff-html/
>
> which raises a number of questions in my mind. Investigation is needed as the
> hashes clearly aren't encoding everything they should :(.

I think the problem is in manpages.bbclass - the ":append" for adding
to the pkg_postinst/pkg_postrm functions is in the wrong place.
Fixing them so the ":append" is at the end, rather than before
"${MAN_PKG}", causes the function text and dependencies to show up in
dumpsig output again.

-Matt

>
> Cheers,
>
> Richard
>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#159866): 
https://lists.openembedded.org/g/openembedded-core/message/159866
Mute This Topic: https://lists.openembedded.org/mt/87752526/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] cargo fetcher, SRCPV, and setscene issues

2021-12-17 Thread Matt Madison
On Thu, Dec 16, 2021 at 9:09 AM Matt Madison via
lists.openembedded.org 
wrote:
>
> On Thu, Dec 16, 2021 at 7:53 AM Matt Madison via
> lists.openembedded.org 
> wrote:
> >
> > On Thu, Dec 16, 2021 at 6:47 AM Joshua Watt  wrote:
> > >
> > > On Wed, Dec 15, 2021 at 8:16 AM Matt Madison  wrote:
> > > >
> > > > I'm finding that none of the Rust recipes are getting setscened in my 
> > > > builds off
> > > > master due to the the SRCPV hack that was added to make the cargo 
> > > > fetcher
> > > > visible during parsing. There's no error reported about it, but by 
> > > > adding an
> > > > exception handler into the sstate code I tracked it down to 
> > > > pstaging_fetch()'s
> > > > using d.getVar('SRCPV').  Since the cargo fetcher doesn't advertise
> > > > srcrev support,
> > > > the base fetcher class raises an exception on this, causing the
> > > > mostly-silent failure.
> > >
> > > Hmm, this is strange. I have this recipe:
> > > https://github.com/JPEWdev/meta-phosh/blob/master/recipes-graphics/squeekboard/squeekboard_git.bb
> > > that is using the cargo fetcher and it is definitely using sstate like
> > > I would expect; perhaps there is some other strange interaction with
> > > another class?
> >
> > I'm just talking about the rust toolchain, libstd-rs, cargo, etc.
> > It's simple enough for me to reproduce with a bare-bones setup:
> >
> > 1. clone openembedded-core and bitbake
> > 2. init build environment
> > 3. set MACHINE="qemuarm64" in local.conf
> > 4. bitbake librsvg
> > 5. Copy sstate-cache contents to a web server
> > 6. Wipe build workspace, re-init, and set SSTATE_MIRRORS to point to
> > the web server
> > 7. bitbake --setscene-only librsvg
> >
> > I've attached the cooker log of a sample build.  You'll see from the
> > sstate summary that everything was found, but there will be warnings
> > when executing the setscenes.
>
> And if I apply the following patch:
> diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
> index 0326d27c74..ffc3b08b7d 100644
> --- a/meta/classes/sstate.bbclass
> +++ b/meta/classes/sstate.bbclass
> @@ -761,7 +761,12 @@ def pstaging_fetch(sstatefetch, d):
>  localdata.setVar('FILESPATH', dldir)
>  localdata.setVar('DL_DIR', dldir)
>  localdata.setVar('PREMIRRORS', mirrors)
> -localdata.setVar('SRCPV', d.getVar('SRCPV'))
> +try:
> +curpv = d.getVar('SRCPV')
> +except Exception as e:
> +bb.warn("Failed to get SRCPV: %s" % e)
> +curpv = ''
> +localdata.setVar('SRCPV', curpv)
>
> the setscenes work, and the warning is:
>
> WARNING: libstd-rs-1.57.0-r0 do_packagedata_setscene: Failed to get
> SRCPV: Failure expanding variable SRCPV, expression was
> ${@crate_get_srcrev(d)} which triggered exception FetchError: Fetcher
> failure: SRCREV was used yet no valid SCM was found in SRC_URI
> The variable dependency chain for the failure is: SRCPV
>
> I'm just not sure whether that's the right place to fix this.

I think I've figured out a clean way to solve the problem, and have
sent patches for review.

-M

>
> -M
>
>
> >
> > -Matt
> >
> > >
> > > >
> > > > There's no issue if the sstate package is already in the local cache;
> > > > it only affects
> > > > builds where I need to fetch from my sstate mirror.
> > > >
> > > > I'd submit a patch, but I'm not sure what the right solution would be.
> > > >
> > > > Regards,
> > > > -Matt
> > > >
> > > >
> > > >
> >
> >
> >
>
> 
>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#159833): 
https://lists.openembedded.org/g/openembedded-core/message/159833
Mute This Topic: https://lists.openembedded.org/mt/87744591/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core][PATCH 4/4] classes: remove crate-fetch.bbclass

2021-12-17 Thread Matt Madison
No longer required now that the crate fetcher
gets installed via OE_IMPORTS.

Signed-off-by: Matt Madison 
---
 meta/classes/crate-fetch.bbclass | 28 
 1 file changed, 28 deletions(-)
 delete mode 100644 meta/classes/crate-fetch.bbclass

diff --git a/meta/classes/crate-fetch.bbclass b/meta/classes/crate-fetch.bbclass
deleted file mode 100644
index a7fa22b2a0..00
--- a/meta/classes/crate-fetch.bbclass
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# crate-fetch class
-#
-# Registers 'crate' method for Bitbake fetch2.
-#
-# Adds support for following format in recipe SRC_URI:
-# crate:///
-#
-
-def import_crate(d):
-import crate
-if not getattr(crate, 'imported', False):
-bb.fetch2.methods.append(crate.Crate())
-crate.imported = True
-
-python crate_import_handler() {
-import_crate(d)
-}
-
-addhandler crate_import_handler
-crate_import_handler[eventmask] = "bb.event.RecipePreFinalise"
-
-def crate_get_srcrev(d):
-import_crate(d)
-return bb.fetch2.get_srcrev(d)
-
-# Override SRCPV to make sure it imports the fetcher first
-SRCPV = "${@crate_get_srcrev(d)}"
-- 
2.32.0


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#159832): 
https://lists.openembedded.org/g/openembedded-core/message/159832
Mute This Topic: https://lists.openembedded.org/mt/87791272/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core][PATCH 2/4] base.bbclass: add crate to OE_IMPORTS

2021-12-17 Thread Matt Madison
to install the crate:// fetch handler.

Signed-off-by: Matt Madison 
---
 meta/classes/base.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index b709777f24..ee9950f207 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -12,7 +12,7 @@ inherit logging
 
 OE_EXTRA_IMPORTS ?= ""
 
-OE_IMPORTS += "os sys time oe.path oe.utils oe.types oe.package 
oe.packagegroup oe.sstatesig oe.lsb oe.cachedpath oe.license oe.qa 
oe.reproducible ${OE_EXTRA_IMPORTS}"
+OE_IMPORTS += "os sys time oe.path oe.utils oe.types oe.package 
oe.packagegroup oe.sstatesig oe.lsb oe.cachedpath oe.license oe.qa 
oe.reproducible crate ${OE_EXTRA_IMPORTS}"
 OE_IMPORTS[type] = "list"
 
 PACKAGECONFIG_CONFARGS ??= ""
-- 
2.32.0


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#159830): 
https://lists.openembedded.org/g/openembedded-core/message/159830
Mute This Topic: https://lists.openembedded.org/mt/87791269/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core][PATCH 3/4] cargo_common.bbclass: remove inherit of crate-fetch

2021-12-17 Thread Matt Madison
No longer needed now that the crate fetcher is
installed via OE_IMPORTS.

Signed-off-by: Matt Madison 
---
 meta/classes/cargo_common.bbclass | 2 --
 1 file changed, 2 deletions(-)

diff --git a/meta/classes/cargo_common.bbclass 
b/meta/classes/cargo_common.bbclass
index 23d82aa6ab..c403591434 100644
--- a/meta/classes/cargo_common.bbclass
+++ b/meta/classes/cargo_common.bbclass
@@ -8,8 +8,6 @@
 ## is used by cargo.bbclass and Rust
 ##
 
-# add crate fetch support
-inherit crate-fetch
 inherit rust-common
 
 # Where we download our registry and dependencies to
-- 
2.32.0


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#159831): 
https://lists.openembedded.org/g/openembedded-core/message/159831
Mute This Topic: https://lists.openembedded.org/mt/87791271/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core][PATCH 0/4] Move crate fetcher to OE_IMPORTS

2021-12-17 Thread Matt Madison
This patch series switches to using the OE_IMPORTS mechanism
for installing the crate fetcher. This simplifies the addition
and clears up issues with interactions between SRCPV and
the shared-state fetching logic.

Matt Madison (4):
  lib/crate.py: install crate fetcher on import
  base.bbclass: add crate to OE_IMPORTS
  cargo_common.bbclass: remove inherit of crate-fetch
  classes: remove crate-fetch.bbclass

 meta/classes/base.bbclass |  2 +-
 meta/classes/cargo_common.bbclass |  2 --
 meta/classes/crate-fetch.bbclass  | 28 
 meta/lib/crate.py |  2 ++
 4 files changed, 3 insertions(+), 31 deletions(-)
 delete mode 100644 meta/classes/crate-fetch.bbclass

-- 
2.32.0


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#159828): 
https://lists.openembedded.org/g/openembedded-core/message/159828
Mute This Topic: https://lists.openembedded.org/mt/87791267/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core][PATCH 1/4] lib/crate.py: install crate fetcher on import

2021-12-17 Thread Matt Madison
to enable the move to using OE_IMPORTS for adding
this fetcher.

Signed-off-by: Matt Madison 
---
 meta/lib/crate.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/lib/crate.py b/meta/lib/crate.py
index d10f441875..f9db7c28cd 100644
--- a/meta/lib/crate.py
+++ b/meta/lib/crate.py
@@ -147,3 +147,5 @@ class Crate(Wget):
 mdpath = os.path.join(bbpath, cratepath, mdfile)
 with open(mdpath, "w") as f:
 json.dump(metadata, f)
+
+bb.fetch2.methods.append(Crate())
-- 
2.32.0


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#159829): 
https://lists.openembedded.org/g/openembedded-core/message/159829
Mute This Topic: https://lists.openembedded.org/mt/87791268/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] cargo fetcher, SRCPV, and setscene issues

2021-12-16 Thread Matt Madison
On Thu, Dec 16, 2021 at 7:53 AM Matt Madison via
lists.openembedded.org 
wrote:
>
> On Thu, Dec 16, 2021 at 6:47 AM Joshua Watt  wrote:
> >
> > On Wed, Dec 15, 2021 at 8:16 AM Matt Madison  wrote:
> > >
> > > I'm finding that none of the Rust recipes are getting setscened in my 
> > > builds off
> > > master due to the the SRCPV hack that was added to make the cargo fetcher
> > > visible during parsing. There's no error reported about it, but by adding 
> > > an
> > > exception handler into the sstate code I tracked it down to 
> > > pstaging_fetch()'s
> > > using d.getVar('SRCPV').  Since the cargo fetcher doesn't advertise
> > > srcrev support,
> > > the base fetcher class raises an exception on this, causing the
> > > mostly-silent failure.
> >
> > Hmm, this is strange. I have this recipe:
> > https://github.com/JPEWdev/meta-phosh/blob/master/recipes-graphics/squeekboard/squeekboard_git.bb
> > that is using the cargo fetcher and it is definitely using sstate like
> > I would expect; perhaps there is some other strange interaction with
> > another class?
>
> I'm just talking about the rust toolchain, libstd-rs, cargo, etc.
> It's simple enough for me to reproduce with a bare-bones setup:
>
> 1. clone openembedded-core and bitbake
> 2. init build environment
> 3. set MACHINE="qemuarm64" in local.conf
> 4. bitbake librsvg
> 5. Copy sstate-cache contents to a web server
> 6. Wipe build workspace, re-init, and set SSTATE_MIRRORS to point to
> the web server
> 7. bitbake --setscene-only librsvg
>
> I've attached the cooker log of a sample build.  You'll see from the
> sstate summary that everything was found, but there will be warnings
> when executing the setscenes.

And if I apply the following patch:
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 0326d27c74..ffc3b08b7d 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -761,7 +761,12 @@ def pstaging_fetch(sstatefetch, d):
 localdata.setVar('FILESPATH', dldir)
 localdata.setVar('DL_DIR', dldir)
 localdata.setVar('PREMIRRORS', mirrors)
-localdata.setVar('SRCPV', d.getVar('SRCPV'))
+try:
+curpv = d.getVar('SRCPV')
+except Exception as e:
+bb.warn("Failed to get SRCPV: %s" % e)
+curpv = ''
+localdata.setVar('SRCPV', curpv)

the setscenes work, and the warning is:

WARNING: libstd-rs-1.57.0-r0 do_packagedata_setscene: Failed to get
SRCPV: Failure expanding variable SRCPV, expression was
${@crate_get_srcrev(d)} which triggered exception FetchError: Fetcher
failure: SRCREV was used yet no valid SCM was found in SRC_URI
The variable dependency chain for the failure is: SRCPV

I'm just not sure whether that's the right place to fix this.

-M


>
> -Matt
>
> >
> > >
> > > There's no issue if the sstate package is already in the local cache;
> > > it only affects
> > > builds where I need to fetch from my sstate mirror.
> > >
> > > I'd submit a patch, but I'm not sure what the right solution would be.
> > >
> > > Regards,
> > > -Matt
> > >
> > >
> > >
>
> 
>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#159798): 
https://lists.openembedded.org/g/openembedded-core/message/159798
Mute This Topic: https://lists.openembedded.org/mt/87744591/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] cargo fetcher, SRCPV, and setscene issues

2021-12-16 Thread Matt Madison
On Thu, Dec 16, 2021 at 6:47 AM Joshua Watt  wrote:
>
> On Wed, Dec 15, 2021 at 8:16 AM Matt Madison  wrote:
> >
> > I'm finding that none of the Rust recipes are getting setscened in my 
> > builds off
> > master due to the the SRCPV hack that was added to make the cargo fetcher
> > visible during parsing. There's no error reported about it, but by adding an
> > exception handler into the sstate code I tracked it down to 
> > pstaging_fetch()'s
> > using d.getVar('SRCPV').  Since the cargo fetcher doesn't advertise
> > srcrev support,
> > the base fetcher class raises an exception on this, causing the
> > mostly-silent failure.
>
> Hmm, this is strange. I have this recipe:
> https://github.com/JPEWdev/meta-phosh/blob/master/recipes-graphics/squeekboard/squeekboard_git.bb
> that is using the cargo fetcher and it is definitely using sstate like
> I would expect; perhaps there is some other strange interaction with
> another class?

I'm just talking about the rust toolchain, libstd-rs, cargo, etc.
It's simple enough for me to reproduce with a bare-bones setup:

1. clone openembedded-core and bitbake
2. init build environment
3. set MACHINE="qemuarm64" in local.conf
4. bitbake librsvg
5. Copy sstate-cache contents to a web server
6. Wipe build workspace, re-init, and set SSTATE_MIRRORS to point to
the web server
7. bitbake --setscene-only librsvg

I've attached the cooker log of a sample build.  You'll see from the
sstate summary that everything was found, but there will be warnings
when executing the setscenes.

-Matt

>
> >
> > There's no issue if the sstate package is already in the local cache;
> > it only affects
> > builds where I need to fetch from my sstate mirror.
> >
> > I'd submit a patch, but I'm not sure what the right solution would be.
> >
> > Regards,
> > -Matt
> >
> > 
> >
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION   = "1.53.0"
BUILD_SYS= "x86_64-linux"
NATIVELSBSTRING  = "ubuntu-21.10"
TARGET_SYS   = "aarch64-oe-linux"
MACHINE  = "qemuarm64"
DISTRO   = "nodistro"
DISTRO_VERSION   = "nodistro.0"
TUNE_FEATURES= "aarch64 armv8a crc cortexa57"
TARGET_FPU   = ""
meta = "qemu-patch:c2da77c6aa63b26b5b7ea9fdc749b6009820f1f1"

Sstate summary: Wanted 427 Local 0 Mirrors 427 Missed 0 Current 0 (100% match, 0% complete)
NOTE: Executing Tasks
NOTE: Running setscene task 1 of 427 (/build/madison/openembedded-core/meta/recipes-gnome/librsvg/librsvg_2.52.4.bb:do_package_qa_setscene)
NOTE: Running setscene task 2 of 427 (/build/madison/openembedded-core/meta/recipes-gnome/librsvg/librsvg_2.52.4.bb:do_package_write_ipk_setscene)
NOTE: Running setscene task 3 of 427 (/build/madison/openembedded-core/meta/recipes-gnome/librsvg/librsvg_2.52.4.bb:do_populate_lic_setscene)
NOTE: Running setscene task 4 of 427 (/build/madison/openembedded-core/meta/recipes-gnome/librsvg/librsvg_2.52.4.bb:do_populate_sysroot_setscene)
NOTE: Running setscene task 5 of 427 (virtual:native:/build/madison/openembedded-core/meta/recipes-devtools/pseudo/pseudo_git.bb:do_populate_sysroot_setscene)
NOTE: recipe librsvg-2.52.4-r0: task do_package_qa_setscene: Started
NOTE: recipe librsvg-2.52.4-r0: task do_package_write_ipk_setscene: Started
NOTE: recipe librsvg-2.52.4-r0: task do_populate_lic_setscene: Started
NOTE: recipe librsvg-2.52.4-r0: task do_populate_sysroot_setscene: Started
NOTE: recipe pseudo-native-1.9.0+gitAUTOINC+d34f2f6ced-r0: task do_populate_sysroot_setscene: Started
NOTE: recipe pseudo-native-1.9.0+gitAUTOINC+d34f2f6ced-r0: task do_populate_sysroot_setscene: Succeeded
NOTE: recipe librsvg-2.52.4-r0: task do_package_qa_setscene: Succeeded
NOTE: recipe librsvg-2.52.4-r0: task do_populate_lic_setscene: Succeeded
NOTE: recipe librsvg-2.52.4-r0: task do_package_write_ipk_setscene: Succeeded
NOTE: Running setscene task 7 of 427 (/build/madison/openembedded-core/meta/recipes-gnome/librsvg/librsvg_2.52.4.bb:do_packagedata_setscene)
NOTE: Running setscene task 8 of 427 (virtual:native:/build/madison/openembedded-core/meta/recipes-devtools/opkg-utils/opkg-utils_0.5.0.bb:do_populate_sysroot_setscene)
NOTE: recipe librsvg-2.52.4-r0: task do_populate_sysroot_setscene: Succeeded
NOTE: recipe librsvg-2.52.4-r0: task do_packagedata_setscene: Started
NOTE: recipe opkg-utils-native-0.5.0-r0: task do_populate_sysroot_setscene: Started
NOTE: recipe opkg-utils-native-0.5.0-r0: task do_populate_sysroot_setscene: Succeeded
NOTE: recipe librsvg-2.52.4-r0: task do_packagedata_setscene: Succeeded
NOTE: Running setscene task 11 of 427 (/build/madison/openembedded-core/meta/recipes-devtools/rust/libstd-rs_1.57.0.bb:do_packagedata_set

[OE-core][PATCH v2 2/2] qemu: add patch to set minimum kernel version for riscv32

2021-12-16 Thread Matt Madison
which enables us to drop the -r option on qemu-static-riscv32
invocations.

Signed-off-by: Matt Madison 
---
 meta/recipes-devtools/qemu/qemu.inc   |  1 +
 ...s-minimum-kernel-version-for-riscv32.patch | 40 +++
 2 files changed, 41 insertions(+)
 create mode 100644 
meta/recipes-devtools/qemu/qemu/0001-riscv-Set-5.4-as-minimum-kernel-version-for-riscv32.patch

diff --git a/meta/recipes-devtools/qemu/qemu.inc 
b/meta/recipes-devtools/qemu/qemu.inc
index fe35f94acf..584c9482e9 100644
--- a/meta/recipes-devtools/qemu/qemu.inc
+++ b/meta/recipes-devtools/qemu/qemu.inc
@@ -27,6 +27,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
file://determinism.patch \

file://0001-tests-meson.build-use-relative-path-to-refer-to-file.patch \
file://0001-linux-user-Replace-__u64-with-uint64_t.patch \
+   
file://0001-riscv-Set-5.4-as-minimum-kernel-version-for-riscv32.patch \
"
 UPSTREAM_CHECK_REGEX = "qemu-(?P\d+(\.\d+)+)\.tar"
 
diff --git 
a/meta/recipes-devtools/qemu/qemu/0001-riscv-Set-5.4-as-minimum-kernel-version-for-riscv32.patch
 
b/meta/recipes-devtools/qemu/qemu/0001-riscv-Set-5.4-as-minimum-kernel-version-for-riscv32.patch
new file mode 100644
index 00..ac4b6dcc44
--- /dev/null
+++ 
b/meta/recipes-devtools/qemu/qemu/0001-riscv-Set-5.4-as-minimum-kernel-version-for-riscv32.patch
@@ -0,0 +1,40 @@
+From 359dc12eb32b2395cf10796157002024e6a58054 Mon Sep 17 00:00:00 2001
+From: Khem Raj 
+Date: Wed, 15 Dec 2021 23:31:11 -0800
+Subject: [PATCH] riscv: Set 5.4 as minimum kernel version for riscv32
+
+5.4 is first stable API as far as rv32 is concerned see [1]
+
+[1] 
https://sourceware.org/git/?p=glibc.git;a=commit;h=7a55dd3fb6d2c307a002a16776be84310b9c8989
+
+Upstream-Status: Submitted 
[https://lists.nongnu.org/archive/html/qemu-devel/2021-12/msg02495.html]
+
+Signed-off-by: Khem Raj 
+Cc: Palmer Dabbelt 
+Cc: Alistair Francis 
+Cc: Bin Meng 
+Signed-off-by: Matt Madison 
+---
+ linux-user/riscv/target_syscall.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/linux-user/riscv/target_syscall.h 
b/linux-user/riscv/target_syscall.h
+index dc597c897..9b1316132 100644
+--- a/linux-user/riscv/target_syscall.h
 b/linux-user/riscv/target_syscall.h
+@@ -45,10 +45,11 @@ struct target_pt_regs {
+ 
+ #ifdef TARGET_RISCV32
+ #define UNAME_MACHINE "riscv32"
++#define UNAME_MINIMUM_RELEASE "5.4.0"
+ #else
+ #define UNAME_MACHINE "riscv64"
+-#endif
+ #define UNAME_MINIMUM_RELEASE "4.15.0"
++#endif
+ 
+ #define TARGET_MINSIGSTKSZ 2048
+ #define TARGET_MCL_CURRENT 1
+-- 
+2.32.0
+
-- 
2.32.0


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#159783): 
https://lists.openembedded.org/g/openembedded-core/message/159783
Mute This Topic: https://lists.openembedded.org/mt/87765280/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core][PATCH v2 0/2] qemu.bbclass: drop OLDEST_KERNEL reference

2021-12-16 Thread Matt Madison
This addresses an issue with allarch recipes that use meson, where
inheriting qemu.bbclass causes task signature changes when built with
MACHINEs with different architectures due to the reference to the
OLDEST_KERNEL variable for setting up qemu wrapper invocations.

V2:
  * Backport Khem's qemu patch to set minimum kernel version for riscv32.
With this patch, qemu for all supported archs should have a built-in
oldest kernel setting, eliminating the need for putting it on the
command line.

Matt Madison (2):
  qemu.bbclass: drop OLDEST_KERNEL reference
  qemu: add patch to set minimum kernel version for riscv32

 meta/classes/qemu.bbclass |  2 +-
 meta/recipes-devtools/qemu/qemu.inc   |  1 +
 ...s-minimum-kernel-version-for-riscv32.patch | 40 +++
 3 files changed, 42 insertions(+), 1 deletion(-)
 create mode 100644 
meta/recipes-devtools/qemu/qemu/0001-riscv-Set-5.4-as-minimum-kernel-version-for-riscv32.patch

-- 
2.32.0


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#159781): 
https://lists.openembedded.org/g/openembedded-core/message/159781
Mute This Topic: https://lists.openembedded.org/mt/87765278/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core][PATCH v2 1/2] qemu.bbclass: drop OLDEST_KERNEL reference

2021-12-16 Thread Matt Madison
which is introducing task hash changes for some
allarch package builds, and should no longer
be needed with recent versions of qemu.

Signed-off-by: Matt Madison 
---
 meta/classes/qemu.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/qemu.bbclass b/meta/classes/qemu.bbclass
index 01a7b86ae1..333202b7c4 100644
--- a/meta/classes/qemu.bbclass
+++ b/meta/classes/qemu.bbclass
@@ -54,7 +54,7 @@ def qemu_run_binary(data, rootfs_path, binary):
 # this dance). For others (e.g. arm) a -cpu option is not necessary, since the
 # qemu-arm default CPU supports all required architecture levels.
 
-QEMU_OPTIONS = "-r ${OLDEST_KERNEL} ${@d.getVar("QEMU_EXTRAOPTIONS_%s" % 
d.getVar('PACKAGE_ARCH')) or ""}"
+QEMU_OPTIONS = "${@d.getVar("QEMU_EXTRAOPTIONS_%s" % d.getVar('PACKAGE_ARCH')) 
or ""}"
 QEMU_OPTIONS[vardeps] += "QEMU_EXTRAOPTIONS_${PACKAGE_ARCH}"
 
 QEMU_EXTRAOPTIONS_ppce500v2 = " -cpu e500v2"
-- 
2.32.0


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#159782): 
https://lists.openembedded.org/g/openembedded-core/message/159782
Mute This Topic: https://lists.openembedded.org/mt/87765279/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core][PATCH] qemu.bbclass: drop OLDEST_KERNEL reference

2021-12-15 Thread Matt Madison
On Wed, Dec 15, 2021 at 12:24 PM Khem Raj  wrote:
>
>
>
> On 12/15/21 12:16 PM, Matt Madison wrote:
> > which is introducing task hash changes for some
> > allarch package builds, and should no longer
> > be needed with recent versions of qemu.
> >
>
> This would need a qemu backport for riscv32
> https://lists.nongnu.org/archive/html/qemu-riscv/2021-12/msg00220.html

Thanks, Khem.  I'll publish a V2 with that addition.

-Matt

>
> > Signed-off-by: Matt Madison 
> > ---
> >   meta/classes/qemu.bbclass | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/meta/classes/qemu.bbclass b/meta/classes/qemu.bbclass
> > index 01a7b86ae1..333202b7c4 100644
> > --- a/meta/classes/qemu.bbclass
> > +++ b/meta/classes/qemu.bbclass
> > @@ -54,7 +54,7 @@ def qemu_run_binary(data, rootfs_path, binary):
> >   # this dance). For others (e.g. arm) a -cpu option is not necessary, 
> > since the
> >   # qemu-arm default CPU supports all required architecture levels.
> >
> > -QEMU_OPTIONS = "-r ${OLDEST_KERNEL} ${@d.getVar("QEMU_EXTRAOPTIONS_%s" % 
> > d.getVar('PACKAGE_ARCH')) or ""}"
> > +QEMU_OPTIONS = "${@d.getVar("QEMU_EXTRAOPTIONS_%s" % 
> > d.getVar('PACKAGE_ARCH')) or ""}"
> >   QEMU_OPTIONS[vardeps] += "QEMU_EXTRAOPTIONS_${PACKAGE_ARCH}"
> >
> >   QEMU_EXTRAOPTIONS_ppce500v2 = " -cpu e500v2"

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#159742): 
https://lists.openembedded.org/g/openembedded-core/message/159742
Mute This Topic: https://lists.openembedded.org/mt/87752526/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core][PATCH] qemu.bbclass: drop OLDEST_KERNEL reference

2021-12-15 Thread Matt Madison
which is introducing task hash changes for some
allarch package builds, and should no longer
be needed with recent versions of qemu.

Signed-off-by: Matt Madison 
---
 meta/classes/qemu.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/qemu.bbclass b/meta/classes/qemu.bbclass
index 01a7b86ae1..333202b7c4 100644
--- a/meta/classes/qemu.bbclass
+++ b/meta/classes/qemu.bbclass
@@ -54,7 +54,7 @@ def qemu_run_binary(data, rootfs_path, binary):
 # this dance). For others (e.g. arm) a -cpu option is not necessary, since the
 # qemu-arm default CPU supports all required architecture levels.
 
-QEMU_OPTIONS = "-r ${OLDEST_KERNEL} ${@d.getVar("QEMU_EXTRAOPTIONS_%s" % 
d.getVar('PACKAGE_ARCH')) or ""}"
+QEMU_OPTIONS = "${@d.getVar("QEMU_EXTRAOPTIONS_%s" % d.getVar('PACKAGE_ARCH')) 
or ""}"
 QEMU_OPTIONS[vardeps] += "QEMU_EXTRAOPTIONS_${PACKAGE_ARCH}"
 
 QEMU_EXTRAOPTIONS_ppce500v2 = " -cpu e500v2"
-- 
2.32.0


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#159740): 
https://lists.openembedded.org/g/openembedded-core/message/159740
Mute This Topic: https://lists.openembedded.org/mt/87752526/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] cargo fetcher, SRCPV, and setscene issues

2021-12-15 Thread Matt Madison
I'm finding that none of the Rust recipes are getting setscened in my builds off
master due to the the SRCPV hack that was added to make the cargo fetcher
visible during parsing. There's no error reported about it, but by adding an
exception handler into the sstate code I tracked it down to pstaging_fetch()'s
using d.getVar('SRCPV').  Since the cargo fetcher doesn't advertise
srcrev support,
the base fetcher class raises an exception on this, causing the
mostly-silent failure.

There's no issue if the sstate package is already in the local cache;
it only affects
builds where I need to fetch from my sstate mirror.

I'd submit a patch, but I'm not sure what the right solution would be.

Regards,
-Matt

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#159725): 
https://lists.openembedded.org/g/openembedded-core/message/159725
Mute This Topic: https://lists.openembedded.org/mt/87744591/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH 03/26] meson: configure and use generic exe_wrapper

2021-12-15 Thread Matt Madison
On Fri, Dec 3, 2021 at 11:13 PM Alexander Kanavin 
wrote:

> This replaces the specific gtkdoc wrapper setting
> (which was rejected by upstream in
> https://github.com/mesonbuild/meson/pull/9627)
> with a generic, officially supported and documented exe_wrapper,
> which is enabled subject to qemu usermode support
> (just as is done for g-i and gtk-doc with autotools).
>
> gtk-doc support is adjusted so that this wrapper is passed to
> meson's gtk-doc module, which passes it to gtk-doc.
>
> The adjusted patch is re-submitted upstream.
>
> The side effect of this is that meson is now able to run
> target binaries in a generic way when it wants to, so this
> may affect cross-builds - hopefully in a positive way.
>

Inheriting the qemu class unconditionally causes task hash changes for
allarch recipes
that use meson (e.g. cantarell-fonts) when MACHINE is changed from, say, an
x86 architecture
to an aarch64 architecture, due to the qemu bbclass referencing the
OLDEST_KERNEL
variable.

I'm not sure of the best way to fix this; doing an overwrite of
OLDEST_KERNEL in
allarch.bbclass as is done for some other variables might be OK? I'm not
sure it
makes sense for allarch recipes to reference any QEMU stuff at all, so
maybe splitting
all of the exe_wrapper support into a separate bbclass that is only
inherited when
EXEWRAPPER_ENABLED is True is better?

Thanks,
-Matt


>
> Signed-off-by: Alexander Kanavin 
> ---
>  meta/classes/meson.bbclass| 30 +--
>  ...sues-that-arise-when-cross-compiling.patch | 27 +++--
>  2 files changed, 46 insertions(+), 11 deletions(-)
>
> diff --git a/meta/classes/meson.bbclass b/meta/classes/meson.bbclass
> index a7981e481f..ffec5f3269 100644
> --- a/meta/classes/meson.bbclass
> +++ b/meta/classes/meson.bbclass
> @@ -1,7 +1,12 @@
> -inherit python3native meson-routines
> +inherit python3native meson-routines qemu
>
>  DEPENDS:append = " meson-native ninja-native"
>
> +EXEWRAPPER_ENABLED:class-native = "False"
> +EXEWRAPPER_ENABLED:class-nativesdk = "False"
> +EXEWRAPPER_ENABLED ?= "${@bb.utils.contains('MACHINE_FEATURES',
> 'qemu-usermode', 'True', 'False', d)}"
> +DEPENDS:append = "${@' qemu-native' if d.getVar('EXEWRAPPER_ENABLED') ==
> 'True' else ''}"
> +
>  # As Meson enforces out-of-tree builds we can just use cleandirs
>  B = "${WORKDIR}/build"
>  do_configure[cleandirs] = "${B}"
> @@ -36,6 +41,9 @@ MESON_CROSS_FILE = ""
>  MESON_CROSS_FILE:class-target = "--cross-file ${WORKDIR}/meson.cross"
>  MESON_CROSS_FILE:class-nativesdk = "--cross-file ${WORKDIR}/meson.cross"
>
> +# Needed to set up qemu wrapper below
> +export STAGING_DIR_HOST
> +
>  def rust_tool(d, target_var):
>  rustc = d.getVar('RUSTC')
>  if not rustc:
> @@ -62,6 +70,7 @@ cups-config = 'cups-config'
>  g-ir-scanner = '${STAGING_BINDIR}/g-ir-scanner-wrapper'
>  g-ir-compiler = '${STAGING_BINDIR}/g-ir-compiler-wrapper'
>  ${@rust_tool(d, "HOST_SYS")}
> +${@"exe_wrapper = '${WORKDIR}/meson-qemuwrapper'" if
> d.getVar('EXEWRAPPER_ENABLED') == 'True' else ""}
>
>  [built-in options]
>  c_args = ${@meson_array('CFLAGS', d)}
> @@ -71,7 +80,6 @@ cpp_link_args = ${@meson_array('LDFLAGS', d)}
>
>  [properties]
>  needs_exe_wrapper = true
> -gtkdoc_exe_wrapper = '${B}/gtkdoc-qemuwrapper'
>
>  [host_machine]
>  system = '${@meson_operating_system('HOST_OS', d)}'
> @@ -106,6 +114,24 @@ cpp_link_args = ${@meson_array('BUILD_LDFLAGS', d)}
>  EOF
>  }
>
> +do_write_config:append:class-target() {
> +# Write out a qemu wrapper that will be used as exe_wrapper so that
> meson
> +# can run target helper binaries through that.
> +qemu_binary="${@qemu_wrapper_cmdline(d, '$STAGING_DIR_HOST',
> ['$STAGING_DIR_HOST/${libdir}','$STAGING_DIR_HOST/${base_libdir}'])}"
> +cat > ${WORKDIR}/meson-qemuwrapper << EOF
> +#!/bin/sh
> +# Use a modules directory which doesn't exist so we don't load random
> things
> +# which may then get deleted (or their dependencies) and potentially
> segfault
> +export GIO_MODULE_DIR=${STAGING_LIBDIR}/gio/modules-dummy
> +
> +# meson sets this wrongly (only to libs in build-dir),
> qemu-wrapper_cmdline() and GIR_EXTRA_LIBS_PATH take care of it properly
> +unset LD_LIBRARY_PATH
> +
> +$qemu_binary "\$@"
> +EOF
> +chmod +x ${WORKDIR}/meson-qemuwrapper
> +}
> +
>  # Tell externalsrc that changes to this file require a reconfigure
>  CONFIGURE_FILES = "meson.build"
>
> diff --git
> a/meta/recipes-devtools/meson/meson/0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch
> b/meta/recipes-devtools/meson/meson/0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch
> index ab4d5969d9..b098c4a123 100644
> ---
> a/meta/recipes-devtools/meson/meson/0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch
> +++
> b/meta/recipes-devtools/meson/meson/0001-gtkdoc-fix-issues-that-arise-when-cross-compiling.patch
> @@ -1,29 +1,38 @@
> -From 2f9c59e0489e569c5382404667c10f5c200a72ad Mon Sep 17 00:00:00 2001
> +From 

[OE-core] [PATCH 1/1] autotools.bbclass: use ordinary append for file-checksums update

2021-09-25 Thread Matt Madison
Commit 29daffc2410f06f36b779d5bf1fd1ef6e900ca8f added an
anonymous python function to append the site file dependencies
for do_configure. This causes any recipe that inherits allarch
after autotools to end up with a different set of file checksums
for each machine, since the anonymous python would get processed
before the TARGET_ARCH changes in allarch.

Use an ordinary += assignment to fix this.

Signed-off-by: Matt Madison 
---
 meta/classes/autotools.bbclass | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/meta/classes/autotools.bbclass b/meta/classes/autotools.bbclass
index bc0c2ea83e..4ab2460990 100644
--- a/meta/classes/autotools.bbclass
+++ b/meta/classes/autotools.bbclass
@@ -149,10 +149,7 @@ python autotools_aclocals () {
 d.setVar("CONFIG_SITE", " ".join(sitefiles))
 }
 
-python () {
-sitefiles, searched = siteinfo_get_files(d, sysrootcache=False)
-d.appendVarFlag("do_configure", "file-checksums", " " + " ".join(searched))
-}
+do_configure[file-checksums] += "${@' '.join(siteinfo_get_files(d, 
sysrootcache=False)[1])}"
 
 CONFIGURE_FILES = "${S}/configure.in ${S}/configure.ac ${S}/config.h.in 
${S}/acinclude.m4 Makefile.am"
 
-- 
2.30.2


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#156347): 
https://lists.openembedded.org/g/openembedded-core/message/156347
Mute This Topic: https://lists.openembedded.org/mt/85858276/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH 0/1] autotools.bbclass: use ordinary append for file-checksums update

2021-09-25 Thread Matt Madison
After the recent site files dependency changes, my automated yocto-check-layer
runs started failing the test_machine_signatures check with a bunch of
allarch recipes unexpectedly getting different signatures:

AssertionError: The machines have conflicting signatures for some shared tasks:
   allarch autoconf-archive:do_configure: 
21d06fd9f0dd31138c6c31913d7960850c2cf0b5907abbcd429c4dd1d0a9ee61 
(jetson-tx2-devkit) != 
b36889a1bb652c06672a6586443ae344af48d9eb1c20b4ec0b13a0447126e6ac (qemux86)
   allarch cantarell-fonts:do_configure: 
724242c45694e894841f68bcd51bef4938672ebff2feaa1d32e28225aaf464dd 
(jetson-tx2-devkit) != 
d8c5180facd27e338ff681b92b4d210ced91b8aaa813def22d7736d4539b16cc (qemux86)
   allarch encodings:do_configure: 
7948ef565be1538ab0f65a455ad51447cd221e298543188781e74011be2c8720 
(jetson-tx2-devkit) != 
2a88d5544e64906afb4c0ee41c0cf0a579618218dbea79d4e6b749e279d95f22 (qemux86)
   allarch font-alias:do_configure: 
7fcd9e484e364ec480557c72436b91cbff77b2f9b43696f0a2e3e85b7e5738e2 
(jetson-tx2-devkit) != 
4067157233d63873d706aa1c11406300889f2ba980ac033db1eb8cbca643942d (qemux86)
   allarch xcursor-transparent-theme:do_configure: 
eb46377c6b4d62a61f89cb993e78dcd67b356794fadcc38a8251cb299396ed59 
(jetson-tx2-devkit) != 
2caf4c7817e7c1770229b9970b9554efad133f4131c994196de5d61405aff63a (qemux86)
   allarch xorg-minimal-fonts:do_package_write_rpm: 
a8b8d86a7c315fda9e44fcbc6a00d150f9b9a8617f43279a1bcec08a1debb941 
(jetson-tx2-devkit) != 
dc2ecf9029a051f391760e3317c8fc538d8640f2145af4dd1740db5a227b571a (qemux86)

Switching to a regular assignment, instead of using anonymous python, looks 
like the
right solution.

Matt Madison (1):
  autotools.bbclass: use ordinary append for file-checksums update

 meta/classes/autotools.bbclass | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

-- 
2.30.2


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#156346): 
https://lists.openembedded.org/g/openembedded-core/message/156346
Mute This Topic: https://lists.openembedded.org/mt/85858274/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH] libxcb: use PN for naming dynamic packages

2021-04-03 Thread Matt Madison
so an explicit runtime dependency on one of the library
packages doesn't generate a message about libxcb and
libxcb-native both being providers.

Signed-off-by: Matt Madison 
---
 meta/recipes-graphics/xorg-lib/libxcb_1.14.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-graphics/xorg-lib/libxcb_1.14.bb 
b/meta/recipes-graphics/xorg-lib/libxcb_1.14.bb
index e9f6051b6e..f0a223a19c 100644
--- a/meta/recipes-graphics/xorg-lib/libxcb_1.14.bb
+++ b/meta/recipes-graphics/xorg-lib/libxcb_1.14.bb
@@ -19,7 +19,7 @@ BBCLASSEXTEND = "native nativesdk"
 
 DEPENDS = "xcb-proto xorgproto libxau libpthread-stubs libxdmcp"
 
-PACKAGES_DYNAMIC = "^libxcb-.*"
+PACKAGES_DYNAMIC = "^${PN}-.*"
 
 FILES_${PN} = "${libdir}/libxcb.so.*"
 
@@ -35,5 +35,5 @@ do_install_append () {
 }
 
 python populate_packages_prepend () {
-do_split_packages(d, '${libdir}', r'^libxcb-(.*)\.so\..*$', 'libxcb-%s', 
'XCB library module for %s', allow_links=True)
+do_split_packages(d, '${libdir}', r'^libxcb-(.*)\.so\..*$', '${PN}-%s', 
'XCB library module for %s', allow_links=True)
 }
-- 
2.27.0


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#150193): 
https://lists.openembedded.org/g/openembedded-core/message/150193
Mute This Topic: https://lists.openembedded.org/mt/81828053/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] sstate mirroring between different host OSes requires pre-building pseudo-native

2021-03-14 Thread Matt Madison
I run my CI autobuilders on Ubuntu 20.04 servers, which generate sstate that I 
mirror out to my development machine, which runs Ubuntu 20.10. That used to 
work fine - everything would setscene in as expected. For some time now, 
though, I see just about everything setscene in, and then everything also gets 
rebuilt from scratch again.  I'm not sure if this dates back to November when 
the change to de-universalize pseudo-native happened, or with some more recent 
pseudo-related changes, as I only had time to investigate it this week.

If I bitbake pseudo-native first so it's at least in my local sstate-cache, 
then everything works as expected again. It's only if pseudo has to be built 
from scratch that I get the rebuild cascade. I thought this might be due to my 
distro setup, but it's easily reproducible with a stock poky setup.

Is this the expected behavior now?

Thanks,
-Matt

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#149424): 
https://lists.openembedded.org/g/openembedded-core/message/149424
Mute This Topic: https://lists.openembedded.org/mt/81323981/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH] opkg: Fix patch glitches

2021-02-09 Thread Matt Madison
On Tue, Feb 9, 2021 at 6:34 AM Richard Purdie <
richard.pur...@linuxfoundation.org> wrote:

> The original patch contained some text which shouldn't have been there
> and used brackets in configure which isn't a great idea. Tweak the patch
> to resolve this.
>
> Signed-off-by: Richard Purdie 
> ---
>  meta/recipes-devtools/opkg/opkg/sourcedateepoch.patch | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/meta/recipes-devtools/opkg/opkg/sourcedateepoch.patch
> b/meta/recipes-devtools/opkg/opkg/sourcedateepoch.patch
> index 285d258c635..6d0b1486ad3 100644
> --- a/meta/recipes-devtools/opkg/opkg/sourcedateepoch.patch
> +++ b/meta/recipes-devtools/opkg/opkg/sourcedateepoch.patch
> @@ -9,13 +9,12 @@ Index: opkg-0.4.4/configure.ac
>  ===
>  --- opkg-0.4.4.orig/configure.ac
>  +++ opkg-0.4.4/configure.ac
> -@@ -281,7 +281,12 @@ AC_FUNC_UTIME_NULL
> +@@ -281,7 +281,11 @@ AC_FUNC_UTIME_NULL
>   AC_FUNC_VPRINTF
>   AC_CHECK_FUNCS([memmove memset mkdir regcomp strchr strcspn strdup
> strerror strndup strrchr strstr strtol strtoul sysinfo utime])
>
>  -CLEAN_DATE=`date +"%B %Y" | tr -d '\n'`
> -+1607446883
> -+if [ ! -z "$SOURCE_DATE_EPOCH" ]; then
> ++if ! -z "$SOURCE_DATE_EPOCH" ; then
>

This doesn't look like valid shell syntax - there should be a 'test'
command before the '!', right?
Or change the whole thing to use AS_IF.

-Matt

 +CLEAN_DATE=`LC_ALL=C date -d @$SOURCE_DATE_EPOCH +"%B %Y" | tr -d
> '\n'`
>  +else
>  +CLEAN_DATE=`date +"%B %Y" | tr -d '\n'`
> --
> 2.27.0
>
>
> 
>
>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#147861): 
https://lists.openembedded.org/g/openembedded-core/message/147861
Mute This Topic: https://lists.openembedded.org/mt/80505499/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH] layer.conf: fix syntax error in PATH setting

2020-11-12 Thread Matt Madison
Commit 05a87be51b44608ce4f77ac332df90a3cd2445ef introduced
a Python conditional expression when updating PATH that
generates syntax warnings in bitbake-cookerdaemon.log:

  Var :1: SyntaxWarning: "is not" with a literal. Did you mean "!="?

Fix this by using the more appropriate '!=' comparison
operator.

Signed-off-by: Matt Madison 
---
 meta/conf/layer.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/conf/layer.conf b/meta/conf/layer.conf
index 2d9cd05695..cda37c33b4 100644
--- a/meta/conf/layer.conf
+++ b/meta/conf/layer.conf
@@ -104,4 +104,4 @@ SSTATE_EXCLUDEDEPS_SYSROOT += ".*->autoconf-archive-native"
 # We need to keep bitbake tools in PATH
 # Avoid empty path entries
 BITBAKEPATH := 
"${@os.path.dirname(bb.utils.which(d.getVar('PATH'),'bitbake'))}"
-PATH := "${@'${BITBAKEPATH}:' if '${BITBAKEPATH}' is not '' else 
''}${HOSTTOOLS_DIR}"
+PATH := "${@'${BITBAKEPATH}:' if '${BITBAKEPATH}' != '' else 
''}${HOSTTOOLS_DIR}"
-- 
2.25.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#144512): 
https://lists.openembedded.org/g/openembedded-core/message/144512
Mute This Topic: https://lists.openembedded.org/mt/78207716/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH] image.bbclass: fix REPRODUCIBLE_TIMESTAMP_ROOTFS reference

2020-09-07 Thread Matt Madison
Commit 97b439469a45a089431ca9c31893288c855045f4 added a fallback
mechanism for getting the rootfs timestamp. However, it uses curly
braces around the variable name, which causes bitbake resolve the
variable reference, rather than the shell, so the git timestamp
never gets used. Fix the reference to restore the intent of
making it a fallback for when there is no git timestamp to
retrieve.

Signed-off-by: Matt Madison 
---
 meta/classes/image.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 3b5600e550..730c843c18 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -651,7 +651,7 @@ reproducible_final_image_task () {
 if [ "${BUILD_REPRODUCIBLE_BINARIES}" = "1" ]; then
 if [ "$REPRODUCIBLE_TIMESTAMP_ROOTFS" = "" ]; then
 REPRODUCIBLE_TIMESTAMP_ROOTFS=`git -C "${COREBASE}" log -1 
--pretty=%ct 2>/dev/null` || true
-if [ "${REPRODUCIBLE_TIMESTAMP_ROOTFS}" = "" ]; then
+if [ "$REPRODUCIBLE_TIMESTAMP_ROOTFS" = "" ]; then
 REPRODUCIBLE_TIMESTAMP_ROOTFS=`stat -c%Y 
${@bb.utils.which(d.getVar("BBPATH"), "conf/bitbake.conf")}`
 fi
 fi
-- 
2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#142200): 
https://lists.openembedded.org/g/openembedded-core/message/142200
Mute This Topic: https://lists.openembedded.org/mt/76685919/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[OE-core] [PATCH] cogl-1.0: correct X11 dependencies

2020-07-28 Thread Matt Madison
cogl depends on libxdamage when configured for X11 support.
A dependency was added for this in 2012 with
959a2f6d88d8fa6874fff83b7a1f0e7d4e36b887, but that addition
was lost when the recipe was reworked in 2013 with
b508fdd2b19ca30da8d09caf646897dc4cf195c8. That commit also
added a dependency on libxi, which is not actually needed.

The missing dependency doesn't cause problems in most cases,
since mesa also depends on libxdamage, but when an alternative
opengl implementation such as libglvnd is used, cogl fails
to configure.

Signed-off-by: Matt Madison 
---
 meta/recipes-graphics/cogl/cogl-1.0.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-graphics/cogl/cogl-1.0.inc 
b/meta/recipes-graphics/cogl/cogl-1.0.inc
index 1c5d0b79cb..d581ad1c04 100644
--- a/meta/recipes-graphics/cogl/cogl-1.0.inc
+++ b/meta/recipes-graphics/cogl/cogl-1.0.inc
@@ -21,7 +21,7 @@ EDEPENDS_GL = "virtual/libgl libdrm"
 EDEPENDS_GLES2 = "virtual/libgles2"
 EDEPENDS_KMS = "libdrm virtual/egl"
 EDEPENDS_EGL = "virtual/egl"
-EDEPENDS_X11 = "virtual/libx11 libxcomposite libxfixes libxi libxrandr"
+EDEPENDS_X11 = "virtual/libx11 libxcomposite libxdamage libxfixes libxrandr"
 EDEPENDS_WAYLAND = "virtual/egl virtual/libgles2 wayland"
 
 # Extra RDEPENDS for PACKAGECONFIG
-- 
2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#141059): 
https://lists.openembedded.org/g/openembedded-core/message/141059
Mute This Topic: https://lists.openembedded.org/mt/75842265/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[OE-core] [PATCH] kernel.bbclass: add gzip-native to do_deploy dependencies

2020-07-05 Thread Matt Madison
When a modules tarball is created during kernel_do_deploy,
the tarball is compressed using gzip, but gzip-native is not
a dependency so the build host's gzip is being used for this.

Using gzip-native will, by default, use pigz instead of
single-threaded gzip, making this task less of a bottleneck
for builds with a large modules package.

Signed-off-by: Matt Madison 
---
 meta/classes/kernel.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 301e3b86b2..aef5e97892 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -7,7 +7,7 @@ PROVIDES += "${@ "virtual/kernel" if 
(d.getVar("KERNEL_PACKAGE_NAME") == "kernel
 DEPENDS += "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}gcc 
kmod-native bc-native lzop-native bison-native"
 PACKAGE_WRITE_DEPS += "depmodwrapper-cross"
 
-do_deploy[depends] += "depmodwrapper-cross:do_populate_sysroot"
+do_deploy[depends] += "depmodwrapper-cross:do_populate_sysroot 
gzip-native:do_populate_sysroot"
 do_clean[depends] += "make-mod-scripts:do_clean"
 
 CVE_PRODUCT ?= "linux_kernel"
-- 
2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#140307): 
https://lists.openembedded.org/g/openembedded-core/message/140307
Mute This Topic: https://lists.openembedded.org/mt/75313455/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [OE-core] [PATCH] go/go-runtime: use update-alternative for zdefaultcc.go

2019-08-08 Thread Matt Madison
On Wed, Aug 7, 2019 at 10:36 PM Changqing Li  wrote:
>
>
> On 8/7/19 10:16 PM, Richard Purdie wrote:
> > On Wed, 2019-08-07 at 10:35 +0800, Changqing Li wrote:
> >> On 8/6/19 6:47 PM, Richard Purdie wrote:
> >>> On Tue, 2019-08-06 at 14:54 +0800, changqing...@windriver.com
> >>> wrote:
>  From: Changqing Li 
> 
>  fix below error:
>  file /usr/lib64/go/src/cmd/cgo/zdefaultcc.go conflicts between
>  attempted installs of go-dev-1.12.6-r0.core2_64 and go-runtime-
>  dev-
>  1.12.6-r0.core2_64
>  file /usr/lib64/go/src/cmd/go/internal/cfg/zdefaultcc.go
>  conflicts
>  between attempted installs of go-dev-1.12.6-r0.core2_64 and go-
>  runtime-dev-1.12.6-r0.core2_64
> 
>  Signed-off-by: Changqing Li 
>  ---
> meta/recipes-devtools/go/go-runtime_1.12.bb | 6 ++
> meta/recipes-devtools/go/go_1.12.bb | 7 +++
> 2 files changed, 13 insertions(+)
> >>> It seems odd that both of these packages should provide this,
> >>> perhaps
> >>> one version should just be deleted?
> >>>
> >>> Cheers,
> >>>
> >>> Richard
> >> These 2 recipes don't have any DEPEND or RDEPEND relationship, so
> >> they
> >> are independent from the point of recipe.
> >>
> >> Make one of dev packages empty seems not proper ?
> > Let me put this another way. What is the difference between these two
> > binaries? When should you use one, when should you use the other? Or
> > are they the same thing?
> >
> > Cheers,
> >
> > Richard
>
> go is for building go compiler,  and go-runtime only contains go
> standard  runtime library
>
> There are 2 use caes:
>
> 1.  on target, user only install go-runtime to provide libstd.so for
> other go apps.
>
> 2.  on target, user install both go and go-runtime
>
> in my opinion,  only in case2,  install dev pkg is meaningful, so maybe
> we can remove the conflict
>
> part of files from go-runtime.
>
>
> @Matt,  you have do lots of work related these recipes, could you also
> give your opinion? Thanks.

Well, those 'z'-prefixed files are ones that are generated during the
build of go to embed default flags for the 'go' and 'cgo' commands to
use when they have to call on the C compiler.  They also happen to be
generated during the build of go-runtime because go normally doesn't
separate its toolchain and runtime builds, whereas we have to for the
cross build case. So filtering those files out of the go-runtime-dev
package and leaving them in the go-dev package would probably be OK.
It's something of an artificial distinction, though.

Regards,
-Matt

>
> >
> >
> >
> --
> BRs
>
> Sandy(Li Changqing)
>
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] go.bbclass: remove ptest inherit

2019-07-04 Thread Matt Madison
On Wed, Jul 3, 2019 at 2:25 AM  wrote:
>
> From: Mingli Yu 
>
> Remove the ptest bbclass inherit logic to let
> each recipe inherit ptest individually if the
> specified recipe wants to support ptest to avoid
> the recipe which inherits go bblcass inheriting
> ptest automatically.

Recipes will have to inherit ptest before inheriting go, which seems
counter-intuitive; with ptest after go, the compile_ptest and
install_ptest functions will be the null ones from ptest.bbclass.
Ross's suggestion of breaking out the ptest-related functions from
go.bbclass into a separate bbclass would be better.  Perhaps called
ptest-go.bbclass, similar to the ones already there for gnome and
perl.

Thanks,
-Matt

> Signed-off-by: Mingli Yu 
> ---
>  meta/classes/go.bbclass | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass
> index e05a5c641c..424d869540 100644
> --- a/meta/classes/go.bbclass
> +++ b/meta/classes/go.bbclass
> @@ -1,4 +1,4 @@
> -inherit goarch ptest
> +inherit goarch
>
>  GO_PARALLEL_BUILD ?= "${@oe.utils.parallel_make_argument(d, '-p %d')}"
>
> --
> 2.21.0
>
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] go-dep: disable PTEST_ENABLED

2019-07-01 Thread Matt Madison
On Sun, Jun 30, 2019 at 6:59 PM Yu, Mingli  wrote:
>
>
>
> On 2019年06月28日 19:02, Richard Purdie wrote:
> > On Fri, 2019-06-28 at 00:57 -0700, mingli...@windriver.com wrote:
> >> From: Mingli Yu 
> >>
> >> The run-ptest logic for go-dep actually runs the
> >> /usr/lib64/go-dep/ptest/github.com/golang/dep/cmd/dep/dep.test whose
> >> source file is
> >> https://github.com/golang/dep/blob/master/cmd/dep/dep_test.go.
> >>
> >> That dep_test.go starts by rebuilding the dep program
> >> from source, then runs the tests using that copy of the
> >> program, so it's assuming that we're still in a development
> >> environment where we can run a full go build.
> >>
> >> Considering it not being designed for a cross-build setup,
> >> so disable PTEST_ENABLED.
> >>
> >> Signed-off-by: Mingli Yu 
> >> ---
> >>   meta/recipes-devtools/go/go-dep_0.5.0.bb | 5 +++--
> >>   1 file changed, 3 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/meta/recipes-devtools/go/go-dep_0.5.0.bb b/meta/recipes-
> >> devtools/go/go-dep_0.5.0.bb
> >> index a4d631f8ea..e9fc12fa5a 100644
> >> --- a/meta/recipes-devtools/go/go-dep_0.5.0.bb
> >> +++ b/meta/recipes-devtools/go/go-dep_0.5.0.bb
> >> @@ -21,5 +21,6 @@ BBCLASSEXTEND = "native nativesdk"
> >>
> >>   # For compiling ptest on mips and mips64, the current go-dep version
> >> fails with the go 1.11 toolchain.
> >>   # error message: vet config not found
> >> -PTEST_ENABLED_mips = "0"
> >> -PTEST_ENABLED_mips64 = "0"
> >> +# disable PTEST_ENABLED as the run-ptest script for go-dep actually
> >> runs the /usr/lib64/go-
> >> dep/ptest/github.com/golang/dep/cmd/dep/dep.test whose source file is
> >> https://github.com/golang/dep/blob/master/cmd/dep/dep_test.go not
> >> being designed for a cross-build setup.
> >> +PTEST_ENABLED = "0"
> >> +PTEST_ENABLED = "0"
> >
> > Setting it twice looks wrong.
>
> Sorry, it should be my typo.
>
> >
> > If we're disabling it, why would we inherit the ptest class at all as
> > its not going to work anywhere?
> >
> > Upstream not considering cross test usecases isn't a reason to disable
> > a test, we have many tests enabled where upstream haven't considered a
> > cross use case, we just tend to patch as needed and start a discussion
> > with them.
> >
> > It sounds like its actually a network access problem from the image
> > you're running into anyway?
>
> Hi RP,
>
> Have discussed the ptest more with Matt in the maillist and also tried
> to add the patch under the guide from Matt to make the
> https://github.com/golang/dep/blob/master/cmd/dep/dep_test.go work with
> cross-setup env. But seems it still doesn't work.
>
> Hi Matt,
> What's your opinion?

I was able to get the test to work in my setup, with the addition of
that patch and manually setting GOCACHE in my environment. As Richard
mentioned, from the failures you were getting, it looked like a
network access issue in your setup. I'm not sure why GOCACHE needs to
be set, when 'go env' shows the correct (non-'off') default; that
might be another issue in dep that needs to be addressed.

It would be good to have at least one non-trivial ptest for a go
package, and since OE-Core doesn't have much beyond the toolchain
itself, go-dep, and glide, getting this to work would provide some
much-needed coverage. Running go-dep or glide - both build tools - on
a target seems like a fairly rare use case, though.

As for Richard's initial question, go.bbclass inherits ptest to enable
the mapping of go's built-in test builds automatically. In hindsight,
maybe this wasn't the best choice, and it was overly optimistic to
think that because go supports separate compilation and execution of
tests, that packages would generally support that by default.

-Matt

> Thanks,
>
> >
> > Cheers,
> >
> > Richard
> >
> >
> >
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH v5 06/13] go.bbclass: ptest cleanup and improvements

2019-06-27 Thread Matt Madison
On Wed, Jun 26, 2019 at 11:40 PM Yu, Mingli  wrote:
>
>
>
> On 2019年06月26日 22:00, Matt Madison wrote:
> > On Wed, Jun 26, 2019 at 2:02 AM Yu, Mingli  wrote:
> >>
> >>
> >>
> >> On 2019年06月25日 20:23, Matt Madison wrote:
> >>> On Fri, Jun 21, 2019 at 2:08 AM Yu, Mingli  
> >>> wrote:
> >>>>
> >>>> Hi Matt,
> >>>>
> >>>> I noticed your commit is the latest update for go-dep ptest. But the
> >>>> go-dep ptest doesn't work in my environment. I'm trying to figure out
> >>>> what's wrong is here though I didn't know much about go.
> >>>
> >>> I went back over the commits, and I don't think I did anything with
> >>> go-dep specifically. I can see that the tests are failing for it, and
> >>> it looks like it's because go-dep's test programs make some
> >>> assumptions about the environment.  For one thing, it needs the go
> >>> compiler installed. It also looks like it's expecting some source
> >>> files to be present... in other words, it's not really designed for a
> >>> cross-build setup, with tests run on the cross-built target. It could
> >>> be messy to work around that, and I'm not sure how useful it would be
> >>> anyway, seeing as how go-dep is more of a build tool.  Might be better
> >>> to just disable ptests for it completely.
> >>
> >> Many thanks Matt for your information!
> >> Did you ever run go-dep ptest?
> >> Go through the run-ptest script for go-dep, it actually runs the
> >> /usr/lib64/go-dep/ptest/github.com/golang/dep/cmd/dep/dep.test whose
> >> source file is
> >> https://github.com/golang/dep/blob/master/cmd/dep/dep_test.go.
> >
> > Yes, I see that.  That main program starts by rebuilding the dep
> > program from source, then runs the tests using that copy of the
> > program, so it's assuming that you're still in a development
> > environment where you can run a full go build.  That's what I meant by
> > it not being designed for a cross-build setup.
> >
> > I've patched the test program to create a symlink to the installed dep
> > program instead of rebuilding, and got further.  You'll need to
> > include 'go', 'git', and 'git-perltools' in the image to get the tests
> > to run. Some of the test cases failed until I set GOCACHE in the
> > environment to point to a valid path; I'm not sure why.  The tests
> > took a long time to run on my qemux86 build, though - at least 30
> > minutes.
>
> Thanks very much for Matt's guide!
>
> I have applied the patch you provide to create a symlink to the
> installed dep program instead of rebuilding and also add go', 'git', and
> 'git-perltools' into the image, but there is no PASS case, all failed as
> attached go-dep_ptest.log.

The device under test needs Internet access to fetch repos from
Github. From the log, it looks like perhaps yours didn't?

>
> BTW, you said you set GOCACHE, what's the valid path do you mean?

Any directory that the user has write access to.  The default is
$HOME/.cache/go-build .

-M

>
> Thanks,
>
> >
> > Here's the patch I applied to use the already-built dep binary.  An
> > alternative approach would be to put everything in place to allow the
> > test program to rebuild the dep binary itself, but that would drive up
> > the time for the test run even further.
> >
> > Regards,
> > -Matt
> >
> > ---
> >   cmd/dep/dep_test.go | 13 +
> >   1 file changed, 9 insertions(+), 4 deletions(-)
> >
> > diff --git a/src/github.com/golang/dep/cmd/dep/dep_test.go
> > b/src/github.com/golang/dep/cmd/dep/dep_test.go
> > index 687eef3a..535ca56d 100644
> > --- a/src/github.com/golang/dep/cmd/dep/dep_test.go
> > +++ b/src/github.com/golang/dep/cmd/dep/dep_test.go
> > @@ -18,13 +18,18 @@ import (
> >   // deletes it after the tests have been run.
> >   // Most of this is taken from
> > https://github.com/golang/go/blob/master/src/cmd/go/go_test.go and
> > reused here.
> >   func TestMain(m *testing.M) {
> > - args := []string{"build", "-o", "testdep" + test.ExeSuffix}
> > - out, err := exec.Command("go", args...).CombinedOutput()
> > + args := []string{"dep"}
> > + out, err := exec.Command("which", args...).CombinedOutput()
> >if err != nil {
> > - fmt.Fprintf(os.Stderr, "building testdep failed: %v\n%s", err, out)
> > + fmt.Fprintf(os.Stderr, "finding dep failed: %v\n%s", err, out)
> > + os.Exit(2)
> > + }
> > + args = []string{"-s", string(out[:len(out)-1]), "testdep" + 
> > test.ExeSuffix}
> > + out, err = exec.Command("ln", args...).CombinedOutput()
> > + if err != nil {
> > + fmt.Fprintf(os.Stderr, "symlinking dep failed: %v\n%s", err, out)
> >os.Exit(2)
> >}
> > -
> >// Don't let these environment variables confuse the test.
> >os.Unsetenv("GOPATH")
> >os.Unsetenv("GIT_ALLOW_PROTOCOL")
> >
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH v5 06/13] go.bbclass: ptest cleanup and improvements

2019-06-26 Thread Matt Madison
On Wed, Jun 26, 2019 at 2:02 AM Yu, Mingli  wrote:
>
>
>
> On 2019年06月25日 20:23, Matt Madison wrote:
> > On Fri, Jun 21, 2019 at 2:08 AM Yu, Mingli  wrote:
> >>
> >> Hi Matt,
> >>
> >> I noticed your commit is the latest update for go-dep ptest. But the
> >> go-dep ptest doesn't work in my environment. I'm trying to figure out
> >> what's wrong is here though I didn't know much about go.
> >
> > I went back over the commits, and I don't think I did anything with
> > go-dep specifically. I can see that the tests are failing for it, and
> > it looks like it's because go-dep's test programs make some
> > assumptions about the environment.  For one thing, it needs the go
> > compiler installed. It also looks like it's expecting some source
> > files to be present... in other words, it's not really designed for a
> > cross-build setup, with tests run on the cross-built target. It could
> > be messy to work around that, and I'm not sure how useful it would be
> > anyway, seeing as how go-dep is more of a build tool.  Might be better
> > to just disable ptests for it completely.
>
> Many thanks Matt for your information!
> Did you ever run go-dep ptest?
> Go through the run-ptest script for go-dep, it actually runs the
> /usr/lib64/go-dep/ptest/github.com/golang/dep/cmd/dep/dep.test whose
> source file is
> https://github.com/golang/dep/blob/master/cmd/dep/dep_test.go.

Yes, I see that.  That main program starts by rebuilding the dep
program from source, then runs the tests using that copy of the
program, so it's assuming that you're still in a development
environment where you can run a full go build.  That's what I meant by
it not being designed for a cross-build setup.

I've patched the test program to create a symlink to the installed dep
program instead of rebuilding, and got further.  You'll need to
include 'go', 'git', and 'git-perltools' in the image to get the tests
to run. Some of the test cases failed until I set GOCACHE in the
environment to point to a valid path; I'm not sure why.  The tests
took a long time to run on my qemux86 build, though - at least 30
minutes.

Here's the patch I applied to use the already-built dep binary.  An
alternative approach would be to put everything in place to allow the
test program to rebuild the dep binary itself, but that would drive up
the time for the test run even further.

Regards,
-Matt

---
 cmd/dep/dep_test.go | 13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/github.com/golang/dep/cmd/dep/dep_test.go
b/src/github.com/golang/dep/cmd/dep/dep_test.go
index 687eef3a..535ca56d 100644
--- a/src/github.com/golang/dep/cmd/dep/dep_test.go
+++ b/src/github.com/golang/dep/cmd/dep/dep_test.go
@@ -18,13 +18,18 @@ import (
 // deletes it after the tests have been run.
 // Most of this is taken from
https://github.com/golang/go/blob/master/src/cmd/go/go_test.go and
reused here.
 func TestMain(m *testing.M) {
- args := []string{"build", "-o", "testdep" + test.ExeSuffix}
- out, err := exec.Command("go", args...).CombinedOutput()
+ args := []string{"dep"}
+ out, err := exec.Command("which", args...).CombinedOutput()
  if err != nil {
- fmt.Fprintf(os.Stderr, "building testdep failed: %v\n%s", err, out)
+ fmt.Fprintf(os.Stderr, "finding dep failed: %v\n%s", err, out)
+ os.Exit(2)
+ }
+ args = []string{"-s", string(out[:len(out)-1]), "testdep" + test.ExeSuffix}
+ out, err = exec.Command("ln", args...).CombinedOutput()
+ if err != nil {
+ fmt.Fprintf(os.Stderr, "symlinking dep failed: %v\n%s", err, out)
  os.Exit(2)
  }
-
  // Don't let these environment variables confuse the test.
  os.Unsetenv("GOPATH")
  os.Unsetenv("GIT_ALLOW_PROTOCOL")
-- 
2.20.1


>
> # pwd
> /usr/lib64/go-dep/ptest/github.com/golang/dep/cmd/dep
> # ./dep.test
> building testdep failed: exit status 1
> can't load package: package .: no Go files in
> /usr/lib64/go-dep/ptest/github.com/golang/dep/cmd/dep
>
> Check the logic for
> https://github.com/golang/dep/blob/master/cmd/dep/dep_test.go, it try to
> run "go build -o testdep" at its start. And the go compiler exist on our
> target, but I don't know what go files the dep_test.go expects.
>
> Hi Khem,
>
> Do you have any suggestion?
>
> Thanks,
>
> >
> > BTW, you can have the test programs generate verbose output by setting
> > GOPTESTFLAGS = "-test.v" in the recipe, which will add that flag to
> > their invocation in the wrapper script, or by manually running the
> > test program on the target and passing that flag (cd into the
> > directory where the test program is located, then run it with
> > -test.v).

Re: [OE-core] [PATCH v5 06/13] go.bbclass: ptest cleanup and improvements

2019-06-25 Thread Matt Madison
On Fri, Jun 21, 2019 at 2:08 AM Yu, Mingli  wrote:
>
> Hi Matt,
>
> I noticed your commit is the latest update for go-dep ptest. But the
> go-dep ptest doesn't work in my environment. I'm trying to figure out
> what's wrong is here though I didn't know much about go.

I went back over the commits, and I don't think I did anything with
go-dep specifically. I can see that the tests are failing for it, and
it looks like it's because go-dep's test programs make some
assumptions about the environment.  For one thing, it needs the go
compiler installed. It also looks like it's expecting some source
files to be present... in other words, it's not really designed for a
cross-build setup, with tests run on the cross-built target. It could
be messy to work around that, and I'm not sure how useful it would be
anyway, seeing as how go-dep is more of a build tool.  Might be better
to just disable ptests for it completely.

BTW, you can have the test programs generate verbose output by setting
GOPTESTFLAGS = "-test.v" in the recipe, which will add that flag to
their invocation in the wrapper script, or by manually running the
test program on the target and passing that flag (cd into the
directory where the test program is located, then run it with
-test.v).

Regards,
-Matt

>
> BTW, Could you help to check?
>
> root@qemux86-64:~# cd /usr/lib64/go-dep/ptest/
> root@qemux86-64:/usr/lib64/go-dep/ptest# cat run-ptest
> #!/bin/sh
> RC=0
> run_test() (
>  cd "$1"
>  ./$2 ; echo $? >&3) | sed -r -e"s,^(PASS|SKIP|FAIL)$,\1:
> $1/$2," >&4) 3>&1) | (read rc; exit $rc)) 4>&1
>  exit $?)
> run_test github.com/golang/dep/cmd/dep dep.test || RC=1
> exit $RC
> root@qemux86-64:/usr/lib64/go-dep/ptest# ./run-ptest
> building testdep failed: exit status 1
> can't load package: package .: no Go files in
> /usr/lib64/go-dep/ptest/github.com/golang/dep/cmd/dep
> root@qemux86-64:/usr/lib64/go-dep/ptest#
>
> Thanks,
>
> On 2018年03月05日 05:09, Matt Madison wrote:
> > * Don't enable verbose test output (-test.v)
> >by default, as it generates too much noise
> >for automated results parsing
> >
> > * Override do_install_ptest_base in the bbclass,
> >so recipes can provide their own modifications
> >with do_install_ptest.
> >
> > * Improve the generated run-ptest script to better
> >handle large numbers of tests, and to generate
> >'status: test name' output similar to Automake
> >tests.
> >
> > * Install all non-vendored 'testdata' directories
> >from the source into the ptest package, as some
> >packages share test data among multiple tests.
> >
> > Signed-off-by: Matt Madison 
> > ---
> >   meta/classes/go.bbclass | 87 
> > +
> >   1 file changed, 51 insertions(+), 36 deletions(-)
> >
> > diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass
> > index afd68b5951..a51ba3e9f0 100644
> > --- a/meta/classes/go.bbclass
> > +++ b/meta/classes/go.bbclass
> > @@ -26,7 +26,7 @@ GO_LDFLAGS ?= '-ldflags="${GO_RPATH} ${GO_LINKMODE} 
> > -extldflags '${GO_EXTLDFLAGS
> >   export GOBUILDFLAGS ?= "-v ${GO_LDFLAGS}"
> >   export GOPATH_OMIT_IN_ACTIONID ?= "1"
> >   export GOPTESTBUILDFLAGS ?= "${GOBUILDFLAGS} -c"
> > -export GOPTESTFLAGS ?= "-test.v"
> > +export GOPTESTFLAGS ?= ""
> >   GOBUILDFLAGS_prepend_task-compile = "${GO_PARALLEL_BUILD} "
> >
> >   export GO = "${HOST_PREFIX}go"
> > @@ -76,7 +76,7 @@ go_list_packages() {
> >   }
> >
> >   go_list_package_tests() {
> > -${GO} list -f '{{.ImportPath}} {{.TestGoFiles}}' ${GOBUILDFLAGS} 
> > ${GO_INSTALL} | \
> > + ${GO} list -f '{{.ImportPath}} {{.TestGoFiles}}' ${GOBUILDFLAGS} 
> > ${GO_INSTALL} | \
> >   grep -v '\[\]$' | \
> >   egrep -v '${GO_INSTALL_FILTEROUT}' | \
> >   awk '{ print $1 }'
> > @@ -100,15 +100,16 @@ go_do_compile() {
> >   do_compile[dirs] =+ "${GOTMPDIR}"
> >   do_compile[cleandirs] = "${B}/bin ${B}/pkg"
> >
> > -do_compile_ptest() {
> > +do_compile_ptest_base() {
> >   export TMPDIR="${GOTMPDIR}"
> > -rm -f ${B}/.go_compiled_tests.list
> > + rm -f ${B}/.go_compiled_tests.list
> >   go_list_package_tests | while read pkg; do
> >   cd ${B}/src/$pkg
> >   ${GO} test ${GOPTESTBUILDFLAGS} $pkg
> >   find . -mindepth 1 -maxdepth 1 -type f -name '*.test' -exec 
> > echo $pkg/{

[OE-core] [PATCH] apt: fix permissions on apt-daily script for systemd

2019-06-18 Thread Matt Madison
The script needs to be executable so the service doesn't
fail.

Signed-off-by: Matt Madison 
---
 meta/recipes-devtools/apt/apt-package.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-devtools/apt/apt-package.inc 
b/meta/recipes-devtools/apt/apt-package.inc
index 6a01f99c63..da91451d7f 100644
--- a/meta/recipes-devtools/apt/apt-package.inc
+++ b/meta/recipes-devtools/apt/apt-package.inc
@@ -83,7 +83,7 @@ do_install () {
install -m 0644 include/apt-pkg/*.h ${D}${includedir}/apt-pkg/
 
install -d ${D}${systemd_unitdir}/system/
-   install -m 0644 ${S}/debian/apt.systemd.daily ${D}${libdir}/apt/
+   install -m 0755 ${S}/debian/apt.systemd.daily ${D}${libdir}/apt/
install -m 0644 ${S}/debian/apt-daily.service 
${D}${systemd_unitdir}/system/
sed -i 's#/usr/lib/apt/#${libdir}/apt/#g' 
${D}${systemd_unitdir}/system/apt-daily.service
install -m 0644 ${S}/debian/apt-daily.timer 
${D}${systemd_unitdir}/system/
-- 
2.20.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] uboot-extlinux-config.bbclass: add missing variable dependencies

2019-03-03 Thread Matt Madison
do_create_extlinux_config performs its own override processing
for several variables, so we have to explicitly add the label-
suffixed variable names to its vardeps to make sure that changes
get detected.

Signed-off-by: Matt Madison 
---
 meta/classes/uboot-extlinux-config.bbclass | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/classes/uboot-extlinux-config.bbclass 
b/meta/classes/uboot-extlinux-config.bbclass
index c65c421b60..b5b1a81dfc 100644
--- a/meta/classes/uboot-extlinux-config.bbclass
+++ b/meta/classes/uboot-extlinux-config.bbclass
@@ -148,5 +148,7 @@ python do_create_extlinux_config() {
 except OSError:
 bb.fatal('Unable to open %s' % (cfile))
 }
+UBOOT_EXTLINUX_VARS = "CONSOLE MENU_DESCRIPTION ROOT KERNEL_IMAGE FDTDIR FDT 
KERNEL_ARGS INITRD"
+do_create_extlinux_config[vardeps] += "${@' '.join(['UBOOT_EXTLINUX_%s_%s' % 
(v, l) for v in d.getVar('UBOOT_EXTLINUX_VARS').split() for l in 
d.getVar('UBOOT_EXTLINUX_LABELS').split()])}"
 
 addtask create_extlinux_config before do_install do_deploy after do_compile
-- 
2.19.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] [RFC] go.bbclass: install dependencies under $GOPATH instead of $GOROOT

2018-12-20 Thread Matt Madison
On Thu, Dec 20, 2018 at 6:02 AM Damien Riegel  wrote:
>
> On Thu, 20 Dec 2018 at 07:53, Matt Madison  wrote:
> >
> > On Wed, Dec 19, 2018 at 5:52 PM Damien Riegel  
> > wrote:
> > >
> > > On Wed, 19 Dec 2018 at 16:41, Matt Madison  wrote:
> > > >
> > > > On Wed, Dec 19, 2018 at 9:51 AM Damien Riegel  
> > > > wrote:
> > > > >
> > > > > To package a go application in Yocto, one needs to also package its
> > > > > dependencies to keep the build reproducible and under control. The
> > > > > default install task of the go class puts the source in 
> > > > > ${libdir}/go/src.
> > > > >
> > > > > ${libdir}/go/src is where the standard go packages resides, aka 
> > > > > $GOROOT.
> > > > > When a go package has dependencies on other go packages, they must be
> > > > > located under $GOPATH, otherwise errors like this one may happen:
> > > > >
> > > > >   Non-standard package  in standard package 
> > > > >
> > > > > This point of this patch is to trigger a discussion on how this issue
> > > > > can be tackled in Yocto. Following code is working but should not be
> > > > > considered for inclusion.
> > > >
> > > > Can you describe the context of this a bit more?  The way go.bbclass
> > > > is set up, all of your recipe's dependencies (and their dependencies)
> > > > should already have been installed in the per-recipe sysroot (where
> > > > GOROOT lives for the current recipe's build), and should get resolved
> > > > from there. GOPATH gets set to ${B} for the current recipe's build.
> > > > Nothing in the GOROOT should be importing packages that reside in
> > > > GOPATH, which is what that particular error message is indicating. If
> > > > you're getting that error, then there might be something wrong with
> > > > recipe dependencies.
> > >
> > > Sure. I think the issue is because I have the following chain of
> > > dependencies:
> > >
> > > A --> B --> C
> > >   `-> C
> > >
> > > Building C is fine, building B is fine, but building A triggers the
> > > error I mentioned, because the Go compiler complains about B using a
> > > non-standard package C. It thinks B is a standard package because it's
> > > located in GOROOT.
> >
> > Are the three packages in separate source repositories? If so, the go
> > tool should not be finding any C files in GOPATH.
> >
> > If A and C are part of the same source repository, but B is separate,
> > that would make the situation a bit trickier, but still solvable.
>
> They are three separate repositories. The issue is precisely that C
> files are not in GOPATH but in GOROOT. C files _should be_ in GOPATH or
> that will break Go tools.

Go does allow for non-"standard" packages to be in GOROOT as well.
The way the go tool marks a package as "standard" is if it resides in
GOROOT _and_ starts with a prefix that does not look like a domain
name (specifically, does not contain a dot '.').  The Go convention,
though, is to use a domain name as the first element of the import
path for anything that isn't part of the base runtime (std, cmd).

If you do have a situation where you have multiple interdependent
packages that for some reason have import paths that do not start with
a domain name, you could build them all using a single recipe, rather
than splitting them up into separate recipes.  I've had to do that for
cases where there were circular dependencies between two (or more)
packages; the same technique could work this, though, too.

-Matt

> > > Regarding dependencies, I created recipes named foocorp.com-{A,B,C}.bb
> > > and used DEPENDS_append = " foocorp.com-A" for instance.
> >
> > If A imports from B and C, you should have DEPENDS = "foocorp.com-B
> > foocorp.com-C" in the recipe for A, and
> > DEPENDS = "foocorp.com-C" in the recipe for B.
>
> Okay, that part I got right then!
>
> > > I understand it's convenient to install dependencies in the GOROOT
> > > directory of recipes' sysroot, but we should keep in mind that when one
> > > calls `go get`, dependencies are installed in GOPATH, not GOROOT. I
> > > think that if we want to avoid (a bit obscure) build failures and cover
> > > all use cases, we should try to mimic that behaviour as close as we can.
> >
> > go.bbclass does not use `go get`.  It only uses `go install`.
>
> Sorr

Re: [OE-core] [PATCH] [RFC] go.bbclass: install dependencies under $GOPATH instead of $GOROOT

2018-12-20 Thread Matt Madison
On Wed, Dec 19, 2018 at 5:52 PM Damien Riegel  wrote:
>
> On Wed, 19 Dec 2018 at 16:41, Matt Madison  wrote:
> >
> > On Wed, Dec 19, 2018 at 9:51 AM Damien Riegel  
> > wrote:
> > >
> > > To package a go application in Yocto, one needs to also package its
> > > dependencies to keep the build reproducible and under control. The
> > > default install task of the go class puts the source in ${libdir}/go/src.
> > >
> > > ${libdir}/go/src is where the standard go packages resides, aka $GOROOT.
> > > When a go package has dependencies on other go packages, they must be
> > > located under $GOPATH, otherwise errors like this one may happen:
> > >
> > >   Non-standard package  in standard package 
> > >
> > > This point of this patch is to trigger a discussion on how this issue
> > > can be tackled in Yocto. Following code is working but should not be
> > > considered for inclusion.
> >
> > Can you describe the context of this a bit more?  The way go.bbclass
> > is set up, all of your recipe's dependencies (and their dependencies)
> > should already have been installed in the per-recipe sysroot (where
> > GOROOT lives for the current recipe's build), and should get resolved
> > from there. GOPATH gets set to ${B} for the current recipe's build.
> > Nothing in the GOROOT should be importing packages that reside in
> > GOPATH, which is what that particular error message is indicating. If
> > you're getting that error, then there might be something wrong with
> > recipe dependencies.
>
> Sure. I think the issue is because I have the following chain of
> dependencies:
>
> A --> B --> C
>   `-> C
>
> Building C is fine, building B is fine, but building A triggers the
> error I mentioned, because the Go compiler complains about B using a
> non-standard package C. It thinks B is a standard package because it's
> located in GOROOT.

Are the three packages in separate source repositories? If so, the go
tool should not be finding any C files in GOPATH.

If A and C are part of the same source repository, but B is separate,
that would make the situation a bit trickier, but still solvable.

> Regarding dependencies, I created recipes named foocorp.com-{A,B,C}.bb
> and used DEPENDS_append = " foocorp.com-A" for instance.

If A imports from B and C, you should have DEPENDS = "foocorp.com-B
foocorp.com-C" in the recipe for A, and
DEPENDS = "foocorp.com-C" in the recipe for B.

> I understand it's convenient to install dependencies in the GOROOT
> directory of recipes' sysroot, but we should keep in mind that when one
> calls `go get`, dependencies are installed in GOPATH, not GOROOT. I
> think that if we want to avoid (a bit obscure) build failures and cover
> all use cases, we should try to mimic that behaviour as close as we can.

go.bbclass does not use `go get`.  It only uses `go install`.

-Matt

>
> >
> > -Matt
> > >
> > > Signed-off-by: Damien Riegel 
> > > ---
> > >  meta/classes/go.bbclass | 18 +++---
> > >  1 file changed, 15 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass
> > > index 167d02e3fa..c0ed3211cd 100644
> > > --- a/meta/classes/go.bbclass
> > > +++ b/meta/classes/go.bbclass
> > > @@ -111,9 +111,9 @@ do_compile_ptest_base() {
> > >  do_compile_ptest_base[dirs] =+ "${GOTMPDIR}"
> > >
> > >  go_do_install() {
> > > -   install -d ${D}${libdir}/go/src/${GO_IMPORT}
> > > +   install -d ${D}/gopath/src/${GO_IMPORT} ${D}${libdir}/go
> > > tar -C ${S}/src/${GO_IMPORT} -cf - --exclude-vcs --exclude 
> > > '*.test' --exclude 'testdata' . | \
> > > -   tar -C ${D}${libdir}/go/src/${GO_IMPORT} --no-same-owner 
> > > -xf -
> > > +   tar -C ${D}/gopath/src/${GO_IMPORT} --no-same-owner -xf -
> > > tar -C ${B} -cf - pkg | tar -C ${D}${libdir}/go --no-same-owner 
> > > -xf -
> > >
> > > if [ -n "`ls ${B}/${GO_BUILD_BINDIR}/`" ]; then
> > > @@ -172,9 +172,21 @@ do_install_ptest_base() {
> > > chown -R root:root ${D}${PTEST_PATH}
> > >  }
> > >
> > > +do_fixupdeps() {
> > > +   gopath="${WORKDIR}/recipe-sysroot/gopath"
> > > +   if [ -d ${gopath} ]; then
> > > +   tar -C ${gopath} -cf - src | tar -C ${B} --no-same-owner 
> > > -k -xf -
> > > +   else
> > > +   ech

Re: [OE-core] [PATCH] [RFC] go.bbclass: install dependencies under $GOPATH instead of $GOROOT

2018-12-19 Thread Matt Madison
On Wed, Dec 19, 2018 at 9:51 AM Damien Riegel  wrote:
>
> To package a go application in Yocto, one needs to also package its
> dependencies to keep the build reproducible and under control. The
> default install task of the go class puts the source in ${libdir}/go/src.
>
> ${libdir}/go/src is where the standard go packages resides, aka $GOROOT.
> When a go package has dependencies on other go packages, they must be
> located under $GOPATH, otherwise errors like this one may happen:
>
>   Non-standard package  in standard package 
>
> This point of this patch is to trigger a discussion on how this issue
> can be tackled in Yocto. Following code is working but should not be
> considered for inclusion.

Can you describe the context of this a bit more?  The way go.bbclass
is set up, all of your recipe's dependencies (and their dependencies)
should already have been installed in the per-recipe sysroot (where
GOROOT lives for the current recipe's build), and should get resolved
from there. GOPATH gets set to ${B} for the current recipe's build.
Nothing in the GOROOT should be importing packages that reside in
GOPATH, which is what that particular error message is indicating. If
you're getting that error, then there might be something wrong with
recipe dependencies.

-Matt
>
> Signed-off-by: Damien Riegel 
> ---
>  meta/classes/go.bbclass | 18 +++---
>  1 file changed, 15 insertions(+), 3 deletions(-)
>
> diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass
> index 167d02e3fa..c0ed3211cd 100644
> --- a/meta/classes/go.bbclass
> +++ b/meta/classes/go.bbclass
> @@ -111,9 +111,9 @@ do_compile_ptest_base() {
>  do_compile_ptest_base[dirs] =+ "${GOTMPDIR}"
>
>  go_do_install() {
> -   install -d ${D}${libdir}/go/src/${GO_IMPORT}
> +   install -d ${D}/gopath/src/${GO_IMPORT} ${D}${libdir}/go
> tar -C ${S}/src/${GO_IMPORT} -cf - --exclude-vcs --exclude '*.test' 
> --exclude 'testdata' . | \
> -   tar -C ${D}${libdir}/go/src/${GO_IMPORT} --no-same-owner -xf -
> +   tar -C ${D}/gopath/src/${GO_IMPORT} --no-same-owner -xf -
> tar -C ${B} -cf - pkg | tar -C ${D}${libdir}/go --no-same-owner -xf -
>
> if [ -n "`ls ${B}/${GO_BUILD_BINDIR}/`" ]; then
> @@ -172,9 +172,21 @@ do_install_ptest_base() {
> chown -R root:root ${D}${PTEST_PATH}
>  }
>
> +do_fixupdeps() {
> +   gopath="${WORKDIR}/recipe-sysroot/gopath"
> +   if [ -d ${gopath} ]; then
> +   tar -C ${gopath} -cf - src | tar -C ${B} --no-same-owner -k 
> -xf -
> +   else
> +   echo "no dependencies to fixup"
> +   fi
> +}
> +
>  EXPORT_FUNCTIONS do_unpack do_configure do_compile do_install
>
> -FILES_${PN}-dev = "${libdir}/go/src"
> +addtask do_fixupdeps after do_configure before do_compile
> +
> +SYSROOT_DIRS_append = "/gopath"
> +FILES_${PN}-dev = "/gopath/src"
>  FILES_${PN}-staticdev = "${libdir}/go/pkg"
>
>  INSANE_SKIP_${PN} += "ldflags"
> --
> 2.19.2
>
> --
> ___
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] go-runtime_1.9: pass BUILD_ flags to cgo for host-side build

2018-04-21 Thread Matt Madison
When running the make.bash script to build the host-side
tools, make sure that cgo is using CFLAGS and LDFLAGS for
the build host, rather than those for the target.

[YOCTO #12704]

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/recipes-devtools/go/go-runtime_1.9.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-devtools/go/go-runtime_1.9.bb 
b/meta/recipes-devtools/go/go-runtime_1.9.bb
index a99cc30f63..d5279ea897 100644
--- a/meta/recipes-devtools/go/go-runtime_1.9.bb
+++ b/meta/recipes-devtools/go/go-runtime_1.9.bb
@@ -11,7 +11,7 @@ do_compile() {
export CC=$BUILD_CC
 
cd src
-   ./make.bash --host-only
+   CGO_CFLAGS="${BUILD_CFLAGS}" CGO_LDFLAGS="${BUILD_LDFLAGS}" ./make.bash 
--host-only
cp ${B}/pkg/tool/${BUILD_GOTUPLE}/go_bootstrap ${B}
rm -rf ${B}/pkg/${TARGET_GOTUPLE}
./make.bash --target-only
-- 
2.14.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] State of Sumo

2018-04-21 Thread Matt Madison
I've got a handle on the go-runtime issue, will send a patch shortly.

-Matt

On Sat, Apr 21, 2018 at 3:02 AM, Burton, Ross  wrote:
> Good news is that went green, so the problem is restricted to
> CC_FOR_BUILD usage I guess.
>
> Ross
>
> On 21 April 2018 at 09:09, Burton, Ross  wrote:
>> Okay, fired at 
>> https://autobuilder.yocto.io/builders/nightly-x86-64-lsb/builds/969.
>> That won't be catching people using CC_FOR_BUILD in target recipes to
>> build pieces using the host compiler, but it will be interesting to
>> see if it catches anything.
>>
>> Ross
>>
>> On 21 April 2018 at 09:08, Burton, Ross  wrote:
>>> On 20 April 2018 at 23:09, Andre McCurdy  wrote:
 On Fri, Apr 20, 2018 at 2:57 PM, Burton, Ross  
 wrote:
> Hi,
>
> We'll hopefully be firing the 2.5 RC build on Monday, so I did a build
> today to see where we stand. As is typical we got two new failures on
> the autobuilder...  My test build included the pseudo bump which
> caused an almost complete rebuild, which is a great way to shake out
> intermittent failures.
>
> https://bugzilla.yoctoproject.org/show_bug.cgi?id=12704
> Go appears to be using the target CFLAGS when using the host compiler,
> with predictable failures when the host is old and doesn't support new
> flags.

 Maybe worth resurrecting something like:

   
 http://lists.openembedded.org/pipermail/openembedded-core/2016-February/118212.html

 to flush out similar issues?
>>>
>>> Thank you for finding that, I remembered there was a patch but
>>> couldn't find it. :)
>>>
>>> Ross
> --
> ___
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [RESEND PATCH] glide.bbclass: Add class to easy Glide use

2018-03-16 Thread Matt Madison
On Fri, Mar 16, 2018 at 5:57 AM, Otavio Salvador
 wrote:
> To use 'glide' this class does the integration and reduces code
> duplication.
>
> Signed-off-by: Otavio Salvador 
> ---
>
>  meta/classes/glide.bbclass | 9 +
>  1 file changed, 9 insertions(+)
>  create mode 100644 meta/classes/glide.bbclass
>
> diff --git a/meta/classes/glide.bbclass b/meta/classes/glide.bbclass
> new file mode 100644
> index 000..52291bab8cf
> --- /dev/null
> +++ b/meta/classes/glide.bbclass
> @@ -0,0 +1,9 @@
> +# Handle Glide Vendor Package Management use
> +#
> +# Copyright 2018 (C) O.S. Systems Software LTDA.
> +
> +DEPENDS_append = " glide-native"
> +
> +do_compile_prepend() {
> +( cd ${WORKDIR}/build/src/${GO_IMPORT} && glide install )
 ^
Any reason why you aren't just using ${B} here instead?

-Matt
> +}
> --
> 2.16.2
>
> --
> ___
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [rocko][PATCH 1/1] go: Upgrade 1.9 to 1.9.4 stable release

2018-03-12 Thread Matt Madison
From: Otavio Salvador <ota...@ossystems.com.br>

The 1.9.4 fixes a number of issues in the Go compiler and is important
to get in before we start working on 1.10 inclusion.

 - go1.9.1 (released 2017/10/04) includes two security fixes.

 - go1.9.2 (released 2017/10/25) includes fixes to the compiler,
   linker, runtime, documentation, go command, and the crypto/x509,
   database/sql, log, and net/smtp packages. It includes a fix to a
   bug introduced in Go 1.9.1 that broke go get of non-Git
   repositories under certain conditions.

 - go1.9.3 (released 2018/01/22) includes fixes to the compiler,
   runtime, and the database/sql, math/big, net/http, and net/url
   packages.

 - go1.9.4 (released 2018/02/07) includes a security fix to “go get”.

Signed-off-by: Otavio Salvador <ota...@ossystems.com.br>
Signed-off-by: Ross Burton <ross.bur...@intel.com>
Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/recipes-devtools/go/go-1.9.inc | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-devtools/go/go-1.9.inc 
b/meta/recipes-devtools/go/go-1.9.inc
index 7f12241dc1..2823304b7c 100644
--- a/meta/recipes-devtools/go/go-1.9.inc
+++ b/meta/recipes-devtools/go/go-1.9.inc
@@ -1,6 +1,9 @@
 require go-common.inc
 
 GO_BASEVERSION = "1.9"
+GO_MINOR = ".4"
+PV .= "${GO_MINOR}"
+
 FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/go-${GO_BASEVERSION}:"
 
 LIC_FILES_CHKSUM = "file://LICENSE;md5=5d4950ecb7b26d2c5e4e7b4e0dd74707"
@@ -19,5 +22,5 @@ SRC_URI += "\
 "
 SRC_URI_append_libc-musl = " file://set-external-linker.patch"
 
-SRC_URI[main.md5sum] = "da2d44ea384076efec43ee1f8b7d45d2"
-SRC_URI[main.sha256sum] = 
"a4ab229028ed167ba1986825751463605264e44868362ca8e7accc8be057e993"
+SRC_URI[main.md5sum] = "6816441fd6680c63865cdd5cb8bc1960"
+SRC_URI[main.sha256sum] = 
"0573a8df33168977185aa44173305e5a0450f55213600e94541604b75d46dc06"
-- 
2.14.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [rocko][PATCH 0/1] backport go 1.9.4 update to rocko

2018-03-12 Thread Matt Madison
One of the changes included in this point release update
fixes an issue with the construction of Go's shared runtim
library, so it would be great to backport this to rocko
to fix [YOCTO 12592].

Thanks,
-Matt

Otavio Salvador (1):
  go: Upgrade 1.9 to 1.9.4 stable release

 meta/recipes-devtools/go/go-1.9.inc | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

-- 
2.14.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH v4 00/13] go1.10 update and misc improvements

2018-03-04 Thread Matt Madison
On Sun, Mar 4, 2018 at 12:46 PM, Otavio Salvador
<otavio.salva...@ossystems.com.br> wrote:
> On Sat, Mar 3, 2018 at 11:28 PM, Khem Raj <raj.k...@gmail.com> wrote:
>> On Sat, Mar 3, 2018 at 2:45 PM, Otavio Salvador
>> <otavio.salva...@ossystems.com.br> wrote:
>>> On Sat, Mar 3, 2018 at 4:59 PM, Khem Raj <raj.k...@gmail.com> wrote:
>>>> On Sat, Mar 3, 2018 at 9:44 AM, Matt Madison <matt@madison.systems> wrote:
>>>>> Since it looks like I'll have to do a v5 on my series anyway, I can
>>>>> pull in that backport for the aarch64 issue.
>>>>
>>>> sure,  I would suggest we keep 1.9 around as well.
>>>
>>> I am against. Go is good to provide backward compatibility and keeping
>>> both just causes people to delay the update. We have some time to
>>> April release and thus any regression will be ironed out. Possibly
>>> wait until 1.10.1 is out but keeping two releases I am unsure it is
>>> needed.
>>
>> Your disagreement is acknowledged.
>> There are larger systems written in go which haven't moved to go 1.10
>> and I know for sure influxdb and grafana are not working with 1.10
>> and there might be many more real world programs which will be in same
>> boat. This is no different then what we do with gcc releases where we
>> overlap them for couple of releases to smooth out transition.
>
> I understand the need and I see the value. The GCC is harder to
> upgrade but problems using newer Go toolchain does not happen very
> often and likely are caused by a regression on Go itself.
>
> As I said, there are two options:
>
> a) wait for 1.10.1 release
> b) keep 1.9.4 around
>
> My preference goes to (a) as I prefer to not include 1.10 now with
> those known issues.

I've reworked the patches in v5 to allow for either approach.  If it's
(a), we can simply remove the 1.9 recipes.

-Matt

>
> --
> Otavio Salvador O.S. Systems
> http://www.ossystems.com.brhttp://code.ossystems.com.br
> Mobile: +55 (53) 9981-7854Mobile: +1 (347) 903-9750
> --
> ___
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v5 13/13] tcmode-default.inc: add settings for go

2018-03-04 Thread Matt Madison
to allow GOVERSION to be set for using an older
go toolchain.

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/conf/distro/include/tcmode-default.inc | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/meta/conf/distro/include/tcmode-default.inc 
b/meta/conf/distro/include/tcmode-default.inc
index 87a5920cad..5c6681fb9d 100644
--- a/meta/conf/distro/include/tcmode-default.inc
+++ b/meta/conf/distro/include/tcmode-default.inc
@@ -67,3 +67,13 @@ PREFERRED_VERSION_cross-localedef-native   ?= 
"${GLIBCVERSION}"
 # Setup suitable toolchain flags
 require conf/distro/include/as-needed.inc
 
+GOVERSION ?= "1.10%"
+PREFERRED_VERSION_virtual/${TARGET_PREFIX}go ?= "${GOVERSION}"
+PREFERRED_VERSION_go-cross-${TARGET_ARCH} ?= "${GOVERSION}"
+PREFERRED_VERSION_go-crosssdk-${SDK_ARCH} ?= "${GOVERSION}"
+PREFERRED_VERSION_go-cross-canadian-${TRANSLATED_TARGET_ARCH} ?= "${GOVERSION}"
+PREFERRED_VERSION_go ?= "${GOVERSION}"
+PREFERRED_VERSION_go-native ?= "${GOVERSION}"
+PREFERRED_VERSION_go-runtime ?= "${GOVERSION}"
+PREFERRED_VERSION_nativesdk-go ?= "${GOVERSION}"
+PREFERRED_VERSION_nativesdk-go-runtime ?= "${GOVERSION}"
-- 
2.14.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v5 12/13] go-runtime: remove unneeded nativesdk override, rename variable

2018-03-04 Thread Matt Madison
since GO_LDFLAGS is also used by the dist tool, and it's confusing
to use a variable with the same name (but not exported, so unused
by make.bash/dist).

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/recipes-devtools/go/go-runtime.inc | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/meta/recipes-devtools/go/go-runtime.inc 
b/meta/recipes-devtools/go/go-runtime.inc
index a79295df47..0041e8afab 100644
--- a/meta/recipes-devtools/go/go-runtime.inc
+++ b/meta/recipes-devtools/go/go-runtime.inc
@@ -17,9 +17,7 @@ export CGO_CXXFLAGS = "${CXXFLAGS}"
 export CGO_LDFLAGS = "${LDFLAGS}"
 
 GO_EXTLDFLAGS ?= "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} ${LDFLAGS}"
-GO_LINKMODE ?= ""
-GO_LINKMODE_class-nativesdk = "--linkmode=external"
-GO_LDFLAGS ?= '-ldflags="${GO_LINKMODE} -extldflags '${GO_EXTLDFLAGS}'"'
+GO_SHLIB_LDFLAGS ?= '-ldflags="--linkmode=external -extldflags 
'${GO_EXTLDFLAGS}'"'
 
 do_configure() {
:
@@ -38,7 +36,7 @@ do_compile() {
if [ -n "${GO_DYNLINK}" ]; then
export GOTOOLDIR="${B}/pkg/tool/native_native"
CC="$CC_FOR_${TARGET_GOOS}_${TARGET_GOARCH}" 
GOARCH="${TARGET_GOARCH}" GOOS="${TARGET_GOOS}" GOROOT=${B} \
-   $GOTOOLDIR/go_bootstrap install -linkshared 
-buildmode=shared ${GO_LDFLAGS} std
+   $GOTOOLDIR/go_bootstrap install -linkshared 
-buildmode=shared ${GO_SHLIB_LDFLAGS} std
fi
cd ${B}
 }
-- 
2.14.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v5 10/13] go: disable PIE CFLAGS for nativesdk and cross-canadian builds

2018-03-04 Thread Matt Madison
The statically-linked Go code in the toolchain is not compatible
with PIE, so disable its use in the C compiler during the
toolchain build.

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/recipes-devtools/go/go-cross-canadian.inc| 6 +++---
 meta/recipes-devtools/go/go-cross-canadian_1.9.bb | 4 ++--
 meta/recipes-devtools/go/go-target.inc| 3 +--
 3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/meta/recipes-devtools/go/go-cross-canadian.inc 
b/meta/recipes-devtools/go/go-cross-canadian.inc
index e630b83df8..ea68b8875d 100644
--- a/meta/recipes-devtools/go/go-cross-canadian.inc
+++ b/meta/recipes-devtools/go/go-cross-canadian.inc
@@ -12,13 +12,13 @@ export GOTOOLDIR_BOOTSTRAP = 
"${STAGING_LIBDIR_NATIVE}/${HOST_SYS}/go/pkg/tool/$
 export GOROOT_FINAL = "${libdir}/go"
 export CGO_CFLAGS = "${CFLAGS}"
 export CGO_LDFLAGS = "${LDFLAGS}"
-export GO_LDFLAGS = '-linkmode external -extld ${HOST_PREFIX}gcc -extldflags 
"--sysroot=${STAGING_DIR_HOST} ${HOST_CC_ARCH} ${LDFLAGS}"'
+export GO_LDFLAGS = '-linkmode external -extld ${HOST_PREFIX}gcc -extldflags 
"--sysroot=${STAGING_DIR_HOST} ${SECURITY_NOPIE_CFLAGS} ${HOST_CC_ARCH} 
${LDFLAGS}"'
 
 do_configure[noexec] = "1"
 
 do_compile() {
-   export CC_FOR_${HOST_GOOS}_${HOST_GOARCH}="${HOST_PREFIX}gcc 
--sysroot=${STAGING_DIR_HOST}${SDKPATHNATIVE}"
-   export CXX_FOR_${HOST_GOOS}_${HOST_GOARCH}="${HOST_PREFIX}gxx 
--sysroot=${STAGING_DIR_HOST}${SDKPATHNATIVE}"
+   export CC_FOR_${HOST_GOOS}_${HOST_GOARCH}="${HOST_PREFIX}gcc 
--sysroot=${STAGING_DIR_HOST}${SDKPATHNATIVE} ${SECURITY_NOPIE_CFLAGS}"
+   export CXX_FOR_${HOST_GOOS}_${HOST_GOARCH}="${HOST_PREFIX}gxx 
--sysroot=${STAGING_DIR_HOST}${SDKPATHNATIVE} ${SECURITY_NOPIE_CFLAGS}"
cd src
./make.bash --host-only --no-banner
cd ${B}
diff --git a/meta/recipes-devtools/go/go-cross-canadian_1.9.bb 
b/meta/recipes-devtools/go/go-cross-canadian_1.9.bb
index 0306fdf684..367a967056 100644
--- a/meta/recipes-devtools/go/go-cross-canadian_1.9.bb
+++ b/meta/recipes-devtools/go/go-cross-canadian_1.9.bb
@@ -3,8 +3,8 @@ require go-${PV}.inc
 
 export GOHOSTOS_CROSS = "${HOST_GOOS}"
 export GOHOSTARCH_CROSS = "${HOST_GOARCH}"
-export CC_FOR_TARGET = "${HOST_PREFIX}gcc 
--sysroot=${STAGING_DIR_HOST}${SDKPATHNATIVE}"
-export CXX_FOR_TARGET = "${HOST_PREFIX}g++ 
--sysroot=${STAGING_DIR_HOST}${SDKPATHNATIVE}"
+export CC_FOR_TARGET = "${HOST_PREFIX}gcc 
--sysroot=${STAGING_DIR_HOST}${SDKPATHNATIVE} ${SECURITY_NOPIE_CFLAGS}"
+export CXX_FOR_TARGET = "${HOST_PREFIX}g++ 
--sysroot=${STAGING_DIR_HOST}${SDKPATHNATIVE} ${SECURITY_NOPIE_CFLAGS}"
 
 do_compile_prepend() {
export GOBIN="${B}/bin"
diff --git a/meta/recipes-devtools/go/go-target.inc 
b/meta/recipes-devtools/go/go-target.inc
index 3bc32f3bec..29a1344675 100644
--- a/meta/recipes-devtools/go/go-target.inc
+++ b/meta/recipes-devtools/go/go-target.inc
@@ -14,8 +14,7 @@ GO_LDFLAGS = ""
 GO_LDFLAGS_class-nativesdk = "-linkmode external"
 export GO_LDFLAGS
 
-SECURITY_CFLAGS = "${SECURITY_NOPIE_CFLAGS}"
-SECURITY_LDFLAGS = ""
+CC_append_class-nativesdk = " ${SECURITY_NOPIE_CFLAGS}"
 
 do_configure[noexec] = "1"
 
-- 
2.14.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v5 09/13] go.bbclass, goarch.bbclass: update SECURITY_CFLAGS

2018-03-04 Thread Matt Madison
With go1.10 the NOPIE flags are only required for
MIPS target builds, and are now incompatible for
the other architectures.

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/classes/go.bbclass | 3 ---
 meta/classes/goarch.bbclass | 2 ++
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass
index a51ba3e9f0..d33d83ea7f 100644
--- a/meta/classes/go.bbclass
+++ b/meta/classes/go.bbclass
@@ -34,9 +34,6 @@ GOTOOLDIR = 
"${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go/pkg/tool/${BUILD_GOTUPLE}
 GOTOOLDIR_class-native = 
"${STAGING_LIBDIR_NATIVE}/go/pkg/tool/${BUILD_GOTUPLE}"
 export GOTOOLDIR
 
-SECURITY_CFLAGS = "${SECURITY_NOPIE_CFLAGS}"
-SECURITY_LDFLAGS = ""
-
 export CGO_ENABLED ?= "1"
 export CGO_CFLAGS ?= "${CFLAGS}"
 export CGO_CPPFLAGS ?= "${CPPFLAGS}"
diff --git a/meta/classes/goarch.bbclass b/meta/classes/goarch.bbclass
index 5c8ed33b15..f54c5169e3 100644
--- a/meta/classes/goarch.bbclass
+++ b/meta/classes/goarch.bbclass
@@ -35,6 +35,8 @@ COMPATIBLE_HOST_powerpc64 = "null"
 COMPATIBLE_HOST_mipsarchn32 = "null"
 ARM_INSTRUCTION_SET = "arm"
 TUNE_CCARGS_remove = "-march=mips32r2"
+SECURITY_CFLAGS_mips = "${SECURITY_NOPIE_CFLAGS}"
+SECURITY_NOPIE_CFLAGS ??= ""
 
 def go_map_arch(a, d):
 import re
-- 
2.14.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v5 07/13] goarch.bbclass: disable shared runtime for nativesdk builds

2018-03-04 Thread Matt Madison
While useful on embedded devices for saving disk space, use
of shared runtime in Go is not the usual practice, so disable
it for nativesdk builds.  We don't use it for native builds,
either, so this makes the SDK match the native environment
more closely.

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/classes/goarch.bbclass | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/classes/goarch.bbclass b/meta/classes/goarch.bbclass
index 1021b94d4c..5c8ed33b15 100644
--- a/meta/classes/goarch.bbclass
+++ b/meta/classes/goarch.bbclass
@@ -24,6 +24,7 @@ GO_DYNLINK_x86 = "1"
 GO_DYNLINK_x86-64 = "1"
 GO_DYNLINK_powerpc64 = "1"
 GO_DYNLINK_class-native = ""
+GO_DYNLINK_class-nativesdk = ""
 
 # define here because everybody inherits this class
 #
-- 
2.14.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v5 08/13] go: move common settings to go-common.inc

2018-03-04 Thread Matt Madison
Eliminate some redundancy in the recipes by moving
some commonly-used variable settings to the common
include file.  Also removed a duplicate inherit
from go-target.inc that was already in go-common.inc.

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/recipes-devtools/go/go-common.inc | 4 
 meta/recipes-devtools/go/go-cross-canadian.inc | 4 
 meta/recipes-devtools/go/go-cross.inc  | 3 ---
 meta/recipes-devtools/go/go-crosssdk.inc   | 4 
 meta/recipes-devtools/go/go-native.inc | 3 ---
 meta/recipes-devtools/go/go-runtime.inc| 5 +
 meta/recipes-devtools/go/go-target.inc | 5 -
 7 files changed, 5 insertions(+), 23 deletions(-)

diff --git a/meta/recipes-devtools/go/go-common.inc 
b/meta/recipes-devtools/go/go-common.inc
index 611775b2cc..11d55c4d36 100644
--- a/meta/recipes-devtools/go/go-common.inc
+++ b/meta/recipes-devtools/go/go-common.inc
@@ -23,6 +23,10 @@ INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
 SSTATE_SCAN_CMD = "true"
 
 export GOROOT_OVERRIDE = "1"
+export GOTMPDIR ?= "${WORKDIR}/go-tmp"
+GOTMPDIR[vardepvalue] = ""
+export GOCACHE = "off"
+export CGO_ENABLED = "1"
 
 do_compile_prepend() {
BUILD_CC=${BUILD_CC}
diff --git a/meta/recipes-devtools/go/go-cross-canadian.inc 
b/meta/recipes-devtools/go/go-cross-canadian.inc
index 4a43d831fa..e630b83df8 100644
--- a/meta/recipes-devtools/go/go-cross-canadian.inc
+++ b/meta/recipes-devtools/go/go-cross-canadian.inc
@@ -10,10 +10,6 @@ export GOHOSTARCH = "${BUILD_GOARCH}"
 export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
 export GOTOOLDIR_BOOTSTRAP = 
"${STAGING_LIBDIR_NATIVE}/${HOST_SYS}/go/pkg/tool/${BUILD_GOTUPLE}"
 export GOROOT_FINAL = "${libdir}/go"
-export CGO_ENABLED = "1"
-export GOCACHE = "off"
-export GOTMPDIR ?= "${WORKDIR}/go-tmp"
-GOTMPDIR[vardepvalue] = ""
 export CGO_CFLAGS = "${CFLAGS}"
 export CGO_LDFLAGS = "${LDFLAGS}"
 export GO_LDFLAGS = '-linkmode external -extld ${HOST_PREFIX}gcc -extldflags 
"--sysroot=${STAGING_DIR_HOST} ${HOST_CC_ARCH} ${LDFLAGS}"'
diff --git a/meta/recipes-devtools/go/go-cross.inc 
b/meta/recipes-devtools/go/go-cross.inc
index 289ae77104..44f230b8bc 100644
--- a/meta/recipes-devtools/go/go-cross.inc
+++ b/meta/recipes-devtools/go/go-cross.inc
@@ -15,9 +15,6 @@ export GOMIPS = "${TARGET_GOMIPS}"
 export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
 export GOROOT_FINAL = "${libdir}/go"
 export GOCACHE = "off"
-export GOTMPDIR ?= "${WORKDIR}/go-tmp"
-GOTMPDIR[vardepvalue] = ""
-export CGO_ENABLED = "1"
 CC = "${@d.getVar('BUILD_CC').strip()}"
 
 do_configure[noexec] = "1"
diff --git a/meta/recipes-devtools/go/go-crosssdk.inc 
b/meta/recipes-devtools/go/go-crosssdk.inc
index 05ca62eba8..4391b32424 100644
--- a/meta/recipes-devtools/go/go-crosssdk.inc
+++ b/meta/recipes-devtools/go/go-crosssdk.inc
@@ -10,10 +10,6 @@ export GOOS = "${TARGET_GOOS}"
 export GOARCH = "${TARGET_GOARCH}"
 export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
 export GOROOT_FINAL = "${libdir}/go"
-export CGO_ENABLED = "1"
-export GOCACHE = "off"
-export GOTMPDIR ?= "${WORKDIR}/go-tmp"
-GOTMPDIR[vardepvalue] = ""
 
 do_configure[noexec] = "1"
 
diff --git a/meta/recipes-devtools/go/go-native.inc 
b/meta/recipes-devtools/go/go-native.inc
index 35561768df..b76fb0825e 100644
--- a/meta/recipes-devtools/go/go-native.inc
+++ b/meta/recipes-devtools/go/go-native.inc
@@ -10,11 +10,8 @@ SRC_URI[bootstrap.sha256sum] = 
"f4ff5b5eb3a3cae1c993723f3eab519c5bae18866b5e5f96
 
 export GOOS = "${BUILD_GOOS}"
 export GOARCH = "${BUILD_GOARCH}"
-export GOTMPDIR ?= "${WORKDIR}/go-tmp"
-GOTMPDIR[vardepvalue] = ""
 CC = "${@d.getVar('BUILD_CC').strip()}"
 
-export CGO_ENABLED = "1"
 GOMAKEARGS ?= "--no-banner"
 
 do_configure() {
diff --git a/meta/recipes-devtools/go/go-runtime.inc 
b/meta/recipes-devtools/go/go-runtime.inc
index 0fe4566360..a79295df47 100644
--- a/meta/recipes-devtools/go/go-runtime.inc
+++ b/meta/recipes-devtools/go/go-runtime.inc
@@ -11,14 +11,11 @@ export GO386 = "${TARGET_GO386}"
 export GOMIPS = "${TARGET_GOMIPS}"
 export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
 export GOROOT_FINAL = "${libdir}/go"
-export CGO_ENABLED = "1"
 export CGO_CFLAGS = "${CFLAGS}"
 export CGO_CPPFLAGS = "${CPPFLAGS}"
 export CGO_CXXFLAGS = "${CXXFLAGS}"
 export CGO_LDFLAGS = "${LDFLAGS}"
-export GOCACHE = "off"
-export GOTMPDIR ?= "${WORKDIR}/go-tmp"
-GOTMPDIR[vardepvalue] = ""
+
 GO_EXTLDFLAGS ?= "

[OE-core] [PATCH v5 11/13] packagegroup-go-sdk-target: add go-runtime-staticdev

2018-03-04 Thread Matt Madison
to allow go programs to be linked either statically or
dynamically when cross-compiling with the SDK.

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/recipes-core/packagegroups/packagegroup-go-sdk-target.bb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/recipes-core/packagegroups/packagegroup-go-sdk-target.bb 
b/meta/recipes-core/packagegroups/packagegroup-go-sdk-target.bb
index 3e190770a7..7d2ccbda22 100644
--- a/meta/recipes-core/packagegroups/packagegroup-go-sdk-target.bb
+++ b/meta/recipes-core/packagegroups/packagegroup-go-sdk-target.bb
@@ -5,4 +5,5 @@ inherit packagegroup goarch
 RDEPENDS_${PN} = " \
 go-runtime \
 go-runtime-dev \
+go-runtime-staticdev \
 "
-- 
2.14.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v5 04/13] go.bbclass: remove debug-related commands

2018-03-04 Thread Matt Madison
The 'go env' in the do_compile function and
the set -x/+x in the do_install_ptest function
were used for debugging the bbclass, and aren't
really needed.

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/classes/go.bbclass | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass
index 96302a187c..21ac2276c5 100644
--- a/meta/classes/go.bbclass
+++ b/meta/classes/go.bbclass
@@ -89,7 +89,6 @@ do_configure[dirs] =+ "${GOTMPDIR}"
 
 go_do_compile() {
export TMPDIR="${GOTMPDIR}"
-   ${GO} env
if [ -n "${GO_INSTALL}" ]; then
if [ -n "${GO_LINKSHARED}" ]; then
${GO} install ${GOBUILDFLAGS} `go_list_packages`
@@ -126,7 +125,6 @@ go_do_install() {
 }
 
 do_install_ptest_base() {
-set -x
 test -f "${B}/.go_compiled_tests.list" || exit 0
 tests=""
 while read test; do
@@ -160,7 +158,6 @@ EOF
 else
 rm -rf ${D}${PTEST_PATH}
 fi
-set +x
 }
 
 EXPORT_FUNCTIONS do_unpack do_configure do_compile do_install
-- 
2.14.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v5 06/13] go.bbclass: ptest cleanup and improvements

2018-03-04 Thread Matt Madison
* Don't enable verbose test output (-test.v)
  by default, as it generates too much noise
  for automated results parsing

* Override do_install_ptest_base in the bbclass,
  so recipes can provide their own modifications
  with do_install_ptest.

* Improve the generated run-ptest script to better
  handle large numbers of tests, and to generate
  'status: test name' output similar to Automake
  tests.

* Install all non-vendored 'testdata' directories
  from the source into the ptest package, as some
  packages share test data among multiple tests.

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/classes/go.bbclass | 87 +
 1 file changed, 51 insertions(+), 36 deletions(-)

diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass
index afd68b5951..a51ba3e9f0 100644
--- a/meta/classes/go.bbclass
+++ b/meta/classes/go.bbclass
@@ -26,7 +26,7 @@ GO_LDFLAGS ?= '-ldflags="${GO_RPATH} ${GO_LINKMODE} 
-extldflags '${GO_EXTLDFLAGS
 export GOBUILDFLAGS ?= "-v ${GO_LDFLAGS}"
 export GOPATH_OMIT_IN_ACTIONID ?= "1"
 export GOPTESTBUILDFLAGS ?= "${GOBUILDFLAGS} -c"
-export GOPTESTFLAGS ?= "-test.v"
+export GOPTESTFLAGS ?= ""
 GOBUILDFLAGS_prepend_task-compile = "${GO_PARALLEL_BUILD} "
 
 export GO = "${HOST_PREFIX}go"
@@ -76,7 +76,7 @@ go_list_packages() {
 }
 
 go_list_package_tests() {
-${GO} list -f '{{.ImportPath}} {{.TestGoFiles}}' ${GOBUILDFLAGS} 
${GO_INSTALL} | \
+   ${GO} list -f '{{.ImportPath}} {{.TestGoFiles}}' ${GOBUILDFLAGS} 
${GO_INSTALL} | \
grep -v '\[\]$' | \
egrep -v '${GO_INSTALL_FILTEROUT}' | \
awk '{ print $1 }'
@@ -100,15 +100,16 @@ go_do_compile() {
 do_compile[dirs] =+ "${GOTMPDIR}"
 do_compile[cleandirs] = "${B}/bin ${B}/pkg"
 
-do_compile_ptest() {
+do_compile_ptest_base() {
export TMPDIR="${GOTMPDIR}"
-rm -f ${B}/.go_compiled_tests.list
+   rm -f ${B}/.go_compiled_tests.list
go_list_package_tests | while read pkg; do
cd ${B}/src/$pkg
${GO} test ${GOPTESTBUILDFLAGS} $pkg
find . -mindepth 1 -maxdepth 1 -type f -name '*.test' -exec 
echo $pkg/{} \; | \
sed -e's,/\./,/,'>> ${B}/.go_compiled_tests.list
done
+   do_compile_ptest
 }
 do_compile_ptest_base[dirs] =+ "${GOTMPDIR}"
 
@@ -124,40 +125,54 @@ go_do_install() {
fi
 }
 
-do_install_ptest_base() {
-test -f "${B}/.go_compiled_tests.list" || exit 0
-tests=""
-while read test; do
-tests="$tests${tests:+ }${test%.test}"
-testdir=`dirname $test`
-install -d ${D}${PTEST_PATH}/$testdir
-install -m 0755 ${B}/src/$test ${D}${PTEST_PATH}/$test
-if [ -d "${B}/src/$testdir/testdata" ]; then
-cp --preserve=mode,timestamps -R "${B}/src/$testdir/testdata" 
${D}${PTEST_PATH}/$testdir
-fi
-done < ${B}/.go_compiled_tests.list
-if [ -n "$tests" ]; then
-install -d ${D}${PTEST_PATH}
-cat >${D}${PTEST_PATH}/run-ptest <${D}${PTEST_PATH}/run-ptest <&1; then
-ANYFAILED=1
-fi
-done
-if [ \$ANYFAILED -ne 0 ]; then
-echo "FAIL: ${PN}"
-exit 1
-fi
-echo "PASS: ${PN}"
-exit 0
+RC=0
+run_test() (
+cd "\$1"
+./\$2 ${GOPTESTFLAGS}; echo \$? >&3) | sed -r 
-e"s,^(PASS|SKIP|FAIL)\$,\\1: \$1/\$2," >&4) 3>&1) | (read rc; exit \$rc)) 4>&1
+exit \$?)
 EOF
-chmod +x ${D}${PTEST_PATH}/run-ptest
-else
-rm -rf ${D}${PTEST_PATH}
-fi
+
+}
+
+go_stage_testdata() {
+   oldwd="$PWD"
+   cd ${S}/src
+   find ${GO_IMPORT} -depth -type d -name testdata | while read d; do
+   if echo "$d" | grep -q '/vendor/'; then
+   continue
+   fi
+   parent=`dirname $d`
+   install -d ${D}${PTEST_PATH}/$parent
+   cp --preserve=mode,timestamps -R $d ${D}${PTEST_PATH}/$parent/
+   done
+   cd "$oldwd"
+}
+
+do_install_ptest_base() {
+   test -f "${B}/.go_compiled_tests.list" || exit 0
+   install -d ${D}${PTEST_PATH}
+   go_stage_testdata
+   go_make_ptest_wrapper
+   havetests=""
+   while read test; do
+   testdir=`dirname $test`
+   testprog=`basename $test`
+   install -d ${D}${PTEST_PATH}/$testdir
+   install -m 0755 ${B}/src/$test ${D}${PTEST_PATH}/$test
+   echo "run_test $testdir $testprog || RC=1" >> 
${D}${PTEST_PATH}/run-ptest
+   havetests="yes"
+   done < ${B}/.go_compiled_tests.list
+   if [ -n "$havetests" ]; then
+   echo "exit \$RC"

[OE-core] [PATCH v5 05/13] go.bbclass: don't stage test data with sources

2018-03-04 Thread Matt Madison
Any directory in a Go package's source tree called
'testdata' contains test data, and isn't necessary
for building.

Some packages include ELF files and other binaries
as test data, and staging them in the sysroot and
-dev package leads to unnecessary QA warnings.

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/classes/go.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass
index 21ac2276c5..afd68b5951 100644
--- a/meta/classes/go.bbclass
+++ b/meta/classes/go.bbclass
@@ -114,7 +114,7 @@ do_compile_ptest_base[dirs] =+ "${GOTMPDIR}"
 
 go_do_install() {
install -d ${D}${libdir}/go/src/${GO_IMPORT}
-   tar -C ${S}/src/${GO_IMPORT} -cf - --exclude-vcs --exclude '*.test' . | 
\
+   tar -C ${S}/src/${GO_IMPORT} -cf - --exclude-vcs --exclude '*.test' 
--exclude 'testdata' . | \
tar -C ${D}${libdir}/go/src/${GO_IMPORT} --no-same-owner -xf -
tar -C ${B} -cf - pkg | tar -C ${D}${libdir}/go --no-same-owner -xf -
 
-- 
2.14.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v5 03/13] go.bbclass: rename GO_TMPDIR -> GOTMPDIR

2018-03-04 Thread Matt Madison
and export it. Go 1.10 now supports using this
separate variable locating its temporary files.

TMPDIR is still set, for compatibility with go1.9;
that can be dropped once 1.9 is retired.

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/classes/go.bbclass | 13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass
index a01b28bccd..96302a187c 100644
--- a/meta/classes/go.bbclass
+++ b/meta/classes/go.bbclass
@@ -49,8 +49,8 @@ GO_INSTALL_FILTEROUT ?= "${GO_IMPORT}/vendor/"
 B = "${WORKDIR}/build"
 export GOPATH = "${B}"
 export GOCACHE = "off"
-GO_TMPDIR ?= "${WORKDIR}/go-tmp"
-GO_TMPDIR[vardepvalue] = ""
+export GOTMPDIR ?= "${WORKDIR}/go-tmp"
+GOTMPDIR[vardepvalue] = ""
 
 python go_do_unpack() {
 src_uri = (d.getVar('SRC_URI') or "").split()
@@ -85,9 +85,10 @@ go_list_package_tests() {
 go_do_configure() {
ln -snf ${S}/src ${B}/
 }
+do_configure[dirs] =+ "${GOTMPDIR}"
 
 go_do_compile() {
-   export TMPDIR="${GO_TMPDIR}"
+   export TMPDIR="${GOTMPDIR}"
${GO} env
if [ -n "${GO_INSTALL}" ]; then
if [ -n "${GO_LINKSHARED}" ]; then
@@ -97,11 +98,11 @@ go_do_compile() {
${GO} install ${GO_LINKSHARED} ${GOBUILDFLAGS} 
`go_list_packages`
fi
 }
-do_compile[dirs] =+ "${GO_TMPDIR}"
+do_compile[dirs] =+ "${GOTMPDIR}"
 do_compile[cleandirs] = "${B}/bin ${B}/pkg"
 
 do_compile_ptest() {
-export TMPDIR="${GO_TMPDIR}"
+   export TMPDIR="${GOTMPDIR}"
 rm -f ${B}/.go_compiled_tests.list
go_list_package_tests | while read pkg; do
cd ${B}/src/$pkg
@@ -110,7 +111,7 @@ do_compile_ptest() {
sed -e's,/\./,/,'>> ${B}/.go_compiled_tests.list
done
 }
-do_compile_ptest_base[dirs] =+ "${GO_TMPDIR}"
+do_compile_ptest_base[dirs] =+ "${GOTMPDIR}"
 
 go_do_install() {
install -d ${D}${libdir}/go/src/${GO_IMPORT}
-- 
2.14.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v5 02/13] go: set GOMIPS envrionment variable

2018-03-04 Thread Matt Madison
Go 1.10 adds support for selecting hard/soft float
object code through the GOMIPS environment variable.

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/classes/goarch.bbclass| 11 +++
 meta/recipes-devtools/go/go-cross-canadian.inc |  1 +
 meta/recipes-devtools/go/go-cross.inc  |  2 ++
 meta/recipes-devtools/go/go-runtime.inc|  1 +
 meta/recipes-devtools/go/go-target.inc |  1 +
 5 files changed, 16 insertions(+)

diff --git a/meta/classes/goarch.bbclass b/meta/classes/goarch.bbclass
index 922c0cc8f3..1021b94d4c 100644
--- a/meta/classes/goarch.bbclass
+++ b/meta/classes/goarch.bbclass
@@ -5,11 +5,13 @@ HOST_GOOS = "${@go_map_os(d.getVar('HOST_OS'), d)}"
 HOST_GOARCH = "${@go_map_arch(d.getVar('HOST_ARCH'), d)}"
 HOST_GOARM = "${@go_map_arm(d.getVar('HOST_ARCH'), d.getVar('TUNE_FEATURES'), 
d)}"
 HOST_GO386 = "${@go_map_386(d.getVar('HOST_ARCH'), d.getVar('TUNE_FEATURES'), 
d)}"
+HOST_GOMIPS = "${@go_map_mips(d.getVar('HOST_ARCH'), 
d.getVar('TUNE_FEATURES'), d)}"
 HOST_GOTUPLE = "${HOST_GOOS}_${HOST_GOARCH}"
 TARGET_GOOS = "${@go_map_os(d.getVar('TARGET_OS'), d)}"
 TARGET_GOARCH = "${@go_map_arch(d.getVar('TARGET_ARCH'), d)}"
 TARGET_GOARM = "${@go_map_arm(d.getVar('TARGET_ARCH'), 
d.getVar('TUNE_FEATURES'), d)}"
 TARGET_GO386 = "${@go_map_386(d.getVar('TARGET_ARCH'), 
d.getVar('TUNE_FEATURES'), d)}"
+TARGET_GOMIPS = "${@go_map_mips(d.getVar('TARGET_ARCH'), 
d.getVar('TUNE_FEATURES'), d)}"
 TARGET_GOTUPLE = "${TARGET_GOOS}_${TARGET_GOARCH}"
 GO_BUILD_BINDIR = "${@['bin/${HOST_GOTUPLE}','bin'][d.getVar('BUILD_GOTUPLE') 
== d.getVar('HOST_GOTUPLE')]}"
 
@@ -78,6 +80,15 @@ def go_map_386(a, f, d):
 return '387'
 return ''
 
+def go_map_mips(a, f, d):
+import re
+if a == 'mips' or a == 'mipsel':
+if 'fpu-hard' in f:
+return 'hardfloat'
+else:
+return 'softfloat'
+return ''
+
 def go_map_os(o, d):
 if o.startswith('linux'):
 return 'linux'
diff --git a/meta/recipes-devtools/go/go-cross-canadian.inc 
b/meta/recipes-devtools/go/go-cross-canadian.inc
index e22914e7aa..4a43d831fa 100644
--- a/meta/recipes-devtools/go/go-cross-canadian.inc
+++ b/meta/recipes-devtools/go/go-cross-canadian.inc
@@ -41,6 +41,7 @@ export GOARCH="${TARGET_GOARCH}"
 export GOOS="${TARGET_GOOS}"
 test -n "\$GOARM" || export GOARM="${TARGET_GOARM}"
 test -n "\$GO386" || export GO386="${TARGET_GO386}"
+test -n "\$GOMIPS" || export GOMIPS="${TARGET_GOMIPS}"
 export GOTOOLDIR="\$native_goroot/pkg/tool/${HOST_GOTUPLE}"
 test -n "\$GOROOT" || export 
GOROOT="\$OECORE_TARGET_SYSROOT/${target_libdir}/go"
 \$here/../../lib/${TARGET_SYS}/go/bin/$1 "\$@"
diff --git a/meta/recipes-devtools/go/go-cross.inc 
b/meta/recipes-devtools/go/go-cross.inc
index fe92651581..289ae77104 100644
--- a/meta/recipes-devtools/go/go-cross.inc
+++ b/meta/recipes-devtools/go/go-cross.inc
@@ -11,6 +11,7 @@ export GOOS = "${TARGET_GOOS}"
 export GOARCH = "${TARGET_GOARCH}"
 export GOARM = "${TARGET_GOARM}"
 export GO386 = "${TARGET_GO386}"
+export GOMIPS = "${TARGET_GOMIPS}"
 export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
 export GOROOT_FINAL = "${libdir}/go"
 export GOCACHE = "off"
@@ -40,6 +41,7 @@ export GOARCH="${TARGET_GOARCH}"
 export GOOS="${TARGET_GOOS}"
 export GOARM="\${GOARM:-${TARGET_GOARM}}"
 export GO386="\${GO386:-${TARGET_GO386}}"
+export GOMIPS="\${GOMIPS:-${TARGET_GOMIPS}}"
 \$here/../../lib/${CROSS_TARGET_SYS_DIR}/go/bin/$1 "\$@"
 END
chmod +x ${D}${bindir}/$2
diff --git a/meta/recipes-devtools/go/go-runtime.inc 
b/meta/recipes-devtools/go/go-runtime.inc
index 7a3b415b3f..0fe4566360 100644
--- a/meta/recipes-devtools/go/go-runtime.inc
+++ b/meta/recipes-devtools/go/go-runtime.inc
@@ -8,6 +8,7 @@ export GOOS = "${TARGET_GOOS}"
 export GOARCH = "${TARGET_GOARCH}"
 export GOARM = "${TARGET_GOARM}"
 export GO386 = "${TARGET_GO386}"
+export GOMIPS = "${TARGET_GOMIPS}"
 export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
 export GOROOT_FINAL = "${libdir}/go"
 export CGO_ENABLED = "1"
diff --git a/meta/recipes-devtools/go/go-target.inc 
b/meta/recipes-devtools/go/go-target.inc
index a53a314c78..141a456cca 100644
--- a/meta/recipes-devtools/go/go-target.inc
+++ b/meta/recipes-devtools/go/go-target.inc
@@ -8,6 +8,7 @@ export GOOS = "${TARGET_GOOS}"
 export GOARCH = "${TARGET_GOARCH}"
 export GOARM = "${TARGET_GOARM}"
 export GO386 = "${TARGET_GO386}"
+export GOMIPS = "${TARGET_GOMIPS}"
 export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
 export GOROOT_FINAL = "${libdir}/go"
 export CGO_ENABLED = "1"
-- 
2.14.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v5 00/13] go1.10 update and misc improvements

2018-03-04 Thread Matt Madison
New in v5:
* Fixed build problem introduced in v3
  when *not* using security flags
* Added in a backported go source patch
  fixing a an aarch64 issue (via Khem)
* Updated the recipe changes to keep the
  1.9 recipes in place
* Added a GOVERSION setting to tcmode-default.inc
  to allow choosing 1.9 instead of 1.10
* Collapsed the '-v' removal patch, since
  it was really a fixup for an earlier
  patch in the series.

New in v4:
* updated the go source patch to protect
  GOROOT to defer generating an error
  until a build action would try to update
  something in GOROOT
* updated go.bbclass to compile for both
  static and dynamic linking, similar to
  go-runtime
* fixed missing sign-off

New in v3:
* reduced one of the go source patches,
  eliminating an unneeded change (thanks
  Otavio)
* Added bbclass and recipe patches to
  handle SECURITY_CFLAGS settings if
  they're enabled
* Added go-runtime-staticdev to target-side
  SDK, needed for go static builds (fixes
  test case failure in oe-selftest)
* two more minor cleanups

New in v2:
* Fixed Upstream-Status line in go patches
* Added GOTMPDIR to do_configure[dirs]

Updates to the go recipes and bbclasses for go1.10, which
moves the bulk of the toolchain bootstrap and build out
of the 'make.bash' script and to the 'dist' tool.  This
required a rework of the patches to the go source.

go1.10 introduces significant changes to the go build
tool as well, requiring some further patches to make
it work for OE builds.

See https://golang.org/doc/go1.10 for a complete list
of new features and changes.

Following the update are some cleanup/improvement
patches.

Matt Madison (13):
  go: update go 1.9 -> go 1.10
  go: set GOMIPS envrionment variable
  go.bbclass: rename GO_TMPDIR -> GOTMPDIR
  go.bbclass: remove debug-related commands
  go.bbclass: don't stage test data with sources
  go.bbclass: ptest cleanup and improvements
  goarch.bbclass: disable shared runtime for nativesdk builds
  go: move common settings to go-common.inc
  go.bbclass, goarch.bbclass: update SECURITY_CFLAGS
  go: disable PIE CFLAGS for nativesdk and cross-canadian builds
  packagegroup-go-sdk-target: add go-runtime-staticdev
  go-runtime: remove unneeded nativesdk override, rename variable
  tcmode-default.inc: add settings for go

 meta/classes/go.bbclass| 114 +
 meta/classes/goarch.bbclass|  14 ++
 meta/conf/distro/include/tcmode-default.inc|  10 +
 .../packagegroups/packagegroup-go-sdk-target.bb|   1 +
 meta/recipes-devtools/go/go-1.10.inc   |  22 ++
 ...1-allow-CC-and-CXX-to-have-multiple-words.patch |  33 +++
 ...-content-based-hash-generation-less-pedan.patch | 220 
 ...OLDIR-to-be-overridden-in-the-environment.patch |  64 +
 .../0004-ld-add-soname-to-shareable-objects.patch  |  47 
 ...verride-CC-when-building-dist-and-go_boot.patch |  40 +++
 ...-cmd-dist-separate-host-and-target-builds.patch | 277 +
 ...07-cmd-go-make-GOROOT-precious-by-default.patch | 108 
 ...l-obj-arm64-fix-branch-too-far-with-TBZ-l.patch |  58 +
 ...ld-replace-glibc-dynamic-linker-with-musl.patch | 130 ++
 meta/recipes-devtools/go/go-common.inc |   6 +
 meta/recipes-devtools/go/go-cross-canadian.inc |  26 +-
 meta/recipes-devtools/go/go-cross-canadian_1.10.bb |   2 +
 meta/recipes-devtools/go/go-cross-canadian_1.9.bb  |  10 +
 meta/recipes-devtools/go/go-cross.inc  |  56 ++---
 meta/recipes-devtools/go/go-cross_1.10.bb  |   2 +
 meta/recipes-devtools/go/go-cross_1.9.bb   |   8 +
 meta/recipes-devtools/go/go-crosssdk.inc   |  14 +-
 meta/recipes-devtools/go/go-crosssdk_1.10.bb   |   2 +
 meta/recipes-devtools/go/go-crosssdk_1.9.bb|   9 +
 meta/recipes-devtools/go/go-native.inc |  25 +-
 meta/recipes-devtools/go/go-native_1.10.bb |   2 +
 meta/recipes-devtools/go/go-native_1.9.bb  |   2 +
 meta/recipes-devtools/go/go-runtime.inc|  56 ++---
 meta/recipes-devtools/go/go-runtime_1.10.bb|   2 +
 meta/recipes-devtools/go/go-runtime_1.9.bb |  21 ++
 meta/recipes-devtools/go/go-target.inc |  24 +-
 meta/recipes-devtools/go/go_1.10.bb|   2 +
 meta/recipes-devtools/go/go_1.9.bb |  15 ++
 33 files changed, 1260 insertions(+), 162 deletions(-)
 create mode 100644 meta/recipes-devtools/go/go-1.10.inc
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0001-allow-CC-and-CXX-to-have-multiple-words.patch
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0

[OE-core] [PATCH v5 01/13] go: update go 1.9 -> go 1.10

2018-03-04 Thread Matt Madison
* Patches and recipes reworked for go 1.10's significant
  changes to its bootstrap and build steps.

* Update go1.4 source tarball used for go-native
  bootstrapping to the version recommended
  in the current go documentation

* Remove test data from installed sources to eliminate
  some packaging QA warnings

* Set GOCACHE to 'off' to disable 1.10's build caching
  in the go recipes and bbclass

* Update go_do_compile to compile both static and
  dynamic objects dynamic linking is in use, since
  go1.10's build tool is pickier about this

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/classes/go.bbclass|   6 +
 meta/recipes-devtools/go/go-1.10.inc   |  22 ++
 ...1-allow-CC-and-CXX-to-have-multiple-words.patch |  33 +++
 ...-content-based-hash-generation-less-pedan.patch | 220 
 ...OLDIR-to-be-overridden-in-the-environment.patch |  64 +
 .../0004-ld-add-soname-to-shareable-objects.patch  |  47 
 ...verride-CC-when-building-dist-and-go_boot.patch |  40 +++
 ...-cmd-dist-separate-host-and-target-builds.patch | 277 +
 ...07-cmd-go-make-GOROOT-precious-by-default.patch | 108 
 ...l-obj-arm64-fix-branch-too-far-with-TBZ-l.patch |  58 +
 ...ld-replace-glibc-dynamic-linker-with-musl.patch | 130 ++
 meta/recipes-devtools/go/go-common.inc |   2 +
 meta/recipes-devtools/go/go-cross-canadian.inc |  27 +-
 meta/recipes-devtools/go/go-cross-canadian_1.10.bb |   2 +
 meta/recipes-devtools/go/go-cross-canadian_1.9.bb  |  10 +
 meta/recipes-devtools/go/go-cross.inc  |  55 ++--
 meta/recipes-devtools/go/go-cross_1.10.bb  |   2 +
 meta/recipes-devtools/go/go-cross_1.9.bb   |   8 +
 meta/recipes-devtools/go/go-crosssdk.inc   |  16 +-
 meta/recipes-devtools/go/go-crosssdk_1.10.bb   |   2 +
 meta/recipes-devtools/go/go-crosssdk_1.9.bb|   9 +
 meta/recipes-devtools/go/go-native.inc |  26 +-
 meta/recipes-devtools/go/go-native_1.10.bb |   2 +
 meta/recipes-devtools/go/go-native_1.9.bb  |   2 +
 meta/recipes-devtools/go/go-runtime.inc|  58 +++--
 meta/recipes-devtools/go/go-runtime_1.10.bb|   2 +
 meta/recipes-devtools/go/go-runtime_1.9.bb |  21 ++
 meta/recipes-devtools/go/go-target.inc |  21 +-
 meta/recipes-devtools/go/go_1.10.bb|   2 +
 meta/recipes-devtools/go/go_1.9.bb |  15 ++
 30 files changed, 1183 insertions(+), 104 deletions(-)
 create mode 100644 meta/recipes-devtools/go/go-1.10.inc
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0001-allow-CC-and-CXX-to-have-multiple-words.patch
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0004-ld-add-soname-to-shareable-objects.patch
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0006-cmd-dist-separate-host-and-target-builds.patch
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0007-cmd-go-make-GOROOT-precious-by-default.patch
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0008-cmd-internal-obj-arm64-fix-branch-too-far-with-TBZ-l.patch
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0009-ld-replace-glibc-dynamic-linker-with-musl.patch
 create mode 100644 meta/recipes-devtools/go/go-cross-canadian_1.10.bb
 create mode 100644 meta/recipes-devtools/go/go-cross_1.10.bb
 create mode 100644 meta/recipes-devtools/go/go-crosssdk_1.10.bb
 create mode 100644 meta/recipes-devtools/go/go-native_1.10.bb
 create mode 100644 meta/recipes-devtools/go/go-runtime_1.10.bb
 create mode 100644 meta/recipes-devtools/go/go_1.10.bb

diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass
index 7ecd8c9254..a01b28bccd 100644
--- a/meta/classes/go.bbclass
+++ b/meta/classes/go.bbclass
@@ -24,6 +24,7 @@ GO_LINKMODE ?= ""
 GO_LINKMODE_class-nativesdk = "--linkmode=external"
 GO_LDFLAGS ?= '-ldflags="${GO_RPATH} ${GO_LINKMODE} -extldflags 
'${GO_EXTLDFLAGS}'"'
 export GOBUILDFLAGS ?= "-v ${GO_LDFLAGS}"
+export GOPATH_OMIT_IN_ACTIONID ?= "1"
 export GOPTESTBUILDFLAGS ?= "${GOBUILDFLAGS} -c"
 export GOPTESTFLAGS ?= "-test.v"
 GOBUILDFLAGS_prepend_task-compile = "${GO_PARALLEL_BUILD} "
@@ -47,6 +48,7 @@ GO_INSTALL_FILTEROUT ?= "${GO_IMPORT}/vendor/"
 
 B = "${WORKDIR}/build"
 export GOPATH = "${B}"
+export GOCACHE = "off"
 GO_TMPDIR ?= "${WORKDIR}/go-tmp"
 GO_TMPDIR[vardepvalue] = ""
 
@@ -88,6 +90,10 @@ go_do_compile() {
export TMPDIR="${GO_TMPDIR}"
${GO} env
  

Re: [OE-core] [PATCH v4 00/13] go1.10 update and misc improvements

2018-03-03 Thread Matt Madison
On Sat, Mar 3, 2018 at 8:40 AM, Khem Raj <raj.k...@gmail.com> wrote:
>
>
> On 3/2/18 12:33 PM, Matt Madison wrote:
>>
>> New in v4:
>>  * updated the go source patch to protect
>>GOROOT to defer generating an error
>>until a build action would try to update
>>something in GOROOT
>>  * updated go.bbclass to compile for both
>>static and dynamic linking, similar to
>>go-runtime
>>  * fixed missing sign-off
>>
>> New in v3:
>>  * reduced one of the go source patches,
>>eliminating an unneeded change (thanks
>>Otavio)
>>  * Added bbclass and recipe patches to
>>handle SECURITY_CFLAGS settings if
>>they're enabled
>>  * Added go-runtime-staticdev to target-side
>>SDK, needed for go static builds (fixes
>>test case failure in oe-selftest)
>>  * two more minor cleanups
>>
>> New in v2:
>>  * Fixed Upstream-Status line in go patches
>>  * Added GOTMPDIR to do_configure[dirs]
>>
>> Updates to the go recipes and bbclasses for go1.10, which
>> moves the bulk of the toolchain bootstrap and build out
>> of the 'make.bash' script and to the 'dist' tool.  This
>> required a rework of the patches to the go source.
>>
>> go1.10 introduces significant changes to the go build
>> tool as well, requiring some further patches to make
>> it work for OE builds.
>>
>> See https://golang.org/doc/go1.10 for a complete list
>> of new features and changes.
>>
>> Following the update are some cleanup/improvement
>> patches.
>>
>
> this patchset is addressing all previously reported issues so thanks for
> fixing them, I am now running into runtime crash issues on aarch64
> especially with influxdb but then influxdb does not claim go 1.10 support.
> That also raises a question if 1.9 should be kept along for a release for
> 1.10 migration path to get some more time. I would support keeping both for
> 2.5 release.

If there's general agreement on keeping both, I could see about
reworking the patch set to leave 1.9 in place.

> Additionally, I have sent couple of patches on top of this series which
> address a build issue I was seeing on aarch64 and introduces a class to use
> godep tool.

Since it looks like I'll have to do a v5 on my series anyway, I can
pull in that backport for the aarch64 issue.

Thanks,
-Matt

>
>
>> Matt Madison (13):
>>go: update go 1.9 -> go 1.10
>>go: set GOMIPS envrionment variable
>>go.bbclass: rename GO_TMPDIR -> GOTMPDIR
>>go.bbclass: remove debug-related commands
>>go.bbclass: don't stage test data with sources
>>go.bbclass: ptest cleanup and improvements
>>goarch.bbclass: disable shared runtime for nativesdk builds
>>go: move common settings to go-common.inc
>>go.bbclass, goarch.bbclass: update SECURITY_CFLAGS
>>go: disable PIE CFLAGS for nativesdk and cross-canadian builds
>>packagegroup-go-sdk-target: add go-runtime-staticdev
>>go-runtime: remove unneeded nativesdk override, rename variable
>>go-cross-canadian: remove verbosity setting from GO_LDFLAGS
>>
>>   meta/classes/go.bbclass| 112 +
>>   meta/classes/goarch.bbclass|  13 +
>>   .../packagegroups/packagegroup-go-sdk-target.bb|   1 +
>>   meta/recipes-devtools/go/go-1.10.inc   |  21 ++
>>   ...1-allow-CC-and-CXX-to-have-multiple-words.patch |  33 +++
>>   ...-content-based-hash-generation-less-pedan.patch | 220
>> 
>>   ...OLDIR-to-be-overridden-in-the-environment.patch |  64 +
>>   .../0004-ld-add-soname-to-shareable-objects.patch  |  47 
>>   ...verride-CC-when-building-dist-and-go_boot.patch |  40 +++
>>   ...-cmd-dist-separate-host-and-target-builds.patch | 277
>> +
>>   ...07-cmd-go-make-GOROOT-precious-by-default.patch | 108 
>>   ...ld-replace-glibc-dynamic-linker-with-musl.patch | 130 ++
>>   meta/recipes-devtools/go/go-1.9.inc|  26 --
>>   .../0001-make.bash-quote-CC_FOR_TARGET.patch   |  32 ---
>>   ...CC-and-CXX-environment-variable-construct.patch |  67 -
>>   ...sh-better-separate-host-and-target-builds.patch |  92 ---
>>   ...w-GOTOOLDIR-to-be-overridden-in-the-envir.patch |  68 -
>>   ...05-cmd-go-make-GOROOT-precious-by-default.patch |  41 ---
>>   ...dd-GOTOOLDIR_BOOTSTRAP-environment-variab.patch |  36 ---
>>   .../0007-ld-add-soname-to-shareable-objects.patch  |  4

Re: [OE-core] [PATCH v4 00/13] go1.10 update and misc improvements

2018-03-03 Thread Matt Madison
On Sat, Mar 3, 2018 at 8:53 AM, Richard Purdie
<richard.pur...@linuxfoundation.org> wrote:
> On Fri, 2018-03-02 at 12:33 -0800, Matt Madison wrote:
>> New in v4:
>> * updated the go source patch to protect
>>   GOROOT to defer generating an error
>>   until a build action would try to update
>>   something in GOROOT
>> * updated go.bbclass to compile for both
>>   static and dynamic linking, similar to
>>   go-runtime
>> * fixed missing sign-off
>>
>> New in v3:
>> * reduced one of the go source patches,
>>   eliminating an unneeded change (thanks
>>   Otavio)
>> * Added bbclass and recipe patches to
>>   handle SECURITY_CFLAGS settings if
>>   they're enabled
>> * Added go-runtime-staticdev to target-side
>>   SDK, needed for go static builds (fixes
>>   test case failure in oe-selftest)
>> * two more minor cleanups
>>
>> New in v2:
>> * Fixed Upstream-Status line in go patches
>> * Added GOTMPDIR to do_configure[dirs]
>
> I think there may be an issue still lurking somewhere with the PIE
> changes:
>
> https://autobuilder.yocto.io/builders/nightly-oe-selftest/builds/871/st
> eps/Running%20oe-selftest/logs/stdio

Yes, I see.  Works OK if security_flags.inc is included, but not
otherwise.  Will fix.

Thanks,
-Matt
>
> Cheers,
>
> Richard
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v4 13/13] go-cross-canadian: remove verbosity setting from GO_LDFLAGS

2018-03-02 Thread Matt Madison
This was another setting left over from debugging the
recipes, and isn't needed by default.

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/recipes-devtools/go/go-cross-canadian.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-devtools/go/go-cross-canadian.inc 
b/meta/recipes-devtools/go/go-cross-canadian.inc
index 1d6453712e..ea68b8875d 100644
--- a/meta/recipes-devtools/go/go-cross-canadian.inc
+++ b/meta/recipes-devtools/go/go-cross-canadian.inc
@@ -12,7 +12,7 @@ export GOTOOLDIR_BOOTSTRAP = 
"${STAGING_LIBDIR_NATIVE}/${HOST_SYS}/go/pkg/tool/$
 export GOROOT_FINAL = "${libdir}/go"
 export CGO_CFLAGS = "${CFLAGS}"
 export CGO_LDFLAGS = "${LDFLAGS}"
-export GO_LDFLAGS = '-v -linkmode external -extld ${HOST_PREFIX}gcc 
-extldflags "--sysroot=${STAGING_DIR_HOST} ${SECURITY_NOPIE_CFLAGS} 
${HOST_CC_ARCH} ${LDFLAGS}"'
+export GO_LDFLAGS = '-linkmode external -extld ${HOST_PREFIX}gcc -extldflags 
"--sysroot=${STAGING_DIR_HOST} ${SECURITY_NOPIE_CFLAGS} ${HOST_CC_ARCH} 
${LDFLAGS}"'
 
 do_configure[noexec] = "1"
 
-- 
2.14.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v4 12/13] go-runtime: remove unneeded nativesdk override, rename variable

2018-03-02 Thread Matt Madison
since GO_LDFLAGS is also used by the dist tool, and it's confusing
to use a variable with the same name (but not exported, so unused
by make.bash/dist).

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/recipes-devtools/go/go-runtime.inc | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/meta/recipes-devtools/go/go-runtime.inc 
b/meta/recipes-devtools/go/go-runtime.inc
index a79295df47..0041e8afab 100644
--- a/meta/recipes-devtools/go/go-runtime.inc
+++ b/meta/recipes-devtools/go/go-runtime.inc
@@ -17,9 +17,7 @@ export CGO_CXXFLAGS = "${CXXFLAGS}"
 export CGO_LDFLAGS = "${LDFLAGS}"
 
 GO_EXTLDFLAGS ?= "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} ${LDFLAGS}"
-GO_LINKMODE ?= ""
-GO_LINKMODE_class-nativesdk = "--linkmode=external"
-GO_LDFLAGS ?= '-ldflags="${GO_LINKMODE} -extldflags '${GO_EXTLDFLAGS}'"'
+GO_SHLIB_LDFLAGS ?= '-ldflags="--linkmode=external -extldflags 
'${GO_EXTLDFLAGS}'"'
 
 do_configure() {
:
@@ -38,7 +36,7 @@ do_compile() {
if [ -n "${GO_DYNLINK}" ]; then
export GOTOOLDIR="${B}/pkg/tool/native_native"
CC="$CC_FOR_${TARGET_GOOS}_${TARGET_GOARCH}" 
GOARCH="${TARGET_GOARCH}" GOOS="${TARGET_GOOS}" GOROOT=${B} \
-   $GOTOOLDIR/go_bootstrap install -linkshared 
-buildmode=shared ${GO_LDFLAGS} std
+   $GOTOOLDIR/go_bootstrap install -linkshared 
-buildmode=shared ${GO_SHLIB_LDFLAGS} std
fi
cd ${B}
 }
-- 
2.14.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v4 11/13] packagegroup-go-sdk-target: add go-runtime-staticdev

2018-03-02 Thread Matt Madison
to allow go programs to be linked either statically or
dynamically when cross-compiling with the SDK.

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/recipes-core/packagegroups/packagegroup-go-sdk-target.bb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/recipes-core/packagegroups/packagegroup-go-sdk-target.bb 
b/meta/recipes-core/packagegroups/packagegroup-go-sdk-target.bb
index 3e190770a7..7d2ccbda22 100644
--- a/meta/recipes-core/packagegroups/packagegroup-go-sdk-target.bb
+++ b/meta/recipes-core/packagegroups/packagegroup-go-sdk-target.bb
@@ -5,4 +5,5 @@ inherit packagegroup goarch
 RDEPENDS_${PN} = " \
 go-runtime \
 go-runtime-dev \
+go-runtime-staticdev \
 "
-- 
2.14.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v4 08/13] go: move common settings to go-common.inc

2018-03-02 Thread Matt Madison
Eliminate some redundancy in the recipes by moving
some commonly-used variable settings to the common
include file.  Also removed a duplicate inherit
from go-target.inc that was already in go-common.inc.

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/recipes-devtools/go/go-common.inc | 4 
 meta/recipes-devtools/go/go-cross-canadian.inc | 5 -
 meta/recipes-devtools/go/go-cross.inc  | 3 ---
 meta/recipes-devtools/go/go-crosssdk.inc   | 4 
 meta/recipes-devtools/go/go-native.inc | 4 
 meta/recipes-devtools/go/go-runtime.inc| 5 +
 meta/recipes-devtools/go/go-target.inc | 5 -
 7 files changed, 5 insertions(+), 25 deletions(-)

diff --git a/meta/recipes-devtools/go/go-common.inc 
b/meta/recipes-devtools/go/go-common.inc
index 611775b2cc..11d55c4d36 100644
--- a/meta/recipes-devtools/go/go-common.inc
+++ b/meta/recipes-devtools/go/go-common.inc
@@ -23,6 +23,10 @@ INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
 SSTATE_SCAN_CMD = "true"
 
 export GOROOT_OVERRIDE = "1"
+export GOTMPDIR ?= "${WORKDIR}/go-tmp"
+GOTMPDIR[vardepvalue] = ""
+export GOCACHE = "off"
+export CGO_ENABLED = "1"
 
 do_compile_prepend() {
BUILD_CC=${BUILD_CC}
diff --git a/meta/recipes-devtools/go/go-cross-canadian.inc 
b/meta/recipes-devtools/go/go-cross-canadian.inc
index 3b98ea449f..7a39e4509b 100644
--- a/meta/recipes-devtools/go/go-cross-canadian.inc
+++ b/meta/recipes-devtools/go/go-cross-canadian.inc
@@ -10,11 +10,6 @@ export GOHOSTARCH = "${BUILD_GOARCH}"
 export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
 export GOTOOLDIR_BOOTSTRAP = 
"${STAGING_LIBDIR_NATIVE}/${HOST_SYS}/go/pkg/tool/${BUILD_GOTUPLE}"
 export GOROOT_FINAL = "${libdir}/go"
-export CGO_ENABLED = "1"
-export GOCACHE = "off"
-export GOTMPDIR ?= "${WORKDIR}/go-tmp"
-GOTMPDIR[vardepvalue] = ""
-#CC = "${HOST_PREFIX}gcc"
 export CGO_CFLAGS = "${CFLAGS}"
 export CGO_LDFLAGS = "${LDFLAGS}"
 export GO_LDFLAGS = '-v -linkmode external -extld ${HOST_PREFIX}gcc 
-extldflags "--sysroot=${STAGING_DIR_HOST} ${HOST_CC_ARCH} ${LDFLAGS}"'
diff --git a/meta/recipes-devtools/go/go-cross.inc 
b/meta/recipes-devtools/go/go-cross.inc
index 289ae77104..44f230b8bc 100644
--- a/meta/recipes-devtools/go/go-cross.inc
+++ b/meta/recipes-devtools/go/go-cross.inc
@@ -15,9 +15,6 @@ export GOMIPS = "${TARGET_GOMIPS}"
 export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
 export GOROOT_FINAL = "${libdir}/go"
 export GOCACHE = "off"
-export GOTMPDIR ?= "${WORKDIR}/go-tmp"
-GOTMPDIR[vardepvalue] = ""
-export CGO_ENABLED = "1"
 CC = "${@d.getVar('BUILD_CC').strip()}"
 
 do_configure[noexec] = "1"
diff --git a/meta/recipes-devtools/go/go-crosssdk.inc 
b/meta/recipes-devtools/go/go-crosssdk.inc
index 05ca62eba8..4391b32424 100644
--- a/meta/recipes-devtools/go/go-crosssdk.inc
+++ b/meta/recipes-devtools/go/go-crosssdk.inc
@@ -10,10 +10,6 @@ export GOOS = "${TARGET_GOOS}"
 export GOARCH = "${TARGET_GOARCH}"
 export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
 export GOROOT_FINAL = "${libdir}/go"
-export CGO_ENABLED = "1"
-export GOCACHE = "off"
-export GOTMPDIR ?= "${WORKDIR}/go-tmp"
-GOTMPDIR[vardepvalue] = ""
 
 do_configure[noexec] = "1"
 
diff --git a/meta/recipes-devtools/go/go-native.inc 
b/meta/recipes-devtools/go/go-native.inc
index 31e899da82..5fbb72b087 100644
--- a/meta/recipes-devtools/go/go-native.inc
+++ b/meta/recipes-devtools/go/go-native.inc
@@ -10,12 +10,8 @@ SRC_URI[bootstrap.sha256sum] = 
"f4ff5b5eb3a3cae1c993723f3eab519c5bae18866b5e5f96
 
 export GOOS = "${BUILD_GOOS}"
 export GOARCH = "${BUILD_GOARCH}"
-export GOTMPDIR ?= "${WORKDIR}/go-tmp"
-GOTMPDIR[vardepvalue] = ""
 CC = "${@d.getVar('BUILD_CC').strip()}"
 
-export CGO_ENABLED = "1"
-
 do_configure() {
cd ${WORKDIR}/go1.4/go/src
CGO_ENABLED=0 GOROOT=${WORKDIR}/go1.4/go ./make.bash
diff --git a/meta/recipes-devtools/go/go-runtime.inc 
b/meta/recipes-devtools/go/go-runtime.inc
index 0fe4566360..a79295df47 100644
--- a/meta/recipes-devtools/go/go-runtime.inc
+++ b/meta/recipes-devtools/go/go-runtime.inc
@@ -11,14 +11,11 @@ export GO386 = "${TARGET_GO386}"
 export GOMIPS = "${TARGET_GOMIPS}"
 export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
 export GOROOT_FINAL = "${libdir}/go"
-export CGO_ENABLED = "1"
 export CGO_CFLAGS = "${CFLAGS}"
 export CGO_CPPFLAGS = "${CPPFLAGS}"
 export CGO_CXXFLAGS = "${CXXFLAGS}"
 export CGO_LDFLAGS = "${LDFLAGS}"
-export GOCACHE = "off"
-export GOTMPDIR ?= &quo

[OE-core] [PATCH v4 07/13] goarch.bbclass: disable shared runtime for nativesdk builds

2018-03-02 Thread Matt Madison
While useful on embedded devices for saving disk space, use
of shared runtime in Go is not the usual practice, so disable
it for nativesdk builds.  We don't use it for native builds,
either, so this makes the SDK match the native environment
more closely.

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/classes/goarch.bbclass | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/classes/goarch.bbclass b/meta/classes/goarch.bbclass
index 1021b94d4c..5c8ed33b15 100644
--- a/meta/classes/goarch.bbclass
+++ b/meta/classes/goarch.bbclass
@@ -24,6 +24,7 @@ GO_DYNLINK_x86 = "1"
 GO_DYNLINK_x86-64 = "1"
 GO_DYNLINK_powerpc64 = "1"
 GO_DYNLINK_class-native = ""
+GO_DYNLINK_class-nativesdk = ""
 
 # define here because everybody inherits this class
 #
-- 
2.14.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v4 10/13] go: disable PIE CFLAGS for nativesdk and cross-canadian builds

2018-03-02 Thread Matt Madison
The statically-linked Go code in the toolchain is not compatible
with PIE, so disable its use in the C compiler during the
toolchain build.

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/recipes-devtools/go/go-cross-canadian.inc | 6 +++---
 meta/recipes-devtools/go/go-target.inc | 3 +--
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/meta/recipes-devtools/go/go-cross-canadian.inc 
b/meta/recipes-devtools/go/go-cross-canadian.inc
index 7a39e4509b..1d6453712e 100644
--- a/meta/recipes-devtools/go/go-cross-canadian.inc
+++ b/meta/recipes-devtools/go/go-cross-canadian.inc
@@ -12,13 +12,13 @@ export GOTOOLDIR_BOOTSTRAP = 
"${STAGING_LIBDIR_NATIVE}/${HOST_SYS}/go/pkg/tool/$
 export GOROOT_FINAL = "${libdir}/go"
 export CGO_CFLAGS = "${CFLAGS}"
 export CGO_LDFLAGS = "${LDFLAGS}"
-export GO_LDFLAGS = '-v -linkmode external -extld ${HOST_PREFIX}gcc 
-extldflags "--sysroot=${STAGING_DIR_HOST} ${HOST_CC_ARCH} ${LDFLAGS}"'
+export GO_LDFLAGS = '-v -linkmode external -extld ${HOST_PREFIX}gcc 
-extldflags "--sysroot=${STAGING_DIR_HOST} ${SECURITY_NOPIE_CFLAGS} 
${HOST_CC_ARCH} ${LDFLAGS}"'
 
 do_configure[noexec] = "1"
 
 do_compile() {
-   export CC_FOR_${HOST_GOOS}_${HOST_GOARCH}="${HOST_PREFIX}gcc 
--sysroot=${STAGING_DIR_HOST}${SDKPATHNATIVE}"
-   export CXX_FOR_${HOST_GOOS}_${HOST_GOARCH}="${HOST_PREFIX}gxx 
--sysroot=${STAGING_DIR_HOST}${SDKPATHNATIVE}"
+   export CC_FOR_${HOST_GOOS}_${HOST_GOARCH}="${HOST_PREFIX}gcc 
--sysroot=${STAGING_DIR_HOST}${SDKPATHNATIVE} ${SECURITY_NOPIE_CFLAGS}"
+   export CXX_FOR_${HOST_GOOS}_${HOST_GOARCH}="${HOST_PREFIX}gxx 
--sysroot=${STAGING_DIR_HOST}${SDKPATHNATIVE} ${SECURITY_NOPIE_CFLAGS}"
cd src
./make.bash --host-only --no-banner
cd ${B}
diff --git a/meta/recipes-devtools/go/go-target.inc 
b/meta/recipes-devtools/go/go-target.inc
index 3bc32f3bec..29a1344675 100644
--- a/meta/recipes-devtools/go/go-target.inc
+++ b/meta/recipes-devtools/go/go-target.inc
@@ -14,8 +14,7 @@ GO_LDFLAGS = ""
 GO_LDFLAGS_class-nativesdk = "-linkmode external"
 export GO_LDFLAGS
 
-SECURITY_CFLAGS = "${SECURITY_NOPIE_CFLAGS}"
-SECURITY_LDFLAGS = ""
+CC_append_class-nativesdk = " ${SECURITY_NOPIE_CFLAGS}"
 
 do_configure[noexec] = "1"
 
-- 
2.14.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v4 06/13] go.bbclass: ptest cleanup and improvements

2018-03-02 Thread Matt Madison
* Don't enable verbose test output (-test.v)
  by default, as it generates too much noise
  for automated results parsing

* Override do_install_ptest_base in the bbclass,
  so recipes can provide their own modifications
  with do_install_ptest.

* Improve the generated run-ptest script to better
  handle large numbers of tests, and to generate
  'status: test name' output similar to Automake
  tests.

* Install all non-vendored 'testdata' directories
  from the source into the ptest package, as some
  packages share test data among multiple tests.

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/classes/go.bbclass | 87 +
 1 file changed, 51 insertions(+), 36 deletions(-)

diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass
index 2f196b487c..010914c307 100644
--- a/meta/classes/go.bbclass
+++ b/meta/classes/go.bbclass
@@ -26,7 +26,7 @@ GO_LDFLAGS ?= '-ldflags="${GO_RPATH} ${GO_LINKMODE} 
-extldflags '${GO_EXTLDFLAGS
 export GOBUILDFLAGS ?= "-v ${GO_LDFLAGS}"
 export GOPATH_OMIT_IN_ACTIONID ?= "1"
 export GOPTESTBUILDFLAGS ?= "${GOBUILDFLAGS} -c"
-export GOPTESTFLAGS ?= "-test.v"
+export GOPTESTFLAGS ?= ""
 GOBUILDFLAGS_prepend_task-compile = "${GO_PARALLEL_BUILD} "
 
 export GO = "${HOST_PREFIX}go"
@@ -76,7 +76,7 @@ go_list_packages() {
 }
 
 go_list_package_tests() {
-${GO} list -f '{{.ImportPath}} {{.TestGoFiles}}' ${GOBUILDFLAGS} 
${GO_INSTALL} | \
+   ${GO} list -f '{{.ImportPath}} {{.TestGoFiles}}' ${GOBUILDFLAGS} 
${GO_INSTALL} | \
grep -v '\[\]$' | \
egrep -v '${GO_INSTALL_FILTEROUT}' | \
awk '{ print $1 }'
@@ -99,14 +99,15 @@ go_do_compile() {
 do_compile[dirs] =+ "${GOTMPDIR}"
 do_compile[cleandirs] = "${B}/bin ${B}/pkg"
 
-do_compile_ptest() {
-rm -f ${B}/.go_compiled_tests.list
+do_compile_ptest_base() {
+   rm -f ${B}/.go_compiled_tests.list
go_list_package_tests | while read pkg; do
cd ${B}/src/$pkg
${GO} test ${GOPTESTBUILDFLAGS} $pkg
find . -mindepth 1 -maxdepth 1 -type f -name '*.test' -exec 
echo $pkg/{} \; | \
sed -e's,/\./,/,'>> ${B}/.go_compiled_tests.list
done
+   do_compile_ptest
 }
 do_compile_ptest_base[dirs] =+ "${GOTMPDIR}"
 
@@ -122,40 +123,54 @@ go_do_install() {
fi
 }
 
-do_install_ptest_base() {
-test -f "${B}/.go_compiled_tests.list" || exit 0
-tests=""
-while read test; do
-tests="$tests${tests:+ }${test%.test}"
-testdir=`dirname $test`
-install -d ${D}${PTEST_PATH}/$testdir
-install -m 0755 ${B}/src/$test ${D}${PTEST_PATH}/$test
-if [ -d "${B}/src/$testdir/testdata" ]; then
-cp --preserve=mode,timestamps -R "${B}/src/$testdir/testdata" 
${D}${PTEST_PATH}/$testdir
-fi
-done < ${B}/.go_compiled_tests.list
-if [ -n "$tests" ]; then
-install -d ${D}${PTEST_PATH}
-cat >${D}${PTEST_PATH}/run-ptest <${D}${PTEST_PATH}/run-ptest <&1; then
-ANYFAILED=1
-fi
-done
-if [ \$ANYFAILED -ne 0 ]; then
-echo "FAIL: ${PN}"
-exit 1
-fi
-echo "PASS: ${PN}"
-exit 0
+RC=0
+run_test() (
+cd "\$1"
+./\$2 ${GOPTESTFLAGS}; echo \$? >&3) | sed -r 
-e"s,^(PASS|SKIP|FAIL)\$,\\1: \$1/\$2," >&4) 3>&1) | (read rc; exit \$rc)) 4>&1
+exit \$?)
 EOF
-chmod +x ${D}${PTEST_PATH}/run-ptest
-else
-rm -rf ${D}${PTEST_PATH}
-fi
+
+}
+
+go_stage_testdata() {
+   oldwd="$PWD"
+   cd ${S}/src
+   find ${GO_IMPORT} -depth -type d -name testdata | while read d; do
+   if echo "$d" | grep -q '/vendor/'; then
+   continue
+   fi
+   parent=`dirname $d`
+   install -d ${D}${PTEST_PATH}/$parent
+   cp --preserve=mode,timestamps -R $d ${D}${PTEST_PATH}/$parent/
+   done
+   cd "$oldwd"
+}
+
+do_install_ptest_base() {
+   test -f "${B}/.go_compiled_tests.list" || exit 0
+   install -d ${D}${PTEST_PATH}
+   go_stage_testdata
+   go_make_ptest_wrapper
+   havetests=""
+   while read test; do
+   testdir=`dirname $test`
+   testprog=`basename $test`
+   install -d ${D}${PTEST_PATH}/$testdir
+   install -m 0755 ${B}/src/$test ${D}${PTEST_PATH}/$test
+   echo "run_test $testdir $testprog || RC=1" >> 
${D}${PTEST_PATH}/run-ptest
+   havetests="yes"
+   done < ${B}/.go_compiled_tests.list
+   if [ -n "$havetests" ]; then
+   echo "exit \$RC" >> ${D}${PTEST_PATH}/run-ptest
+ 

[OE-core] [PATCH v4 09/13] go.bbclass, goarch.bbclass: update SECURITY_CFLAGS

2018-03-02 Thread Matt Madison
With go1.10 the NOPIE flags are only required for
MIPS target builds, and are now incompatible for
the other architectures.

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/classes/go.bbclass | 3 ---
 meta/classes/goarch.bbclass | 1 +
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass
index 010914c307..821095a63c 100644
--- a/meta/classes/go.bbclass
+++ b/meta/classes/go.bbclass
@@ -34,9 +34,6 @@ GOTOOLDIR = 
"${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go/pkg/tool/${BUILD_GOTUPLE}
 GOTOOLDIR_class-native = 
"${STAGING_LIBDIR_NATIVE}/go/pkg/tool/${BUILD_GOTUPLE}"
 export GOTOOLDIR
 
-SECURITY_CFLAGS = "${SECURITY_NOPIE_CFLAGS}"
-SECURITY_LDFLAGS = ""
-
 export CGO_ENABLED ?= "1"
 export CGO_CFLAGS ?= "${CFLAGS}"
 export CGO_CPPFLAGS ?= "${CPPFLAGS}"
diff --git a/meta/classes/goarch.bbclass b/meta/classes/goarch.bbclass
index 5c8ed33b15..eb8b32d35b 100644
--- a/meta/classes/goarch.bbclass
+++ b/meta/classes/goarch.bbclass
@@ -35,6 +35,7 @@ COMPATIBLE_HOST_powerpc64 = "null"
 COMPATIBLE_HOST_mipsarchn32 = "null"
 ARM_INSTRUCTION_SET = "arm"
 TUNE_CCARGS_remove = "-march=mips32r2"
+SECURITY_CFLAGS_mips = "${SECURITY_NOPIE_CFLAGS}"
 
 def go_map_arch(a, d):
 import re
-- 
2.14.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v4 05/13] go.bbclass: don't stage test data with sources

2018-03-02 Thread Matt Madison
Any directory in a Go package's source tree called
'testdata' contains test data, and isn't necessary
for building.

Some packages include ELF files and other binaries
as test data, and staging them in the sysroot and
-dev package leads to unnecessary QA warnings.

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/classes/go.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass
index 33a6fff0cd..2f196b487c 100644
--- a/meta/classes/go.bbclass
+++ b/meta/classes/go.bbclass
@@ -112,7 +112,7 @@ do_compile_ptest_base[dirs] =+ "${GOTMPDIR}"
 
 go_do_install() {
install -d ${D}${libdir}/go/src/${GO_IMPORT}
-   tar -C ${S}/src/${GO_IMPORT} -cf - --exclude-vcs --exclude '*.test' . | 
\
+   tar -C ${S}/src/${GO_IMPORT} -cf - --exclude-vcs --exclude '*.test' 
--exclude 'testdata' . | \
tar -C ${D}${libdir}/go/src/${GO_IMPORT} --no-same-owner -xf -
tar -C ${B} -cf - pkg | tar -C ${D}${libdir}/go --no-same-owner -xf -
 
-- 
2.14.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v4 04/13] go.bbclass: remove debug-related commands

2018-03-02 Thread Matt Madison
The 'go env' in the do_compile function and
the set -x/+x in the do_install_ptest function
were used for debugging the bbclass, and aren't
really needed.

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/classes/go.bbclass | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass
index 805d92e101..33a6fff0cd 100644
--- a/meta/classes/go.bbclass
+++ b/meta/classes/go.bbclass
@@ -88,7 +88,6 @@ go_do_configure() {
 do_configure[dirs] =+ "${GOTMPDIR}"
 
 go_do_compile() {
-   ${GO} env
if [ -n "${GO_INSTALL}" ]; then
if [ -n "${GO_LINKSHARED}" ]; then
${GO} install ${GOBUILDFLAGS} `go_list_packages`
@@ -124,7 +123,6 @@ go_do_install() {
 }
 
 do_install_ptest_base() {
-set -x
 test -f "${B}/.go_compiled_tests.list" || exit 0
 tests=""
 while read test; do
@@ -158,7 +156,6 @@ EOF
 else
 rm -rf ${D}${PTEST_PATH}
 fi
-set +x
 }
 
 EXPORT_FUNCTIONS do_unpack do_configure do_compile do_install
-- 
2.14.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v4 00/13] go1.10 update and misc improvements

2018-03-02 Thread Matt Madison
New in v4:
* updated the go source patch to protect
  GOROOT to defer generating an error
  until a build action would try to update
  something in GOROOT
* updated go.bbclass to compile for both
  static and dynamic linking, similar to
  go-runtime
* fixed missing sign-off

New in v3:
* reduced one of the go source patches,
  eliminating an unneeded change (thanks
  Otavio)
* Added bbclass and recipe patches to
  handle SECURITY_CFLAGS settings if
  they're enabled
* Added go-runtime-staticdev to target-side
  SDK, needed for go static builds (fixes
  test case failure in oe-selftest)
* two more minor cleanups

New in v2:
* Fixed Upstream-Status line in go patches
* Added GOTMPDIR to do_configure[dirs]

Updates to the go recipes and bbclasses for go1.10, which
moves the bulk of the toolchain bootstrap and build out
of the 'make.bash' script and to the 'dist' tool.  This
required a rework of the patches to the go source.

go1.10 introduces significant changes to the go build
tool as well, requiring some further patches to make
it work for OE builds.

See https://golang.org/doc/go1.10 for a complete list
of new features and changes.

Following the update are some cleanup/improvement
patches.

Matt Madison (13):
  go: update go 1.9 -> go 1.10
  go: set GOMIPS envrionment variable
  go.bbclass: rename GO_TMPDIR -> GOTMPDIR
  go.bbclass: remove debug-related commands
  go.bbclass: don't stage test data with sources
  go.bbclass: ptest cleanup and improvements
  goarch.bbclass: disable shared runtime for nativesdk builds
  go: move common settings to go-common.inc
  go.bbclass, goarch.bbclass: update SECURITY_CFLAGS
  go: disable PIE CFLAGS for nativesdk and cross-canadian builds
  packagegroup-go-sdk-target: add go-runtime-staticdev
  go-runtime: remove unneeded nativesdk override, rename variable
  go-cross-canadian: remove verbosity setting from GO_LDFLAGS

 meta/classes/go.bbclass| 112 +
 meta/classes/goarch.bbclass|  13 +
 .../packagegroups/packagegroup-go-sdk-target.bb|   1 +
 meta/recipes-devtools/go/go-1.10.inc   |  21 ++
 ...1-allow-CC-and-CXX-to-have-multiple-words.patch |  33 +++
 ...-content-based-hash-generation-less-pedan.patch | 220 
 ...OLDIR-to-be-overridden-in-the-environment.patch |  64 +
 .../0004-ld-add-soname-to-shareable-objects.patch  |  47 
 ...verride-CC-when-building-dist-and-go_boot.patch |  40 +++
 ...-cmd-dist-separate-host-and-target-builds.patch | 277 +
 ...07-cmd-go-make-GOROOT-precious-by-default.patch | 108 
 ...ld-replace-glibc-dynamic-linker-with-musl.patch | 130 ++
 meta/recipes-devtools/go/go-1.9.inc|  26 --
 .../0001-make.bash-quote-CC_FOR_TARGET.patch   |  32 ---
 ...CC-and-CXX-environment-variable-construct.patch |  67 -
 ...sh-better-separate-host-and-target-builds.patch |  92 ---
 ...w-GOTOOLDIR-to-be-overridden-in-the-envir.patch |  68 -
 ...05-cmd-go-make-GOROOT-precious-by-default.patch |  41 ---
 ...dd-GOTOOLDIR_BOOTSTRAP-environment-variab.patch |  36 ---
 .../0007-ld-add-soname-to-shareable-objects.patch  |  46 
 ...dd-GOHOSTxx-indirection-for-cross-canadia.patch |  33 ---
 ...dmode-pie-forces-external-linking-mode-on.patch |  47 
 ...verride-CC-when-building-dist-and-go_boot.patch |  43 
 .../go/go-1.9/set-external-linker.patch| 111 -
 meta/recipes-devtools/go/go-common.inc |   6 +
 meta/recipes-devtools/go/go-cross-canadian.inc |  26 +-
 ...s-canadian_1.9.bb => go-cross-canadian_1.10.bb} |   0
 meta/recipes-devtools/go/go-cross.inc  |  56 ++---
 .../go/{go-cross_1.9.bb => go-cross_1.10.bb}   |   0
 meta/recipes-devtools/go/go-crosssdk.inc   |  14 +-
 .../go/{go-crosssdk_1.9.bb => go-crosssdk_1.10.bb} |   0
 meta/recipes-devtools/go/go-native.inc |  25 +-
 .../go/{go-native_1.9.bb => go-native_1.10.bb} |   0
 meta/recipes-devtools/go/go-runtime.inc|  56 ++---
 .../go/{go-runtime_1.9.bb => go-runtime_1.10.bb}   |   0
 meta/recipes-devtools/go/go-target.inc |  24 +-
 meta/recipes-devtools/go/{go_1.9.bb => go_1.10.bb} |   0
 37 files changed, 1110 insertions(+), 805 deletions(-)
 create mode 100644 meta/recipes-devtools/go/go-1.10.inc
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0001-allow-CC-and-CXX-to-have-multiple-words.patch
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0004-ld-add-soname-to-shareable-objects.patch
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch
 

[OE-core] [PATCH v4 03/13] go.bbclass: rename GO_TMPDIR -> GOTMPDIR

2018-03-02 Thread Matt Madison
and export it. Go 1.10 now supports using this
separate variable locating its temporary files,
so TMPDIR doesn't have to be modified.

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/classes/go.bbclass | 11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass
index a01b28bccd..805d92e101 100644
--- a/meta/classes/go.bbclass
+++ b/meta/classes/go.bbclass
@@ -49,8 +49,8 @@ GO_INSTALL_FILTEROUT ?= "${GO_IMPORT}/vendor/"
 B = "${WORKDIR}/build"
 export GOPATH = "${B}"
 export GOCACHE = "off"
-GO_TMPDIR ?= "${WORKDIR}/go-tmp"
-GO_TMPDIR[vardepvalue] = ""
+export GOTMPDIR ?= "${WORKDIR}/go-tmp"
+GOTMPDIR[vardepvalue] = ""
 
 python go_do_unpack() {
 src_uri = (d.getVar('SRC_URI') or "").split()
@@ -85,9 +85,9 @@ go_list_package_tests() {
 go_do_configure() {
ln -snf ${S}/src ${B}/
 }
+do_configure[dirs] =+ "${GOTMPDIR}"
 
 go_do_compile() {
-   export TMPDIR="${GO_TMPDIR}"
${GO} env
if [ -n "${GO_INSTALL}" ]; then
if [ -n "${GO_LINKSHARED}" ]; then
@@ -97,11 +97,10 @@ go_do_compile() {
${GO} install ${GO_LINKSHARED} ${GOBUILDFLAGS} 
`go_list_packages`
fi
 }
-do_compile[dirs] =+ "${GO_TMPDIR}"
+do_compile[dirs] =+ "${GOTMPDIR}"
 do_compile[cleandirs] = "${B}/bin ${B}/pkg"
 
 do_compile_ptest() {
-export TMPDIR="${GO_TMPDIR}"
 rm -f ${B}/.go_compiled_tests.list
go_list_package_tests | while read pkg; do
cd ${B}/src/$pkg
@@ -110,7 +109,7 @@ do_compile_ptest() {
sed -e's,/\./,/,'>> ${B}/.go_compiled_tests.list
done
 }
-do_compile_ptest_base[dirs] =+ "${GO_TMPDIR}"
+do_compile_ptest_base[dirs] =+ "${GOTMPDIR}"
 
 go_do_install() {
install -d ${D}${libdir}/go/src/${GO_IMPORT}
-- 
2.14.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v4 02/13] go: set GOMIPS envrionment variable

2018-03-02 Thread Matt Madison
Go 1.10 adds support for selecting hard/soft float
object code through the GOMIPS environment variable.

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/classes/goarch.bbclass| 11 +++
 meta/recipes-devtools/go/go-cross-canadian.inc |  1 +
 meta/recipes-devtools/go/go-cross.inc  |  2 ++
 meta/recipes-devtools/go/go-runtime.inc|  1 +
 meta/recipes-devtools/go/go-target.inc |  1 +
 5 files changed, 16 insertions(+)

diff --git a/meta/classes/goarch.bbclass b/meta/classes/goarch.bbclass
index 922c0cc8f3..1021b94d4c 100644
--- a/meta/classes/goarch.bbclass
+++ b/meta/classes/goarch.bbclass
@@ -5,11 +5,13 @@ HOST_GOOS = "${@go_map_os(d.getVar('HOST_OS'), d)}"
 HOST_GOARCH = "${@go_map_arch(d.getVar('HOST_ARCH'), d)}"
 HOST_GOARM = "${@go_map_arm(d.getVar('HOST_ARCH'), d.getVar('TUNE_FEATURES'), 
d)}"
 HOST_GO386 = "${@go_map_386(d.getVar('HOST_ARCH'), d.getVar('TUNE_FEATURES'), 
d)}"
+HOST_GOMIPS = "${@go_map_mips(d.getVar('HOST_ARCH'), 
d.getVar('TUNE_FEATURES'), d)}"
 HOST_GOTUPLE = "${HOST_GOOS}_${HOST_GOARCH}"
 TARGET_GOOS = "${@go_map_os(d.getVar('TARGET_OS'), d)}"
 TARGET_GOARCH = "${@go_map_arch(d.getVar('TARGET_ARCH'), d)}"
 TARGET_GOARM = "${@go_map_arm(d.getVar('TARGET_ARCH'), 
d.getVar('TUNE_FEATURES'), d)}"
 TARGET_GO386 = "${@go_map_386(d.getVar('TARGET_ARCH'), 
d.getVar('TUNE_FEATURES'), d)}"
+TARGET_GOMIPS = "${@go_map_mips(d.getVar('TARGET_ARCH'), 
d.getVar('TUNE_FEATURES'), d)}"
 TARGET_GOTUPLE = "${TARGET_GOOS}_${TARGET_GOARCH}"
 GO_BUILD_BINDIR = "${@['bin/${HOST_GOTUPLE}','bin'][d.getVar('BUILD_GOTUPLE') 
== d.getVar('HOST_GOTUPLE')]}"
 
@@ -78,6 +80,15 @@ def go_map_386(a, f, d):
 return '387'
 return ''
 
+def go_map_mips(a, f, d):
+import re
+if a == 'mips' or a == 'mipsel':
+if 'fpu-hard' in f:
+return 'hardfloat'
+else:
+return 'softfloat'
+return ''
+
 def go_map_os(o, d):
 if o.startswith('linux'):
 return 'linux'
diff --git a/meta/recipes-devtools/go/go-cross-canadian.inc 
b/meta/recipes-devtools/go/go-cross-canadian.inc
index c84aa4c9eb..3b98ea449f 100644
--- a/meta/recipes-devtools/go/go-cross-canadian.inc
+++ b/meta/recipes-devtools/go/go-cross-canadian.inc
@@ -42,6 +42,7 @@ export GOARCH="${TARGET_GOARCH}"
 export GOOS="${TARGET_GOOS}"
 test -n "\$GOARM" || export GOARM="${TARGET_GOARM}"
 test -n "\$GO386" || export GO386="${TARGET_GO386}"
+test -n "\$GOMIPS" || export GOMIPS="${TARGET_GOMIPS}"
 export GOTOOLDIR="\$native_goroot/pkg/tool/${HOST_GOTUPLE}"
 test -n "\$GOROOT" || export 
GOROOT="\$OECORE_TARGET_SYSROOT/${target_libdir}/go"
 \$here/../../lib/${TARGET_SYS}/go/bin/$1 "\$@"
diff --git a/meta/recipes-devtools/go/go-cross.inc 
b/meta/recipes-devtools/go/go-cross.inc
index fe92651581..289ae77104 100644
--- a/meta/recipes-devtools/go/go-cross.inc
+++ b/meta/recipes-devtools/go/go-cross.inc
@@ -11,6 +11,7 @@ export GOOS = "${TARGET_GOOS}"
 export GOARCH = "${TARGET_GOARCH}"
 export GOARM = "${TARGET_GOARM}"
 export GO386 = "${TARGET_GO386}"
+export GOMIPS = "${TARGET_GOMIPS}"
 export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
 export GOROOT_FINAL = "${libdir}/go"
 export GOCACHE = "off"
@@ -40,6 +41,7 @@ export GOARCH="${TARGET_GOARCH}"
 export GOOS="${TARGET_GOOS}"
 export GOARM="\${GOARM:-${TARGET_GOARM}}"
 export GO386="\${GO386:-${TARGET_GO386}}"
+export GOMIPS="\${GOMIPS:-${TARGET_GOMIPS}}"
 \$here/../../lib/${CROSS_TARGET_SYS_DIR}/go/bin/$1 "\$@"
 END
chmod +x ${D}${bindir}/$2
diff --git a/meta/recipes-devtools/go/go-runtime.inc 
b/meta/recipes-devtools/go/go-runtime.inc
index 7a3b415b3f..0fe4566360 100644
--- a/meta/recipes-devtools/go/go-runtime.inc
+++ b/meta/recipes-devtools/go/go-runtime.inc
@@ -8,6 +8,7 @@ export GOOS = "${TARGET_GOOS}"
 export GOARCH = "${TARGET_GOARCH}"
 export GOARM = "${TARGET_GOARM}"
 export GO386 = "${TARGET_GO386}"
+export GOMIPS = "${TARGET_GOMIPS}"
 export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
 export GOROOT_FINAL = "${libdir}/go"
 export CGO_ENABLED = "1"
diff --git a/meta/recipes-devtools/go/go-target.inc 
b/meta/recipes-devtools/go/go-target.inc
index a53a314c78..141a456cca 100644
--- a/meta/recipes-devtools/go/go-target.inc
+++ b/meta/recipes-devtools/go/go-target.inc
@@ -8,6 +8,7 @@ export GOOS = "${TARGET_GOOS}"
 export GOARCH = "${TARGET_GOARCH}"
 export GOARM = "${TARGET_GOARM}"
 export GO386 = "${TARGET_GO386}"
+export GOMIPS = "${TARGET_GOMIPS}"
 export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
 export GOROOT_FINAL = "${libdir}/go"
 export CGO_ENABLED = "1"
-- 
2.14.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v4 01/13] go: update go 1.9 -> go 1.10

2018-03-02 Thread Matt Madison
* Patches and recipes reworked for go 1.10's significant
  changes to its bootstrap and build steps

* Update go1.4 source tarball used for go-native
  bootstrapping to the version recommended
  in the current go documentation

* Remove test data from installed sources to eliminate
  some packaging QA warnings

* Set GOCACHE to 'off' to disable 1.10's build caching
  in the go recipes and bbclass

* Update go_do_compile to compile both static and
  dynamic objects dynamic linking is in use, since
  go1.10's build tool is pickier about this

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/classes/go.bbclass|   6 +
 meta/recipes-devtools/go/go-1.10.inc   |  21 ++
 ...1-allow-CC-and-CXX-to-have-multiple-words.patch |  33 +++
 ...-content-based-hash-generation-less-pedan.patch | 220 
 ...OLDIR-to-be-overridden-in-the-environment.patch |  64 +
 .../0004-ld-add-soname-to-shareable-objects.patch  |  47 
 ...verride-CC-when-building-dist-and-go_boot.patch |  40 +++
 ...-cmd-dist-separate-host-and-target-builds.patch | 277 +
 ...07-cmd-go-make-GOROOT-precious-by-default.patch | 108 
 ...ld-replace-glibc-dynamic-linker-with-musl.patch | 130 ++
 meta/recipes-devtools/go/go-1.9.inc|  26 --
 .../0001-make.bash-quote-CC_FOR_TARGET.patch   |  32 ---
 ...CC-and-CXX-environment-variable-construct.patch |  67 -
 ...sh-better-separate-host-and-target-builds.patch |  92 ---
 ...w-GOTOOLDIR-to-be-overridden-in-the-envir.patch |  68 -
 ...05-cmd-go-make-GOROOT-precious-by-default.patch |  41 ---
 ...dd-GOTOOLDIR_BOOTSTRAP-environment-variab.patch |  36 ---
 .../0007-ld-add-soname-to-shareable-objects.patch  |  46 
 ...dd-GOHOSTxx-indirection-for-cross-canadia.patch |  33 ---
 ...dmode-pie-forces-external-linking-mode-on.patch |  47 
 ...verride-CC-when-building-dist-and-go_boot.patch |  43 
 .../go/go-1.9/set-external-linker.patch| 111 -
 meta/recipes-devtools/go/go-common.inc |   2 +
 meta/recipes-devtools/go/go-cross-canadian.inc |  28 +--
 ...s-canadian_1.9.bb => go-cross-canadian_1.10.bb} |   0
 meta/recipes-devtools/go/go-cross.inc  |  55 ++--
 .../go/{go-cross_1.9.bb => go-cross_1.10.bb}   |   0
 meta/recipes-devtools/go/go-crosssdk.inc   |  16 +-
 .../go/{go-crosssdk_1.9.bb => go-crosssdk_1.10.bb} |   0
 meta/recipes-devtools/go/go-native.inc |  25 +-
 .../go/{go-native_1.9.bb => go-native_1.10.bb} |   0
 meta/recipes-devtools/go/go-runtime.inc|  58 +++--
 .../go/{go-runtime_1.9.bb => go-runtime_1.10.bb}   |   0
 meta/recipes-devtools/go/go-target.inc |  21 +-
 meta/recipes-devtools/go/{go_1.9.bb => go_1.10.bb} |   0
 35 files changed, 1047 insertions(+), 746 deletions(-)
 create mode 100644 meta/recipes-devtools/go/go-1.10.inc
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0001-allow-CC-and-CXX-to-have-multiple-words.patch
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0004-ld-add-soname-to-shareable-objects.patch
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0006-cmd-dist-separate-host-and-target-builds.patch
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0007-cmd-go-make-GOROOT-precious-by-default.patch
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0008-ld-replace-glibc-dynamic-linker-with-musl.patch
 delete mode 100644 meta/recipes-devtools/go/go-1.9.inc
 delete mode 100644 
meta/recipes-devtools/go/go-1.9/0001-make.bash-quote-CC_FOR_TARGET.patch
 delete mode 100644 
meta/recipes-devtools/go/go-1.9/0002-cmd-go-fix-CC-and-CXX-environment-variable-construct.patch
 delete mode 100644 
meta/recipes-devtools/go/go-1.9/0003-make.bash-better-separate-host-and-target-builds.patch
 delete mode 100644 
meta/recipes-devtools/go/go-1.9/0004-cmd-go-allow-GOTOOLDIR-to-be-overridden-in-the-envir.patch
 delete mode 100644 
meta/recipes-devtools/go/go-1.9/0005-cmd-go-make-GOROOT-precious-by-default.patch
 delete mode 100644 
meta/recipes-devtools/go/go-1.9/0006-make.bash-add-GOTOOLDIR_BOOTSTRAP-environment-variab.patch
 delete mode 100644 
meta/recipes-devtools/go/go-1.9/0007-ld-add-soname-to-shareable-objects.patch
 delete mode 100644 
meta/recipes-devtools/go/go-1.9/0008-make.bash-add-GOHOSTxx-indirection-for-cross-canadia.patch
 delete mode 100644 
meta/recipes-devtools/go/go-1.9/0009-cmd-go-buildmode-pie-forces-external-linking-mode-on.patch
 delete mode 100644 
meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch
 delete 

Re: [OE-core] [PATCH v3 00/13] go1.10 update and misc improvements

2018-03-02 Thread Matt Madison
On Thu, Mar 1, 2018 at 10:10 PM, Khem Raj <raj.k...@gmail.com> wrote:
> On Thu, Mar 1, 2018 at 9:43 PM, Khem Raj <raj.k...@gmail.com> wrote:
>>
>>
>> On 3/1/18 3:16 PM, Matt Madison wrote:
>>>
>>> New in v3:
>>>  * reduced one of the go source patches,
>>>eliminating an unneeded change (thanks
>>>Otavio)
>>>  * Added bbclass and recipe patches to
>>>handle SECURITY_CFLAGS settings if
>>>they're enabled
>>>  * Added go-runtime-staticdev to target-side
>>>SDK, needed for go static builds (fixes
>>>test case failure in oe-selftest)
>>>  * two more minor cleanups
>>>
>>> New in v2:
>>>  * Fixed Upstream-Status line in go patches
>>>  * Added GOTMPDIR to do_configure[dirs]
>>>
>>> Updates to the go recipes and bbclasses for go1.10, which
>>> moves the bulk of the toolchain bootstrap and build out
>>> of the 'make.bash' script and to the 'dist' tool.  This
>>> required a rework of the patches to the go source.
>>>
>>> go1.10 introduces significant changes to the go build
>>> tool as well, requiring some further patches to make
>>> it work for OE builds.
>>
>>
>> The errors from v2 are gone but here I am seeing another error in
>> meta-influx with this patchset with ptest enabled
>>
>> DISTRO_FEATURES_append = " ptest"
>>
>>
>> bitbake github.com-eapache-go-xerial-snappy
>>
>
> for github.com-alicebob-miniredis you dont even need to ptest enabled
>
>>
>> | DEBUG: Executing shell function do_compile_ptest_base
>> | go build github.com/golang/snappy: missing or invalid GOROOT-resident
>> package
>> | WARNING:
>> /mnt/a/zonit/build/tmp/work/aarch64-bec-linux/github.com-eapache-go-xerial-snappy/1.0-r0/temp/run.do_compile_ptest_base.21897:1
>> exit 1 from 'go_list_package_tests'
>>
>> This error seems to be due to a patch
>> 0007-cmd-go-make-GOROOT-precious-by-default.patch
>>
>> It worked fine with 1.9

Yeah, I think I was erroring out too early in that patch. It worked OK for
the recipes I tested, but there are cases where it won't.  v4 will have an
updated patch that defers the error decision until later, which works better.

Thanks,
-Matt


>>
>>
>>>
>>> See https://golang.org/doc/go1.10 for a complete list
>>> of new features and changes.
>>>
>>> Following the update are some cleanup/improvement
>>> patches.
>>>
>>> Matt Madison (13):
>>>go: update go 1.9 -> go 1.10
>>>go: set GOMIPS envrionment variable
>>>go.bbclass: rename GO_TMPDIR -> GOTMPDIR
>>>go.bbclass: remove debug-related commands
>>>go.bbclass: don't stage test data with sources
>>>go.bbclass: ptest cleanup and improvements
>>>goarch.bbclass: disable shared runtime for nativesdk builds
>>>go: move common settings to go-common.inc
>>>go.bbclass, goarch.bbclass: update SECURITY_CFLAGS
>>>go: disable PIE CFLAGS for nativesdk and cross-canadian builds
>>>packagegroup-go-sdk-target: add go-runtime-staticdev
>>>go-runtime: remove unneeded nativesdk override, rename variable
>>>go-cross-canadian: remove verbosity setting from GO_LDFLAGS
>>>
>>>   meta/classes/go.bbclass| 108 
>>>   meta/classes/goarch.bbclass|  13 +
>>>   .../packagegroups/packagegroup-go-sdk-target.bb|   1 +
>>>   meta/recipes-devtools/go/go-1.10.inc   |  21 ++
>>>   ...1-allow-CC-and-CXX-to-have-multiple-words.patch |  33 +++
>>>   ...-content-based-hash-generation-less-pedan.patch | 220
>>> 
>>>   ...OLDIR-to-be-overridden-in-the-environment.patch |  64 +
>>>   .../0004-ld-add-soname-to-shareable-objects.patch  |  47 
>>>   ...verride-CC-when-building-dist-and-go_boot.patch |  40 +++
>>>   ...-cmd-dist-separate-host-and-target-builds.patch | 277
>>> +
>>>   ...07-cmd-go-make-GOROOT-precious-by-default.patch |  97 
>>>   ...ld-replace-glibc-dynamic-linker-with-musl.patch | 130 ++
>>>   meta/recipes-devtools/go/go-1.9.inc|  26 --
>>>   .../0001-make.bash-quote-CC_FOR_TARGET.patch   |  32 ---
>>>   ...CC-and-CXX-environment-variable-construct.patch |  67 -
>>>   ...sh-better-separate-host-and-target-builds.patch |  92 -

[OE-core] [PATCH v3 13/13] go-cross-canadian: remove verbosity setting from GO_LDFLAGS

2018-03-01 Thread Matt Madison
This was another setting left over from debugging the
recipes, and isn't needed by default.

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/recipes-devtools/go/go-cross-canadian.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-devtools/go/go-cross-canadian.inc 
b/meta/recipes-devtools/go/go-cross-canadian.inc
index 1d6453712e..ea68b8875d 100644
--- a/meta/recipes-devtools/go/go-cross-canadian.inc
+++ b/meta/recipes-devtools/go/go-cross-canadian.inc
@@ -12,7 +12,7 @@ export GOTOOLDIR_BOOTSTRAP = 
"${STAGING_LIBDIR_NATIVE}/${HOST_SYS}/go/pkg/tool/$
 export GOROOT_FINAL = "${libdir}/go"
 export CGO_CFLAGS = "${CFLAGS}"
 export CGO_LDFLAGS = "${LDFLAGS}"
-export GO_LDFLAGS = '-v -linkmode external -extld ${HOST_PREFIX}gcc 
-extldflags "--sysroot=${STAGING_DIR_HOST} ${SECURITY_NOPIE_CFLAGS} 
${HOST_CC_ARCH} ${LDFLAGS}"'
+export GO_LDFLAGS = '-linkmode external -extld ${HOST_PREFIX}gcc -extldflags 
"--sysroot=${STAGING_DIR_HOST} ${SECURITY_NOPIE_CFLAGS} ${HOST_CC_ARCH} 
${LDFLAGS}"'
 
 do_configure[noexec] = "1"
 
-- 
2.14.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v3 11/13] packagegroup-go-sdk-target: add go-runtime-staticdev

2018-03-01 Thread Matt Madison
to allow go programs to be linked either statically or
dynamically when cross-compiling with the SDK.

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/recipes-core/packagegroups/packagegroup-go-sdk-target.bb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/recipes-core/packagegroups/packagegroup-go-sdk-target.bb 
b/meta/recipes-core/packagegroups/packagegroup-go-sdk-target.bb
index 3e190770a7..7d2ccbda22 100644
--- a/meta/recipes-core/packagegroups/packagegroup-go-sdk-target.bb
+++ b/meta/recipes-core/packagegroups/packagegroup-go-sdk-target.bb
@@ -5,4 +5,5 @@ inherit packagegroup goarch
 RDEPENDS_${PN} = " \
 go-runtime \
 go-runtime-dev \
+go-runtime-staticdev \
 "
-- 
2.14.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v3 12/13] go-runtime: remove unneeded nativesdk override, rename variable

2018-03-01 Thread Matt Madison
since GO_LDFLAGS is also used by the dist tool, and it's confusing
to use a variable with the same name (but not exported, so unused
by make.bash/dist).
---
 meta/recipes-devtools/go/go-runtime.inc | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/meta/recipes-devtools/go/go-runtime.inc 
b/meta/recipes-devtools/go/go-runtime.inc
index a79295df47..0041e8afab 100644
--- a/meta/recipes-devtools/go/go-runtime.inc
+++ b/meta/recipes-devtools/go/go-runtime.inc
@@ -17,9 +17,7 @@ export CGO_CXXFLAGS = "${CXXFLAGS}"
 export CGO_LDFLAGS = "${LDFLAGS}"
 
 GO_EXTLDFLAGS ?= "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} ${LDFLAGS}"
-GO_LINKMODE ?= ""
-GO_LINKMODE_class-nativesdk = "--linkmode=external"
-GO_LDFLAGS ?= '-ldflags="${GO_LINKMODE} -extldflags '${GO_EXTLDFLAGS}'"'
+GO_SHLIB_LDFLAGS ?= '-ldflags="--linkmode=external -extldflags 
'${GO_EXTLDFLAGS}'"'
 
 do_configure() {
:
@@ -38,7 +36,7 @@ do_compile() {
if [ -n "${GO_DYNLINK}" ]; then
export GOTOOLDIR="${B}/pkg/tool/native_native"
CC="$CC_FOR_${TARGET_GOOS}_${TARGET_GOARCH}" 
GOARCH="${TARGET_GOARCH}" GOOS="${TARGET_GOOS}" GOROOT=${B} \
-   $GOTOOLDIR/go_bootstrap install -linkshared 
-buildmode=shared ${GO_LDFLAGS} std
+   $GOTOOLDIR/go_bootstrap install -linkshared 
-buildmode=shared ${GO_SHLIB_LDFLAGS} std
fi
cd ${B}
 }
-- 
2.14.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v3 09/13] go.bbclass, goarch.bbclass: update SECURITY_CFLAGS

2018-03-01 Thread Matt Madison
With go1.10 the NOPIE flags are only required for
MIPS target builds, and are now incompatible for
the other architectures.

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/classes/go.bbclass | 3 ---
 meta/classes/goarch.bbclass | 1 +
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass
index 080fb4ae69..90863acbdb 100644
--- a/meta/classes/go.bbclass
+++ b/meta/classes/go.bbclass
@@ -34,9 +34,6 @@ GOTOOLDIR = 
"${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go/pkg/tool/${BUILD_GOTUPLE}
 GOTOOLDIR_class-native = 
"${STAGING_LIBDIR_NATIVE}/go/pkg/tool/${BUILD_GOTUPLE}"
 export GOTOOLDIR
 
-SECURITY_CFLAGS = "${SECURITY_NOPIE_CFLAGS}"
-SECURITY_LDFLAGS = ""
-
 export CGO_ENABLED ?= "1"
 export CGO_CFLAGS ?= "${CFLAGS}"
 export CGO_CPPFLAGS ?= "${CPPFLAGS}"
diff --git a/meta/classes/goarch.bbclass b/meta/classes/goarch.bbclass
index 5c8ed33b15..eb8b32d35b 100644
--- a/meta/classes/goarch.bbclass
+++ b/meta/classes/goarch.bbclass
@@ -35,6 +35,7 @@ COMPATIBLE_HOST_powerpc64 = "null"
 COMPATIBLE_HOST_mipsarchn32 = "null"
 ARM_INSTRUCTION_SET = "arm"
 TUNE_CCARGS_remove = "-march=mips32r2"
+SECURITY_CFLAGS_mips = "${SECURITY_NOPIE_CFLAGS}"
 
 def go_map_arch(a, d):
 import re
-- 
2.14.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v3 10/13] go: disable PIE CFLAGS for nativesdk and cross-canadian builds

2018-03-01 Thread Matt Madison
The statically-linked Go code in the toolchain is not compatible
with PIE, so disable its use in the C compiler during the
toolchain build.

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/recipes-devtools/go/go-cross-canadian.inc | 6 +++---
 meta/recipes-devtools/go/go-target.inc | 3 +--
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/meta/recipes-devtools/go/go-cross-canadian.inc 
b/meta/recipes-devtools/go/go-cross-canadian.inc
index 7a39e4509b..1d6453712e 100644
--- a/meta/recipes-devtools/go/go-cross-canadian.inc
+++ b/meta/recipes-devtools/go/go-cross-canadian.inc
@@ -12,13 +12,13 @@ export GOTOOLDIR_BOOTSTRAP = 
"${STAGING_LIBDIR_NATIVE}/${HOST_SYS}/go/pkg/tool/$
 export GOROOT_FINAL = "${libdir}/go"
 export CGO_CFLAGS = "${CFLAGS}"
 export CGO_LDFLAGS = "${LDFLAGS}"
-export GO_LDFLAGS = '-v -linkmode external -extld ${HOST_PREFIX}gcc 
-extldflags "--sysroot=${STAGING_DIR_HOST} ${HOST_CC_ARCH} ${LDFLAGS}"'
+export GO_LDFLAGS = '-v -linkmode external -extld ${HOST_PREFIX}gcc 
-extldflags "--sysroot=${STAGING_DIR_HOST} ${SECURITY_NOPIE_CFLAGS} 
${HOST_CC_ARCH} ${LDFLAGS}"'
 
 do_configure[noexec] = "1"
 
 do_compile() {
-   export CC_FOR_${HOST_GOOS}_${HOST_GOARCH}="${HOST_PREFIX}gcc 
--sysroot=${STAGING_DIR_HOST}${SDKPATHNATIVE}"
-   export CXX_FOR_${HOST_GOOS}_${HOST_GOARCH}="${HOST_PREFIX}gxx 
--sysroot=${STAGING_DIR_HOST}${SDKPATHNATIVE}"
+   export CC_FOR_${HOST_GOOS}_${HOST_GOARCH}="${HOST_PREFIX}gcc 
--sysroot=${STAGING_DIR_HOST}${SDKPATHNATIVE} ${SECURITY_NOPIE_CFLAGS}"
+   export CXX_FOR_${HOST_GOOS}_${HOST_GOARCH}="${HOST_PREFIX}gxx 
--sysroot=${STAGING_DIR_HOST}${SDKPATHNATIVE} ${SECURITY_NOPIE_CFLAGS}"
cd src
./make.bash --host-only --no-banner
cd ${B}
diff --git a/meta/recipes-devtools/go/go-target.inc 
b/meta/recipes-devtools/go/go-target.inc
index 3bc32f3bec..29a1344675 100644
--- a/meta/recipes-devtools/go/go-target.inc
+++ b/meta/recipes-devtools/go/go-target.inc
@@ -14,8 +14,7 @@ GO_LDFLAGS = ""
 GO_LDFLAGS_class-nativesdk = "-linkmode external"
 export GO_LDFLAGS
 
-SECURITY_CFLAGS = "${SECURITY_NOPIE_CFLAGS}"
-SECURITY_LDFLAGS = ""
+CC_append_class-nativesdk = " ${SECURITY_NOPIE_CFLAGS}"
 
 do_configure[noexec] = "1"
 
-- 
2.14.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v3 08/13] go: move common settings to go-common.inc

2018-03-01 Thread Matt Madison
Eliminate some redundancy in the recipes by moving
some commonly-used variable settings to the common
include file.  Also removed a duplicate inherit
from go-target.inc that was already in go-common.inc.

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/recipes-devtools/go/go-common.inc | 4 
 meta/recipes-devtools/go/go-cross-canadian.inc | 5 -
 meta/recipes-devtools/go/go-cross.inc  | 3 ---
 meta/recipes-devtools/go/go-crosssdk.inc   | 4 
 meta/recipes-devtools/go/go-native.inc | 4 
 meta/recipes-devtools/go/go-runtime.inc| 5 +
 meta/recipes-devtools/go/go-target.inc | 5 -
 7 files changed, 5 insertions(+), 25 deletions(-)

diff --git a/meta/recipes-devtools/go/go-common.inc 
b/meta/recipes-devtools/go/go-common.inc
index 611775b2cc..11d55c4d36 100644
--- a/meta/recipes-devtools/go/go-common.inc
+++ b/meta/recipes-devtools/go/go-common.inc
@@ -23,6 +23,10 @@ INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
 SSTATE_SCAN_CMD = "true"
 
 export GOROOT_OVERRIDE = "1"
+export GOTMPDIR ?= "${WORKDIR}/go-tmp"
+GOTMPDIR[vardepvalue] = ""
+export GOCACHE = "off"
+export CGO_ENABLED = "1"
 
 do_compile_prepend() {
BUILD_CC=${BUILD_CC}
diff --git a/meta/recipes-devtools/go/go-cross-canadian.inc 
b/meta/recipes-devtools/go/go-cross-canadian.inc
index 3b98ea449f..7a39e4509b 100644
--- a/meta/recipes-devtools/go/go-cross-canadian.inc
+++ b/meta/recipes-devtools/go/go-cross-canadian.inc
@@ -10,11 +10,6 @@ export GOHOSTARCH = "${BUILD_GOARCH}"
 export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
 export GOTOOLDIR_BOOTSTRAP = 
"${STAGING_LIBDIR_NATIVE}/${HOST_SYS}/go/pkg/tool/${BUILD_GOTUPLE}"
 export GOROOT_FINAL = "${libdir}/go"
-export CGO_ENABLED = "1"
-export GOCACHE = "off"
-export GOTMPDIR ?= "${WORKDIR}/go-tmp"
-GOTMPDIR[vardepvalue] = ""
-#CC = "${HOST_PREFIX}gcc"
 export CGO_CFLAGS = "${CFLAGS}"
 export CGO_LDFLAGS = "${LDFLAGS}"
 export GO_LDFLAGS = '-v -linkmode external -extld ${HOST_PREFIX}gcc 
-extldflags "--sysroot=${STAGING_DIR_HOST} ${HOST_CC_ARCH} ${LDFLAGS}"'
diff --git a/meta/recipes-devtools/go/go-cross.inc 
b/meta/recipes-devtools/go/go-cross.inc
index 289ae77104..44f230b8bc 100644
--- a/meta/recipes-devtools/go/go-cross.inc
+++ b/meta/recipes-devtools/go/go-cross.inc
@@ -15,9 +15,6 @@ export GOMIPS = "${TARGET_GOMIPS}"
 export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
 export GOROOT_FINAL = "${libdir}/go"
 export GOCACHE = "off"
-export GOTMPDIR ?= "${WORKDIR}/go-tmp"
-GOTMPDIR[vardepvalue] = ""
-export CGO_ENABLED = "1"
 CC = "${@d.getVar('BUILD_CC').strip()}"
 
 do_configure[noexec] = "1"
diff --git a/meta/recipes-devtools/go/go-crosssdk.inc 
b/meta/recipes-devtools/go/go-crosssdk.inc
index 05ca62eba8..4391b32424 100644
--- a/meta/recipes-devtools/go/go-crosssdk.inc
+++ b/meta/recipes-devtools/go/go-crosssdk.inc
@@ -10,10 +10,6 @@ export GOOS = "${TARGET_GOOS}"
 export GOARCH = "${TARGET_GOARCH}"
 export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
 export GOROOT_FINAL = "${libdir}/go"
-export CGO_ENABLED = "1"
-export GOCACHE = "off"
-export GOTMPDIR ?= "${WORKDIR}/go-tmp"
-GOTMPDIR[vardepvalue] = ""
 
 do_configure[noexec] = "1"
 
diff --git a/meta/recipes-devtools/go/go-native.inc 
b/meta/recipes-devtools/go/go-native.inc
index 31e899da82..5fbb72b087 100644
--- a/meta/recipes-devtools/go/go-native.inc
+++ b/meta/recipes-devtools/go/go-native.inc
@@ -10,12 +10,8 @@ SRC_URI[bootstrap.sha256sum] = 
"f4ff5b5eb3a3cae1c993723f3eab519c5bae18866b5e5f96
 
 export GOOS = "${BUILD_GOOS}"
 export GOARCH = "${BUILD_GOARCH}"
-export GOTMPDIR ?= "${WORKDIR}/go-tmp"
-GOTMPDIR[vardepvalue] = ""
 CC = "${@d.getVar('BUILD_CC').strip()}"
 
-export CGO_ENABLED = "1"
-
 do_configure() {
cd ${WORKDIR}/go1.4/go/src
CGO_ENABLED=0 GOROOT=${WORKDIR}/go1.4/go ./make.bash
diff --git a/meta/recipes-devtools/go/go-runtime.inc 
b/meta/recipes-devtools/go/go-runtime.inc
index 0fe4566360..a79295df47 100644
--- a/meta/recipes-devtools/go/go-runtime.inc
+++ b/meta/recipes-devtools/go/go-runtime.inc
@@ -11,14 +11,11 @@ export GO386 = "${TARGET_GO386}"
 export GOMIPS = "${TARGET_GOMIPS}"
 export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
 export GOROOT_FINAL = "${libdir}/go"
-export CGO_ENABLED = "1"
 export CGO_CFLAGS = "${CFLAGS}"
 export CGO_CPPFLAGS = "${CPPFLAGS}"
 export CGO_CXXFLAGS = "${CXXFLAGS}"
 export CGO_LDFLAGS = "${LDFLAGS}"
-export GOCACHE = "off"
-export GOTMPDIR ?= &quo

[OE-core] [PATCH v3 03/13] go.bbclass: rename GO_TMPDIR -> GOTMPDIR

2018-03-01 Thread Matt Madison
and export it. Go 1.10 now supports using this
separate variable locating its temporary files,
so TMPDIR doesn't have to be modified.

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/classes/go.bbclass | 11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass
index 43a262d599..a126d531b8 100644
--- a/meta/classes/go.bbclass
+++ b/meta/classes/go.bbclass
@@ -49,8 +49,8 @@ GO_INSTALL_FILTEROUT ?= "${GO_IMPORT}/vendor/"
 B = "${WORKDIR}/build"
 export GOPATH = "${B}"
 export GOCACHE = "off"
-GO_TMPDIR ?= "${WORKDIR}/go-tmp"
-GO_TMPDIR[vardepvalue] = ""
+export GOTMPDIR ?= "${WORKDIR}/go-tmp"
+GOTMPDIR[vardepvalue] = ""
 
 python go_do_unpack() {
 src_uri = (d.getVar('SRC_URI') or "").split()
@@ -85,19 +85,18 @@ go_list_package_tests() {
 go_do_configure() {
ln -snf ${S}/src ${B}/
 }
+do_configure[dirs] =+ "${GOTMPDIR}"
 
 go_do_compile() {
-   export TMPDIR="${GO_TMPDIR}"
${GO} env
if [ -n "${GO_INSTALL}" ]; then
${GO} install ${GO_LINKSHARED} ${GOBUILDFLAGS} 
`go_list_packages`
fi
 }
-do_compile[dirs] =+ "${GO_TMPDIR}"
+do_compile[dirs] =+ "${GOTMPDIR}"
 do_compile[cleandirs] = "${B}/bin ${B}/pkg"
 
 do_compile_ptest() {
-export TMPDIR="${GO_TMPDIR}"
 rm -f ${B}/.go_compiled_tests.list
go_list_package_tests | while read pkg; do
cd ${B}/src/$pkg
@@ -106,7 +105,7 @@ do_compile_ptest() {
sed -e's,/\./,/,'>> ${B}/.go_compiled_tests.list
done
 }
-do_compile_ptest_base[dirs] =+ "${GO_TMPDIR}"
+do_compile_ptest_base[dirs] =+ "${GOTMPDIR}"
 
 go_do_install() {
install -d ${D}${libdir}/go/src/${GO_IMPORT}
-- 
2.14.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v3 07/13] goarch.bbclass: disable shared runtime for nativesdk builds

2018-03-01 Thread Matt Madison
While useful on embedded devices for saving disk space, use
of shared runtime in Go is not the usual practice, so disable
it for nativesdk builds.  We don't use it for native builds,
either, so this makes the SDK match the native environment
more closely.

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/classes/goarch.bbclass | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/classes/goarch.bbclass b/meta/classes/goarch.bbclass
index 1021b94d4c..5c8ed33b15 100644
--- a/meta/classes/goarch.bbclass
+++ b/meta/classes/goarch.bbclass
@@ -24,6 +24,7 @@ GO_DYNLINK_x86 = "1"
 GO_DYNLINK_x86-64 = "1"
 GO_DYNLINK_powerpc64 = "1"
 GO_DYNLINK_class-native = ""
+GO_DYNLINK_class-nativesdk = ""
 
 # define here because everybody inherits this class
 #
-- 
2.14.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v3 06/13] go.bbclass: ptest cleanup and improvements

2018-03-01 Thread Matt Madison
* Don't enable verbose test output (-test.v)
  by default, as it generates too much noise
  for automated results parsing

* Override do_install_ptest_base in the bbclass,
  so recipes can provide their own modifications
  with do_install_ptest.

* Improve the generated run-ptest script to better
  handle large numbers of tests, and to generate
  'status: test name' output similar to Automake
  tests.

* Install all non-vendored 'testdata' directories
  from the source into the ptest package, as some
  packages share test data among multiple tests.

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/classes/go.bbclass | 87 +
 1 file changed, 51 insertions(+), 36 deletions(-)

diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass
index cd3d9d5bfb..080fb4ae69 100644
--- a/meta/classes/go.bbclass
+++ b/meta/classes/go.bbclass
@@ -26,7 +26,7 @@ GO_LDFLAGS ?= '-ldflags="${GO_RPATH} ${GO_LINKMODE} 
-extldflags '${GO_EXTLDFLAGS
 export GOBUILDFLAGS ?= "-v ${GO_LDFLAGS}"
 export GOPATH_OMIT_IN_ACTIONID ?= "1"
 export GOPTESTBUILDFLAGS ?= "${GOBUILDFLAGS} -c"
-export GOPTESTFLAGS ?= "-test.v"
+export GOPTESTFLAGS ?= ""
 GOBUILDFLAGS_prepend_task-compile = "${GO_PARALLEL_BUILD} "
 
 export GO = "${HOST_PREFIX}go"
@@ -76,7 +76,7 @@ go_list_packages() {
 }
 
 go_list_package_tests() {
-${GO} list -f '{{.ImportPath}} {{.TestGoFiles}}' ${GOBUILDFLAGS} 
${GO_INSTALL} | \
+   ${GO} list -f '{{.ImportPath}} {{.TestGoFiles}}' ${GOBUILDFLAGS} 
${GO_INSTALL} | \
grep -v '\[\]$' | \
egrep -v '${GO_INSTALL_FILTEROUT}' | \
awk '{ print $1 }'
@@ -95,14 +95,15 @@ go_do_compile() {
 do_compile[dirs] =+ "${GOTMPDIR}"
 do_compile[cleandirs] = "${B}/bin ${B}/pkg"
 
-do_compile_ptest() {
-rm -f ${B}/.go_compiled_tests.list
+do_compile_ptest_base() {
+   rm -f ${B}/.go_compiled_tests.list
go_list_package_tests | while read pkg; do
cd ${B}/src/$pkg
${GO} test ${GOPTESTBUILDFLAGS} $pkg
find . -mindepth 1 -maxdepth 1 -type f -name '*.test' -exec 
echo $pkg/{} \; | \
sed -e's,/\./,/,'>> ${B}/.go_compiled_tests.list
done
+   do_compile_ptest
 }
 do_compile_ptest_base[dirs] =+ "${GOTMPDIR}"
 
@@ -118,40 +119,54 @@ go_do_install() {
fi
 }
 
-do_install_ptest_base() {
-test -f "${B}/.go_compiled_tests.list" || exit 0
-tests=""
-while read test; do
-tests="$tests${tests:+ }${test%.test}"
-testdir=`dirname $test`
-install -d ${D}${PTEST_PATH}/$testdir
-install -m 0755 ${B}/src/$test ${D}${PTEST_PATH}/$test
-if [ -d "${B}/src/$testdir/testdata" ]; then
-cp --preserve=mode,timestamps -R "${B}/src/$testdir/testdata" 
${D}${PTEST_PATH}/$testdir
-fi
-done < ${B}/.go_compiled_tests.list
-if [ -n "$tests" ]; then
-install -d ${D}${PTEST_PATH}
-cat >${D}${PTEST_PATH}/run-ptest <${D}${PTEST_PATH}/run-ptest <&1; then
-ANYFAILED=1
-fi
-done
-if [ \$ANYFAILED -ne 0 ]; then
-echo "FAIL: ${PN}"
-exit 1
-fi
-echo "PASS: ${PN}"
-exit 0
+RC=0
+run_test() (
+cd "\$1"
+./\$2 ${GOPTESTFLAGS}; echo \$? >&3) | sed -r 
-e"s,^(PASS|SKIP|FAIL)\$,\\1: \$1/\$2," >&4) 3>&1) | (read rc; exit \$rc)) 4>&1
+exit \$?)
 EOF
-chmod +x ${D}${PTEST_PATH}/run-ptest
-else
-rm -rf ${D}${PTEST_PATH}
-fi
+
+}
+
+go_stage_testdata() {
+   oldwd="$PWD"
+   cd ${S}/src
+   find ${GO_IMPORT} -depth -type d -name testdata | while read d; do
+   if echo "$d" | grep -q '/vendor/'; then
+   continue
+   fi
+   parent=`dirname $d`
+   install -d ${D}${PTEST_PATH}/$parent
+   cp --preserve=mode,timestamps -R $d ${D}${PTEST_PATH}/$parent/
+   done
+   cd "$oldwd"
+}
+
+do_install_ptest_base() {
+   test -f "${B}/.go_compiled_tests.list" || exit 0
+   install -d ${D}${PTEST_PATH}
+   go_stage_testdata
+   go_make_ptest_wrapper
+   havetests=""
+   while read test; do
+   testdir=`dirname $test`
+   testprog=`basename $test`
+   install -d ${D}${PTEST_PATH}/$testdir
+   install -m 0755 ${B}/src/$test ${D}${PTEST_PATH}/$test
+   echo "run_test $testdir $testprog || RC=1" >> 
${D}${PTEST_PATH}/run-ptest
+   havetests="yes"
+   done < ${B}/.go_compiled_tests.list
+   if [ -n "$havetests" ]; then
+   echo "exit \$RC" >> ${D}${PTEST_PATH}/run-ptest
+ 

[OE-core] [PATCH v3 05/13] go.bbclass: don't stage test data with sources

2018-03-01 Thread Matt Madison
Any directory in a Go package's source tree called
'testdata' contains test data, and isn't necessary
for building.

Some packages include ELF files and other binaries
as test data, and staging them in the sysroot and
-dev package leads to unnecessary QA warnings.

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/classes/go.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass
index a20d2dc0a7..cd3d9d5bfb 100644
--- a/meta/classes/go.bbclass
+++ b/meta/classes/go.bbclass
@@ -108,7 +108,7 @@ do_compile_ptest_base[dirs] =+ "${GOTMPDIR}"
 
 go_do_install() {
install -d ${D}${libdir}/go/src/${GO_IMPORT}
-   tar -C ${S}/src/${GO_IMPORT} -cf - --exclude-vcs --exclude '*.test' . | 
\
+   tar -C ${S}/src/${GO_IMPORT} -cf - --exclude-vcs --exclude '*.test' 
--exclude 'testdata' . | \
tar -C ${D}${libdir}/go/src/${GO_IMPORT} --no-same-owner -xf -
tar -C ${B} -cf - pkg | tar -C ${D}${libdir}/go --no-same-owner -xf -
 
-- 
2.14.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v3 02/13] go: set GOMIPS envrionment variable

2018-03-01 Thread Matt Madison
Go 1.10 adds support for selecting hard/soft float
object code through the GOMIPS environment variable.

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/classes/goarch.bbclass| 11 +++
 meta/recipes-devtools/go/go-cross-canadian.inc |  1 +
 meta/recipes-devtools/go/go-cross.inc  |  2 ++
 meta/recipes-devtools/go/go-runtime.inc|  1 +
 meta/recipes-devtools/go/go-target.inc |  1 +
 5 files changed, 16 insertions(+)

diff --git a/meta/classes/goarch.bbclass b/meta/classes/goarch.bbclass
index 922c0cc8f3..1021b94d4c 100644
--- a/meta/classes/goarch.bbclass
+++ b/meta/classes/goarch.bbclass
@@ -5,11 +5,13 @@ HOST_GOOS = "${@go_map_os(d.getVar('HOST_OS'), d)}"
 HOST_GOARCH = "${@go_map_arch(d.getVar('HOST_ARCH'), d)}"
 HOST_GOARM = "${@go_map_arm(d.getVar('HOST_ARCH'), d.getVar('TUNE_FEATURES'), 
d)}"
 HOST_GO386 = "${@go_map_386(d.getVar('HOST_ARCH'), d.getVar('TUNE_FEATURES'), 
d)}"
+HOST_GOMIPS = "${@go_map_mips(d.getVar('HOST_ARCH'), 
d.getVar('TUNE_FEATURES'), d)}"
 HOST_GOTUPLE = "${HOST_GOOS}_${HOST_GOARCH}"
 TARGET_GOOS = "${@go_map_os(d.getVar('TARGET_OS'), d)}"
 TARGET_GOARCH = "${@go_map_arch(d.getVar('TARGET_ARCH'), d)}"
 TARGET_GOARM = "${@go_map_arm(d.getVar('TARGET_ARCH'), 
d.getVar('TUNE_FEATURES'), d)}"
 TARGET_GO386 = "${@go_map_386(d.getVar('TARGET_ARCH'), 
d.getVar('TUNE_FEATURES'), d)}"
+TARGET_GOMIPS = "${@go_map_mips(d.getVar('TARGET_ARCH'), 
d.getVar('TUNE_FEATURES'), d)}"
 TARGET_GOTUPLE = "${TARGET_GOOS}_${TARGET_GOARCH}"
 GO_BUILD_BINDIR = "${@['bin/${HOST_GOTUPLE}','bin'][d.getVar('BUILD_GOTUPLE') 
== d.getVar('HOST_GOTUPLE')]}"
 
@@ -78,6 +80,15 @@ def go_map_386(a, f, d):
 return '387'
 return ''
 
+def go_map_mips(a, f, d):
+import re
+if a == 'mips' or a == 'mipsel':
+if 'fpu-hard' in f:
+return 'hardfloat'
+else:
+return 'softfloat'
+return ''
+
 def go_map_os(o, d):
 if o.startswith('linux'):
 return 'linux'
diff --git a/meta/recipes-devtools/go/go-cross-canadian.inc 
b/meta/recipes-devtools/go/go-cross-canadian.inc
index c84aa4c9eb..3b98ea449f 100644
--- a/meta/recipes-devtools/go/go-cross-canadian.inc
+++ b/meta/recipes-devtools/go/go-cross-canadian.inc
@@ -42,6 +42,7 @@ export GOARCH="${TARGET_GOARCH}"
 export GOOS="${TARGET_GOOS}"
 test -n "\$GOARM" || export GOARM="${TARGET_GOARM}"
 test -n "\$GO386" || export GO386="${TARGET_GO386}"
+test -n "\$GOMIPS" || export GOMIPS="${TARGET_GOMIPS}"
 export GOTOOLDIR="\$native_goroot/pkg/tool/${HOST_GOTUPLE}"
 test -n "\$GOROOT" || export 
GOROOT="\$OECORE_TARGET_SYSROOT/${target_libdir}/go"
 \$here/../../lib/${TARGET_SYS}/go/bin/$1 "\$@"
diff --git a/meta/recipes-devtools/go/go-cross.inc 
b/meta/recipes-devtools/go/go-cross.inc
index fe92651581..289ae77104 100644
--- a/meta/recipes-devtools/go/go-cross.inc
+++ b/meta/recipes-devtools/go/go-cross.inc
@@ -11,6 +11,7 @@ export GOOS = "${TARGET_GOOS}"
 export GOARCH = "${TARGET_GOARCH}"
 export GOARM = "${TARGET_GOARM}"
 export GO386 = "${TARGET_GO386}"
+export GOMIPS = "${TARGET_GOMIPS}"
 export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
 export GOROOT_FINAL = "${libdir}/go"
 export GOCACHE = "off"
@@ -40,6 +41,7 @@ export GOARCH="${TARGET_GOARCH}"
 export GOOS="${TARGET_GOOS}"
 export GOARM="\${GOARM:-${TARGET_GOARM}}"
 export GO386="\${GO386:-${TARGET_GO386}}"
+export GOMIPS="\${GOMIPS:-${TARGET_GOMIPS}}"
 \$here/../../lib/${CROSS_TARGET_SYS_DIR}/go/bin/$1 "\$@"
 END
chmod +x ${D}${bindir}/$2
diff --git a/meta/recipes-devtools/go/go-runtime.inc 
b/meta/recipes-devtools/go/go-runtime.inc
index 7a3b415b3f..0fe4566360 100644
--- a/meta/recipes-devtools/go/go-runtime.inc
+++ b/meta/recipes-devtools/go/go-runtime.inc
@@ -8,6 +8,7 @@ export GOOS = "${TARGET_GOOS}"
 export GOARCH = "${TARGET_GOARCH}"
 export GOARM = "${TARGET_GOARM}"
 export GO386 = "${TARGET_GO386}"
+export GOMIPS = "${TARGET_GOMIPS}"
 export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
 export GOROOT_FINAL = "${libdir}/go"
 export CGO_ENABLED = "1"
diff --git a/meta/recipes-devtools/go/go-target.inc 
b/meta/recipes-devtools/go/go-target.inc
index a53a314c78..141a456cca 100644
--- a/meta/recipes-devtools/go/go-target.inc
+++ b/meta/recipes-devtools/go/go-target.inc
@@ -8,6 +8,7 @@ export GOOS = "${TARGET_GOOS}"
 export GOARCH = "${TARGET_GOARCH}"
 export GOARM = "${TARGET_GOARM}"
 export GO386 = "${TARGET_GO386}"
+export GOMIPS = "${TARGET_GOMIPS}"
 export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
 export GOROOT_FINAL = "${libdir}/go"
 export CGO_ENABLED = "1"
-- 
2.14.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v3 04/13] go.bbclass: remove debug-related commands

2018-03-01 Thread Matt Madison
The 'go env' in the do_compile function and
the set -x/+x in the do_install_ptest function
were used for debugging the bbclass, and aren't
really needed.

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/classes/go.bbclass | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass
index a126d531b8..a20d2dc0a7 100644
--- a/meta/classes/go.bbclass
+++ b/meta/classes/go.bbclass
@@ -88,7 +88,6 @@ go_do_configure() {
 do_configure[dirs] =+ "${GOTMPDIR}"
 
 go_do_compile() {
-   ${GO} env
if [ -n "${GO_INSTALL}" ]; then
${GO} install ${GO_LINKSHARED} ${GOBUILDFLAGS} 
`go_list_packages`
fi
@@ -120,7 +119,6 @@ go_do_install() {
 }
 
 do_install_ptest_base() {
-set -x
 test -f "${B}/.go_compiled_tests.list" || exit 0
 tests=""
 while read test; do
@@ -154,7 +152,6 @@ EOF
 else
 rm -rf ${D}${PTEST_PATH}
 fi
-set +x
 }
 
 EXPORT_FUNCTIONS do_unpack do_configure do_compile do_install
-- 
2.14.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v3 01/13] go: update go 1.9 -> go 1.10

2018-03-01 Thread Matt Madison
* Patches and recipes reworked for go 1.10's significant
  changes to its bootstrap and build steps

* Update go1.4 source tarball used for go-native
  bootstrapping to the version recommended
  in the current go documentation

* Remove test data from installed sources to eliminate
  some packaging QA warnings

* Set GOCACHE to 'off' to disable 1.10's build caching
  in the go recipes and bbclass

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/classes/go.bbclass|   2 +
 meta/recipes-devtools/go/go-1.10.inc   |  21 ++
 ...1-allow-CC-and-CXX-to-have-multiple-words.patch |  33 +++
 ...-content-based-hash-generation-less-pedan.patch | 220 
 ...OLDIR-to-be-overridden-in-the-environment.patch |  64 +
 .../0004-ld-add-soname-to-shareable-objects.patch  |  47 
 ...verride-CC-when-building-dist-and-go_boot.patch |  40 +++
 ...-cmd-dist-separate-host-and-target-builds.patch | 277 +
 ...07-cmd-go-make-GOROOT-precious-by-default.patch |  97 
 ...ld-replace-glibc-dynamic-linker-with-musl.patch | 130 ++
 meta/recipes-devtools/go/go-1.9.inc|  26 --
 .../0001-make.bash-quote-CC_FOR_TARGET.patch   |  32 ---
 ...CC-and-CXX-environment-variable-construct.patch |  67 -
 ...sh-better-separate-host-and-target-builds.patch |  92 ---
 ...w-GOTOOLDIR-to-be-overridden-in-the-envir.patch |  68 -
 ...05-cmd-go-make-GOROOT-precious-by-default.patch |  41 ---
 ...dd-GOTOOLDIR_BOOTSTRAP-environment-variab.patch |  36 ---
 .../0007-ld-add-soname-to-shareable-objects.patch  |  46 
 ...dd-GOHOSTxx-indirection-for-cross-canadia.patch |  33 ---
 ...dmode-pie-forces-external-linking-mode-on.patch |  47 
 ...verride-CC-when-building-dist-and-go_boot.patch |  43 
 .../go/go-1.9/set-external-linker.patch| 111 -
 meta/recipes-devtools/go/go-common.inc |   2 +
 meta/recipes-devtools/go/go-cross-canadian.inc |  28 +--
 ...s-canadian_1.9.bb => go-cross-canadian_1.10.bb} |   0
 meta/recipes-devtools/go/go-cross.inc  |  55 ++--
 .../go/{go-cross_1.9.bb => go-cross_1.10.bb}   |   0
 meta/recipes-devtools/go/go-crosssdk.inc   |  16 +-
 .../go/{go-crosssdk_1.9.bb => go-crosssdk_1.10.bb} |   0
 meta/recipes-devtools/go/go-native.inc |  25 +-
 .../go/{go-native_1.9.bb => go-native_1.10.bb} |   0
 meta/recipes-devtools/go/go-runtime.inc|  58 +++--
 .../go/{go-runtime_1.9.bb => go-runtime_1.10.bb}   |   0
 meta/recipes-devtools/go/go-target.inc |  21 +-
 meta/recipes-devtools/go/{go_1.9.bb => go_1.10.bb} |   0
 35 files changed, 1032 insertions(+), 746 deletions(-)
 create mode 100644 meta/recipes-devtools/go/go-1.10.inc
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0001-allow-CC-and-CXX-to-have-multiple-words.patch
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0004-ld-add-soname-to-shareable-objects.patch
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0006-cmd-dist-separate-host-and-target-builds.patch
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0007-cmd-go-make-GOROOT-precious-by-default.patch
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0008-ld-replace-glibc-dynamic-linker-with-musl.patch
 delete mode 100644 meta/recipes-devtools/go/go-1.9.inc
 delete mode 100644 
meta/recipes-devtools/go/go-1.9/0001-make.bash-quote-CC_FOR_TARGET.patch
 delete mode 100644 
meta/recipes-devtools/go/go-1.9/0002-cmd-go-fix-CC-and-CXX-environment-variable-construct.patch
 delete mode 100644 
meta/recipes-devtools/go/go-1.9/0003-make.bash-better-separate-host-and-target-builds.patch
 delete mode 100644 
meta/recipes-devtools/go/go-1.9/0004-cmd-go-allow-GOTOOLDIR-to-be-overridden-in-the-envir.patch
 delete mode 100644 
meta/recipes-devtools/go/go-1.9/0005-cmd-go-make-GOROOT-precious-by-default.patch
 delete mode 100644 
meta/recipes-devtools/go/go-1.9/0006-make.bash-add-GOTOOLDIR_BOOTSTRAP-environment-variab.patch
 delete mode 100644 
meta/recipes-devtools/go/go-1.9/0007-ld-add-soname-to-shareable-objects.patch
 delete mode 100644 
meta/recipes-devtools/go/go-1.9/0008-make.bash-add-GOHOSTxx-indirection-for-cross-canadia.patch
 delete mode 100644 
meta/recipes-devtools/go/go-1.9/0009-cmd-go-buildmode-pie-forces-external-linking-mode-on.patch
 delete mode 100644 
meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch
 delete mode 100644 meta/recipes-devtools/go/go-1.9/set-external-linker.patch
 rename meta/recipes-devtools/go/{go-cross-canadian_1.9.bb => 
go-cross-canad

[OE-core] [PATCH v3 00/13] go1.10 update and misc improvements

2018-03-01 Thread Matt Madison
New in v3:
* reduced one of the go source patches,
  eliminating an unneeded change (thanks
  Otavio)
* Added bbclass and recipe patches to
  handle SECURITY_CFLAGS settings if
  they're enabled
* Added go-runtime-staticdev to target-side
  SDK, needed for go static builds (fixes
  test case failure in oe-selftest)
* two more minor cleanups

New in v2:
* Fixed Upstream-Status line in go patches
* Added GOTMPDIR to do_configure[dirs]

Updates to the go recipes and bbclasses for go1.10, which
moves the bulk of the toolchain bootstrap and build out
of the 'make.bash' script and to the 'dist' tool.  This
required a rework of the patches to the go source.

go1.10 introduces significant changes to the go build
tool as well, requiring some further patches to make
it work for OE builds.

See https://golang.org/doc/go1.10 for a complete list
of new features and changes.

Following the update are some cleanup/improvement
patches.

Matt Madison (13):
  go: update go 1.9 -> go 1.10
  go: set GOMIPS envrionment variable
  go.bbclass: rename GO_TMPDIR -> GOTMPDIR
  go.bbclass: remove debug-related commands
  go.bbclass: don't stage test data with sources
  go.bbclass: ptest cleanup and improvements
  goarch.bbclass: disable shared runtime for nativesdk builds
  go: move common settings to go-common.inc
  go.bbclass, goarch.bbclass: update SECURITY_CFLAGS
  go: disable PIE CFLAGS for nativesdk and cross-canadian builds
  packagegroup-go-sdk-target: add go-runtime-staticdev
  go-runtime: remove unneeded nativesdk override, rename variable
  go-cross-canadian: remove verbosity setting from GO_LDFLAGS

 meta/classes/go.bbclass| 108 
 meta/classes/goarch.bbclass|  13 +
 .../packagegroups/packagegroup-go-sdk-target.bb|   1 +
 meta/recipes-devtools/go/go-1.10.inc   |  21 ++
 ...1-allow-CC-and-CXX-to-have-multiple-words.patch |  33 +++
 ...-content-based-hash-generation-less-pedan.patch | 220 
 ...OLDIR-to-be-overridden-in-the-environment.patch |  64 +
 .../0004-ld-add-soname-to-shareable-objects.patch  |  47 
 ...verride-CC-when-building-dist-and-go_boot.patch |  40 +++
 ...-cmd-dist-separate-host-and-target-builds.patch | 277 +
 ...07-cmd-go-make-GOROOT-precious-by-default.patch |  97 
 ...ld-replace-glibc-dynamic-linker-with-musl.patch | 130 ++
 meta/recipes-devtools/go/go-1.9.inc|  26 --
 .../0001-make.bash-quote-CC_FOR_TARGET.patch   |  32 ---
 ...CC-and-CXX-environment-variable-construct.patch |  67 -
 ...sh-better-separate-host-and-target-builds.patch |  92 ---
 ...w-GOTOOLDIR-to-be-overridden-in-the-envir.patch |  68 -
 ...05-cmd-go-make-GOROOT-precious-by-default.patch |  41 ---
 ...dd-GOTOOLDIR_BOOTSTRAP-environment-variab.patch |  36 ---
 .../0007-ld-add-soname-to-shareable-objects.patch  |  46 
 ...dd-GOHOSTxx-indirection-for-cross-canadia.patch |  33 ---
 ...dmode-pie-forces-external-linking-mode-on.patch |  47 
 ...verride-CC-when-building-dist-and-go_boot.patch |  43 
 .../go/go-1.9/set-external-linker.patch| 111 -
 meta/recipes-devtools/go/go-common.inc |   6 +
 meta/recipes-devtools/go/go-cross-canadian.inc |  26 +-
 ...s-canadian_1.9.bb => go-cross-canadian_1.10.bb} |   0
 meta/recipes-devtools/go/go-cross.inc  |  56 ++---
 .../go/{go-cross_1.9.bb => go-cross_1.10.bb}   |   0
 meta/recipes-devtools/go/go-crosssdk.inc   |  14 +-
 .../go/{go-crosssdk_1.9.bb => go-crosssdk_1.10.bb} |   0
 meta/recipes-devtools/go/go-native.inc |  25 +-
 .../go/{go-native_1.9.bb => go-native_1.10.bb} |   0
 meta/recipes-devtools/go/go-runtime.inc|  56 ++---
 .../go/{go-runtime_1.9.bb => go-runtime_1.10.bb}   |   0
 meta/recipes-devtools/go/go-target.inc |  24 +-
 meta/recipes-devtools/go/{go_1.9.bb => go_1.10.bb} |   0
 37 files changed, 1095 insertions(+), 805 deletions(-)
 create mode 100644 meta/recipes-devtools/go/go-1.10.inc
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0001-allow-CC-and-CXX-to-have-multiple-words.patch
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0004-ld-add-soname-to-shareable-objects.patch
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0006-cmd-dist-separate-host-and-target-builds.patch
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0007-cmd-go-make-GOROOT-precious-by-default.patch
 create mode 100644 
meta/recipes-devtools/go/go-1.10/0008-ld-replace-glibc-dynamic-linker-with-musl.p

Re: [OE-core] [PATCH v2 1/8] go: update go 1.9 -> go 1.10

2018-02-28 Thread Matt Madison
On Wed, Feb 28, 2018 at 11:48 AM, Khem Raj <raj.k...@gmail.com> wrote:
> On Tue, Feb 27, 2018 at 4:36 AM, Matt Madison <matt@madison.systems> wrote:
>> * Patches and recipes reworked for go 1.10's significant
>>   changes to its bootstrap and build steps
>>
>> * Update go1.4 source tarball used for go-native
>>   bootstrapping to the version recommended
>>   in the current go documentation
>>
>> * Remove test data from installed sources to eliminate
>>   some packaging QA warnings
>>
>> * Set GOCACHE to 'off' to disable 1.10's build caching
>>   in the go recipes and bbclass
>>
>
> I gave it a shot and its failing to compile some of the modues with this error
>
> | /tmp/go-link-766579509/go.o:go.go:runtime.main_init·f: error:
> undefined reference to 'main.init'
> | /tmp/go-link-766579509/go.o:go.go:runtime.main_main·f: error:
> undefined reference to 'main.main'
> | collect2: error: ld returned 1 exit status

This, Ross's and one of the errors Richard mentioned are due to the
security flags, which
I missed in my unit testing.

Thanks,
-Matt


>
>
> In order to reproduce the error you can try to add my fork meta-influx layer
>
> https://github.com/kraj/meta-influx -b kraj/develop
>
> then
>
> bitbake github.com-oneofone-xxhash
>
>> Signed-off-by: Matt Madison <matt@madison.systems>
>> ---
>>  meta/classes/go.bbclass|   2 +
>>  meta/recipes-devtools/go/go-1.10.inc   |  21 ++
>>  ...1-allow-CC-and-CXX-to-have-multiple-words.patch |  49 
>>  ...-content-based-hash-generation-less-pedan.patch | 220 
>>  ...OLDIR-to-be-overridden-in-the-environment.patch |  64 +
>>  .../0004-ld-add-soname-to-shareable-objects.patch  |  47 
>>  ...verride-CC-when-building-dist-and-go_boot.patch |  40 +++
>>  ...-cmd-dist-separate-host-and-target-builds.patch | 277 
>> +
>>  ...07-cmd-go-make-GOROOT-precious-by-default.patch |  97 
>>  ...ld-replace-glibc-dynamic-linker-with-musl.patch | 130 ++
>>  meta/recipes-devtools/go/go-1.9.inc|  26 --
>>  .../0001-make.bash-quote-CC_FOR_TARGET.patch   |  32 ---
>>  ...CC-and-CXX-environment-variable-construct.patch |  67 -
>>  ...sh-better-separate-host-and-target-builds.patch |  92 ---
>>  ...w-GOTOOLDIR-to-be-overridden-in-the-envir.patch |  68 -
>>  ...05-cmd-go-make-GOROOT-precious-by-default.patch |  41 ---
>>  ...dd-GOTOOLDIR_BOOTSTRAP-environment-variab.patch |  36 ---
>>  .../0007-ld-add-soname-to-shareable-objects.patch  |  46 
>>  ...dd-GOHOSTxx-indirection-for-cross-canadia.patch |  33 ---
>>  ...dmode-pie-forces-external-linking-mode-on.patch |  47 
>>  ...verride-CC-when-building-dist-and-go_boot.patch |  43 
>>  .../go/go-1.9/set-external-linker.patch| 111 -
>>  meta/recipes-devtools/go/go-common.inc |   2 +
>>  meta/recipes-devtools/go/go-cross-canadian.inc |  28 +--
>>  ...s-canadian_1.9.bb => go-cross-canadian_1.10.bb} |   0
>>  meta/recipes-devtools/go/go-cross.inc  |  55 ++--
>>  .../go/{go-cross_1.9.bb => go-cross_1.10.bb}   |   0
>>  meta/recipes-devtools/go/go-crosssdk.inc   |  16 +-
>>  .../go/{go-crosssdk_1.9.bb => go-crosssdk_1.10.bb} |   0
>>  meta/recipes-devtools/go/go-native.inc |  25 +-
>>  .../go/{go-native_1.9.bb => go-native_1.10.bb} |   0
>>  meta/recipes-devtools/go/go-runtime.inc|  58 +++--
>>  .../go/{go-runtime_1.9.bb => go-runtime_1.10.bb}   |   0
>>  meta/recipes-devtools/go/go-target.inc |  21 +-
>>  meta/recipes-devtools/go/{go_1.9.bb => go_1.10.bb} |   0
>>  35 files changed, 1048 insertions(+), 746 deletions(-)
>>  create mode 100644 meta/recipes-devtools/go/go-1.10.inc
>>  create mode 100644 
>> meta/recipes-devtools/go/go-1.10/0001-allow-CC-and-CXX-to-have-multiple-words.patch
>>  create mode 100644 
>> meta/recipes-devtools/go/go-1.10/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch
>>  create mode 100644 
>> meta/recipes-devtools/go/go-1.10/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch
>>  create mode 100644 
>> meta/recipes-devtools/go/go-1.10/0004-ld-add-soname-to-shareable-objects.patch
>>  create mode 100644 
>> meta/recipes-devtools/go/go-1.10/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch
>>  create mode 100644 
>> meta/recipes-devtools/go/go-1.10/0006-cmd-dist-separate-host-and-target-builds.patch
>>  create mode 100644 
>> meta/recipes-devtools/go/go-1.10/0

Re: [OE-core] [PATCH v2 0/8] go1.10 update and misc improvements

2018-02-28 Thread Matt Madison
Looks like a multilib issue.  I'll fix it up and send out a v3.

Thanks,
-Matt

On Wed, Feb 28, 2018 at 3:44 AM, Richard Purdie
 wrote:
> On Wed, 2018-02-28 at 08:42 -0300, Otavio Salvador wrote:
>> On Wed, Feb 28, 2018 at 8:37 AM, Richard Purdie
>>  wrote:
>> >
>> > On Wed, 2018-02-28 at 10:47 +, Richard Purdie wrote:
>> > >
>> > > On Tue, 2018-02-27 at 14:16 -0300, Otavio Salvador wrote:
>> > > > tested it in -next, one issue:
>> > >
>> > > FAIL: test_go_dep_build (gotoolchain.oeGoToolchainSelfTest)
>> > >
>> > > from https://autobuilder.yocto.io/builders/nightly-oe-selftest/bu
>> > > ilds
>> > > /8
>> > > 57/steps/Running%20oe-selftest/logs/stdio
>> > >
>> > > (can reproduce with oe-selftest -r
>> > > gotoolchain.oeGoToolchainSelfTest.test_go_dep_build)
>> > Also: https://autobuilder.yocto.io/builders/nightly-world-lsb/build
>> > s/791/steps/BuildImages/logs/stdio
>> >
>> >
>> > Summary: 6 tasks failed:
>> >   virtual:multilib:lib32:/home/pokybuild/yocto-autobuilder/yocto-
>> > worker/nightly-world-lsb/build/meta/recipes-extended/go-
>> > examples/go-helloworld_0.1.bb:do_compile
>> >   virtual:multilib:lib32:/home/pokybuild/yocto-autobuilder/yocto-
>> > worker/nightly-world-lsb/build/meta/recipes-
>> > devtools/glide/glide_0.13.1.bb:do_compile
>> >   virtual:multilib:lib32:/home/pokybuild/yocto-autobuilder/yocto-
>> > worker/nightly-world-lsb/build/meta/recipes-devtools/go/go-
>> > dep_0.4.1.bb:do_compile
>> >   /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-world-
>> > lsb/build/meta/recipes-extended/go-examples/go-
>> > helloworld_0.1.bb:do_compile
>> >   /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-world-
>> > lsb/build/meta/recipes-devtools/glide/glide_0.13.1.bb:do_compile
>> >   /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-world-
>> > lsb/build/meta/recipes-devtools/go/go-dep_0.4.1.bb:do_compile
>> Just to confirm, was it using v2? I had problems with v1.
>
> Yes. Not sure it was just world-lsb and not world that failed...
>
> Cheers,
>
> Richard
>
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v2 4/8] go.bbclass: remove debug-related commands

2018-02-27 Thread Matt Madison
The 'go env' in the do_compile function and
the set -x/+x in the do_install_ptest function
were used for debugging the bbclass, and aren't
really needed.

Signed-off-by: Matt Madison <matt@madison.systems>
---
 meta/classes/go.bbclass | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass
index a126d531b8..a20d2dc0a7 100644
--- a/meta/classes/go.bbclass
+++ b/meta/classes/go.bbclass
@@ -88,7 +88,6 @@ go_do_configure() {
 do_configure[dirs] =+ "${GOTMPDIR}"
 
 go_do_compile() {
-   ${GO} env
if [ -n "${GO_INSTALL}" ]; then
${GO} install ${GO_LINKSHARED} ${GOBUILDFLAGS} 
`go_list_packages`
fi
@@ -120,7 +119,6 @@ go_do_install() {
 }
 
 do_install_ptest_base() {
-set -x
 test -f "${B}/.go_compiled_tests.list" || exit 0
 tests=""
 while read test; do
@@ -154,7 +152,6 @@ EOF
 else
 rm -rf ${D}${PTEST_PATH}
 fi
-set +x
 }
 
 EXPORT_FUNCTIONS do_unpack do_configure do_compile do_install
-- 
2.14.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


  1   2   3   >