diff mbox series

[RFC,v2,1/7] go: rework patch to avoid identation

Message ID 20240228183011.1495807-1-jose.quaresma@foundries.io
State Accepted, archived
Commit 5065025a66f96140ca895a140067fbde82879941
Headers show
Series [RFC,v2,1/7] go: rework patch to avoid identation | expand

Commit Message

Jose Quaresma Feb. 28, 2024, 6:30 p.m. UTC
It's more hard to read but easy to rebase, no functional changes

Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
---
 ...dist-separate-host-and-target-builds.patch | 136 +++++-------------
 1 file changed, 35 insertions(+), 101 deletions(-)

Comments

Khem Raj Feb. 29, 2024, 5:16 a.m. UTC | #1
Fails to compile bunch of  recipes using go e.g. influxdb, crucible,
syzkaller in meta-oe see

https://autobuilder.yoctoproject.org/typhoon/#/builders/88/builds/3667/steps/15/logs/stdio

On Wed, Feb 28, 2024 at 10:30 AM Jose Quaresma <quaresma.jose@gmail.com> wrote:
>
> It's more hard to read but easy to rebase, no functional changes
>
> Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
> ---
>  ...dist-separate-host-and-target-builds.patch | 136 +++++-------------
>  1 file changed, 35 insertions(+), 101 deletions(-)
>
> diff --git a/meta/recipes-devtools/go/go/0005-cmd-dist-separate-host-and-target-builds.patch b/meta/recipes-devtools/go/go/0005-cmd-dist-separate-host-and-target-builds.patch
> index 29598449da..aa2df58995 100644
> --- a/meta/recipes-devtools/go/go/0005-cmd-dist-separate-host-and-target-builds.patch
> +++ b/meta/recipes-devtools/go/go/0005-cmd-dist-separate-host-and-target-builds.patch
> @@ -3,8 +3,6 @@ From: Alex Kube <alexander.j.kube@gmail.com>
>  Date: Wed, 23 Oct 2019 21:18:12 +0430
>  Subject: [PATCH 5/9] cmd/dist: separate host and target builds
>
> -Upstream-Status: Inappropriate [OE specific]
> -
>  Change the dist tool to allow for OE-style cross-
>  and cross-canadian builds:
>
> @@ -33,13 +31,20 @@ Adapted to Go 1.13 from patches originally submitted to
>  the meta/recipes-devtools/go tree by
>  Matt Madison <matt@madison.systems>.
>
> +Rework the patch to avoid identation, it's more hard to read
> +but easy to rebase.
> +Jose Quaresma <jose.quaresma@foundries.io>
> +
> +Upstream-Status: Inappropriate [OE specific]
> +
>  Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
> +Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
>  ---
> - src/cmd/dist/build.go | 152 +++++++++++++++++++++++++++++++-----------
> - 1 file changed, 113 insertions(+), 39 deletions(-)
> + src/cmd/dist/build.go | 76 ++++++++++++++++++++++++++++++++++++++++++-
> + 1 file changed, 75 insertions(+), 1 deletion(-)
>
>  diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go
> -index 5d31718..1c7f308 100644
> +index 5d3171856a..d0ba54c072 100644
>  --- a/src/cmd/dist/build.go
>  +++ b/src/cmd/dist/build.go
>  @@ -44,6 +44,7 @@ var (
> @@ -119,17 +124,14 @@ index 5d31718..1c7f308 100644
>                 xprintf("\n")
>         }
>
> --      gogcflags = os.Getenv("GO_GCFLAGS") // we were using $BOOT_GO_GCFLAGS until now
> --      setNoOpt()
> --      goldflags = os.Getenv("GO_LDFLAGS") // we were using $BOOT_GO_LDFLAGS until now
>  +      // For split host/target cross/cross-canadian builds, we don't
>  +      // want to be setting these flags until after we have compiled
>  +      // the toolchain that runs on the build host.
>  +      if !crossBuild {
> -+              gogcflags = os.Getenv("GO_GCFLAGS") // we were using $BOOT_GO_GCFLAGS until now
> -+              setNoOpt()
> -+              goldflags = os.Getenv("GO_LDFLAGS") // we were using $BOOT_GO_LDFLAGS until now
> -+      }
> +       gogcflags = os.Getenv("GO_GCFLAGS") // we were using $BOOT_GO_GCFLAGS until now
> +       setNoOpt()
> +       goldflags = os.Getenv("GO_LDFLAGS") // we were using $BOOT_GO_LDFLAGS until now
> ++}
>         goBootstrap := pathf("%s/go_bootstrap", tooldir)
>         cmdGo := pathf("%s/go", gorootBin)
>         if debug {
> @@ -137,25 +139,27 @@ index 5d31718..1c7f308 100644
>                 xprintf("\n")
>         }
>         xprintf("Building Go toolchain2 using go_bootstrap and Go toolchain1.\n")
> --      os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch))
> -+      if crossBuild {
> ++      if !crossBuild {
> +       os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch))
> ++} else {
>  +              os.Setenv("CC", defaultcc[""])
> -+      } else {
> -+              os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch))
>  +      }
>         // Now that cmd/go is in charge of the build process, enable GOEXPERIMENT.
>         os.Setenv("GOEXPERIMENT", goexperiment)
>         goInstall(goBootstrap, toolchain...)
> -@@ -1421,46 +1454,84 @@ func cmdbootstrap() {
> +@@ -1421,6 +1454,7 @@ func cmdbootstrap() {
>                 copyfile(pathf("%s/compile3", tooldir), pathf("%s/compile", tooldir), writeExec)
>         }
>
> --      if goos == oldgoos && goarch == oldgoarch {
> --              // Common case - not setting up for cross-compilation.
> --              timelog("build", "toolchain")
> --              if vflag > 0 {
> --                      xprintf("\n")
> -+      if crossBuild {
> ++      if !crossBuild {
> +       if goos == oldgoos && goarch == oldgoarch {
> +               // Common case - not setting up for cross-compilation.
> +               timelog("build", "toolchain")
> +@@ -1462,6 +1496,42 @@ func cmdbootstrap() {
> +               checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...)
> +               copyfile(pathf("%s/compile4", tooldir), pathf("%s/compile", tooldir), writeExec)
> +       }
> ++} else {
>  +              gogcflags = os.Getenv("GO_GCFLAGS")
>  +              goldflags = os.Getenv("GO_LDFLAGS")
>  +              tool_files, _ := filepath.Glob(pathf("%s/*", tooldir))
> @@ -189,94 +193,24 @@ index 5d31718..1c7f308 100644
>  +                      goInstall(goBootstrap, toBuild...)
>  +                      checkNotStale(goBootstrap, toBuild...)
>  +                      // Skip cmdGo staleness checks here, since we can't run the target's cmdGo binary
> -               }
> --              xprintf("Building packages and commands for %s/%s.\n", goos, goarch)
> -       } else {
> --              // GOOS/GOARCH does not match GOHOSTOS/GOHOSTARCH.
> --              // Finish GOHOSTOS/GOHOSTARCH installation and then
> --              // run GOOS/GOARCH installation.
> --              timelog("build", "host toolchain")
> --              if vflag > 0 {
> --                      xprintf("\n")
> -+
> -+              if goos == oldgoos && goarch == oldgoarch {
> -+                      // Common case - not setting up for cross-compilation.
> -+                      timelog("build", "toolchain")
> -+                      if vflag > 0 {
> -+                              xprintf("\n")
> -+                      }
> -+                      xprintf("Building packages and commands for %s/%s.\n", goos, goarch)
> -+              } else {
> -+                      // GOOS/GOARCH does not match GOHOSTOS/GOHOSTARCH.
> -+                      // Finish GOHOSTOS/GOHOSTARCH installation and then
> -+                      // run GOOS/GOARCH installation.
> -+                      timelog("build", "host toolchain")
> -+                      if vflag > 0 {
> -+                              xprintf("\n")
> -+                      }
> -+                      xprintf("Building packages and commands for host, %s/%s.\n", goos, goarch)
> -+                      goInstall(goBootstrap, "std", "cmd")
> -+                      checkNotStale(goBootstrap, "std", "cmd")
> -+                      checkNotStale(cmdGo, "std", "cmd")
> -+
> -+                      timelog("build", "target toolchain")
> -+                      if vflag > 0 {
> -+                              xprintf("\n")
> -+                      }
> -+                      goos = oldgoos
> -+                      goarch = oldgoarch
> -+                      os.Setenv("GOOS", goos)
> -+                      os.Setenv("GOARCH", goarch)
> -+                      os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch))
> -+                      xprintf("Building packages and commands for target, %s/%s.\n", goos, goarch)
> -               }
> --              xprintf("Building packages and commands for host, %s/%s.\n", goos, goarch)
> -               goInstall(goBootstrap, "std", "cmd")
> -               checkNotStale(goBootstrap, "std", "cmd")
> -               checkNotStale(cmdGo, "std", "cmd")
> -
> --              timelog("build", "target toolchain")
> --              if vflag > 0 {
> --                      xprintf("\n")
> -+              if debug {
> -+                      run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full")
> -+                      run("", ShowOutput|CheckExit, pathf("%s/buildid", tooldir), pathf("%s/pkg/%s_%s/runtime/internal/sys.a", goroot, goos, goarch))
> -+                      checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...)
> -+                      copyfile(pathf("%s/compile4", tooldir), pathf("%s/compile", tooldir), writeExec)
> -               }
> --              goos = oldgoos
> --              goarch = oldgoarch
> --              os.Setenv("GOOS", goos)
> --              os.Setenv("GOARCH", goarch)
> --              os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch))
> --              xprintf("Building packages and commands for target, %s/%s.\n", goos, goarch)
> --      }
> --      targets := []string{"std", "cmd"}
> --      goInstall(goBootstrap, targets...)
> --      checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...)
> --      checkNotStale(goBootstrap, targets...)
> --      checkNotStale(cmdGo, targets...)
> --      if debug {
> --              run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full")
> --              checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...)
> --              copyfile(pathf("%s/compile4", tooldir), pathf("%s/compile", tooldir), writeExec)
> -       }
> ++              }
> ++      }
>
>         // Check that there are no new files in $GOROOT/bin other than
> -@@ -1477,8 +1548,11 @@ func cmdbootstrap() {
> +       // go and gofmt and $GOOS_$GOARCH (target bin when cross-compiling).
> +@@ -1477,8 +1547,12 @@ func cmdbootstrap() {
>                 }
>         }
>
> --      // Remove go_bootstrap now that we're done.
> --      xremove(pathf("%s/go_bootstrap", tooldir))
>  +      // Except that for split host/target cross-builds, we need to
>  +      // keep it.
>  +      if !crossBuild {
> -+              xremove(pathf("%s/go_bootstrap", tooldir))
> -+      }
> +       // Remove go_bootstrap now that we're done.
> +       xremove(pathf("%s/go_bootstrap", tooldir))
> ++}
>
>         if goos == "android" {
>                 // Make sure the exec wrapper will sync a fresh $GOROOT to the device.
>  --
> -2.30.2
> +2.43.0
>
> --
> 2.44.0
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#196400): https://lists.openembedded.org/g/openembedded-core/message/196400
> Mute This Topic: https://lists.openembedded.org/mt/104628621/1997914
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Richard Purdie Feb. 29, 2024, 8:18 a.m. UTC | #2
On Wed, 2024-02-28 at 21:16 -0800, Khem Raj wrote:
> Fails to compile bunch of  recipes using go e.g. influxdb, crucible,
> syzkaller in meta-oe see
> 
> https://autobuilder.yoctoproject.org/typhoon/#/builders/88/builds/3667/steps/15/logs/stdio

Also fails for oe-selftest:

https://autobuilder.yoctoproject.org/typhoon/#/builders/80/builds/6415/steps/14/logs/stdio

and on arm hosts:

https://autobuilder.yoctoproject.org/typhoon/#/builders/97/builds/7999/steps/13/logs/stdio

Cheers,

Richard
Jose Quaresma Feb. 29, 2024, 9:35 a.m. UTC | #3
Richard Purdie <richard.purdie@linuxfoundation.org> escreveu (quinta,
29/02/2024 à(s) 08:18):

> On Wed, 2024-02-28 at 21:16 -0800, Khem Raj wrote:
> > Fails to compile bunch of  recipes using go e.g. influxdb, crucible,
> > syzkaller in meta-oe see
> >
> >
> https://autobuilder.yoctoproject.org/typhoon/#/builders/88/builds/3667/steps/15/logs/stdio
>
> Also fails for oe-selftest:
>
>
> https://autobuilder.yoctoproject.org/typhoon/#/builders/80/builds/6415/steps/14/logs/stdio
>
> and on arm hosts:
>
>
> https://autobuilder.yoctoproject.org/typhoon/#/builders/97/builds/7999/steps/13/logs/stdio



Thanks for testing, I will take a look on all of this today.

Jose


>
>
> Cheers,
>
> Richard
>
Jose Quaresma Feb. 29, 2024, 9:42 p.m. UTC | #4
A quinta, 29/02/2024, 09:35, Jose Quaresma via lists.openembedded.org
<quaresma.jose=gmail.com@lists.openembedded.org> escreveu:

>
>
> Richard Purdie <richard.purdie@linuxfoundation.org> escreveu (quinta,
> 29/02/2024 à(s) 08:18):
>
>> On Wed, 2024-02-28 at 21:16 -0800, Khem Raj wrote:
>> > Fails to compile bunch of  recipes using go e.g. influxdb, crucible,
>> > syzkaller in meta-oe see
>> >
>> >
>> https://autobuilder.yoctoproject.org/typhoon/#/builders/88/builds/3667/steps/15/logs/stdio
>>
>> Also fails for oe-selftest:
>>
>>
>> https://autobuilder.yoctoproject.org/typhoon/#/builders/80/builds/6415/steps/14/logs/stdio
>>
>> and on arm hosts:
>>
>>
>> https://autobuilder.yoctoproject.org/typhoon/#/builders/97/builds/7999/steps/13/logs/stdio
>
>
>
> Thanks for testing, I will take a look on all of this today.
>

I have no progress today and unfortunately I won't have time to work on
this in the next few days :( if anyone wants to continue with this effort,
feel free to do so.

my apologies.

Jose


> Jose
>
>
>>
>>
>> Cheers,
>>
>> Richard
>>
>
>
> --
> Best regards,
>
> José Quaresma
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#196423):
> https://lists.openembedded.org/g/openembedded-core/message/196423
> Mute This Topic: https://lists.openembedded.org/mt/104628621/5052612
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> quaresma.jose@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
Richard Purdie Feb. 29, 2024, 10:19 p.m. UTC | #5
On Thu, 2024-02-29 at 21:42 +0000, Jose Quaresma wrote:
> 
> 
> A quinta, 29/02/2024, 09:35, Jose Quaresma via lists.openembedded.org
> <quaresma.jose=gmail.com@lists.openembedded.org> escreveu:
> > 
> > 
> > Richard Purdie <richard.purdie@linuxfoundation.org> escreveu
> > (quinta, 29/02/2024 à(s) 08:18):
> > > On Wed, 2024-02-28 at 21:16 -0800, Khem Raj wrote:
> > > > Fails to compile bunch of  recipes using go e.g. influxdb,
> > > > crucible,
> > > > syzkaller in meta-oe see
> > > > 
> > > > https://autobuilder.yoctoproject.org/typhoon/#/builders/88/builds/3667/steps/15/logs/stdio
> > > 
> > > Also fails for oe-selftest:
> > > 
> > > https://autobuilder.yoctoproject.org/typhoon/#/builders/80/builds/6415/steps/14/logs/stdio
> > > 
> > > and on arm hosts:
> > > 
> > > https://autobuilder.yoctoproject.org/typhoon/#/builders/97/builds/7999/steps/13/logs/stdio
> > > 
> > 
> > 
> > 
> > Thanks for testing, I will take a look on all of this today.
> 
> I have no progress today and unfortunately I won't have time to work
> on this in the next few days :( if anyone wants to continue with this
> effort, feel free to do so.
> 
> my apologies.

FWIW https://github.com/golang/go/issues/65887 looked relevant to the
first issue.

We are really late in the schedule to pull in things like this so I'm
not sure we'll get this in at this point :/.

Cheers,

Richard
Richard Purdie March 3, 2024, 11:03 p.m. UTC | #6
On Thu, 2024-02-29 at 22:19 +0000, Richard Purdie via
lists.openembedded.org wrote:
> On Thu, 2024-02-29 at 21:42 +0000, Jose Quaresma wrote:
> > 
> > 
> > A quinta, 29/02/2024, 09:35, Jose Quaresma via
> > lists.openembedded.org
> > <quaresma.jose=gmail.com@lists.openembedded.org> escreveu:
> > > 
> > > 
> > > Richard Purdie <richard.purdie@linuxfoundation.org> escreveu
> > > (quinta, 29/02/2024 à(s) 08:18):
> > > > On Wed, 2024-02-28 at 21:16 -0800, Khem Raj wrote:
> > > > > Fails to compile bunch of  recipes using go e.g. influxdb,
> > > > > crucible,
> > > > > syzkaller in meta-oe see
> > > > > 
> > > > > https://autobuilder.yoctoproject.org/typhoon/#/builders/88/builds/3667/steps/15/logs/stdio
> > > > 
> > > > Also fails for oe-selftest:
> > > > 
> > > > https://autobuilder.yoctoproject.org/typhoon/#/builders/80/builds/6415/steps/14/logs/stdio
> > > > 
> > > > and on arm hosts:
> > > > 
> > > > https://autobuilder.yoctoproject.org/typhoon/#/builders/97/builds/7999/steps/13/logs/stdio
> > > > 
> > > 
> > > 
> > > 
> > > Thanks for testing, I will take a look on all of this today.
> > 
> > I have no progress today and unfortunately I won't have time to
> > work
> > on this in the next few days :( if anyone wants to continue with
> > this
> > effort, feel free to do so.
> > 
> > my apologies.
> 
> FWIW https://github.com/golang/go/issues/65887 looked relevant to the
> first issue.
> 
> We are really late in the schedule to pull in things like this so I'm
> not sure we'll get this in at this point :/.
> 

I've some tweaks in master-next I'm testing to see if it does sort
1.22...


Cheers,

Richard
Jose Quaresma March 5, 2024, 2:55 p.m. UTC | #7
Richard Purdie <richard.purdie@linuxfoundation.org> escreveu (domingo,
3/03/2024 à(s) 23:03):

> On Thu, 2024-02-29 at 22:19 +0000, Richard Purdie via
> lists.openembedded.org wrote:
> > On Thu, 2024-02-29 at 21:42 +0000, Jose Quaresma wrote:
> > >
> > >
> > > A quinta, 29/02/2024, 09:35, Jose Quaresma via
> > > lists.openembedded.org
> > > <quaresma.jose=gmail.com@lists.openembedded.org> escreveu:
> > > >
> > > >
> > > > Richard Purdie <richard.purdie@linuxfoundation.org> escreveu
> > > > (quinta, 29/02/2024 à(s) 08:18):
> > > > > On Wed, 2024-02-28 at 21:16 -0800, Khem Raj wrote:
> > > > > > Fails to compile bunch of  recipes using go e.g. influxdb,
> > > > > > crucible,
> > > > > > syzkaller in meta-oe see
> > > > > >
> > > > > >
> https://autobuilder.yoctoproject.org/typhoon/#/builders/88/builds/3667/steps/15/logs/stdio
> > > > >
> > > > > Also fails for oe-selftest:
> > > > >
> > > > >
> https://autobuilder.yoctoproject.org/typhoon/#/builders/80/builds/6415/steps/14/logs/stdio
> > > > >
> > > > > and on arm hosts:
> > > > >
> > > > >
> https://autobuilder.yoctoproject.org/typhoon/#/builders/97/builds/7999/steps/13/logs/stdio
> > > > >
> > > >
> > > >
> > > >
> > > > Thanks for testing, I will take a look on all of this today.
> > >
> > > I have no progress today and unfortunately I won't have time to
> > > work
> > > on this in the next few days :( if anyone wants to continue with
> > > this
> > > effort, feel free to do so.
> > >
> > > my apologies.
> >
> > FWIW https://github.com/golang/go/issues/65887 looked relevant to the
> > first issue.
> >
> > We are really late in the schedule to pull in things like this so I'm
> > not sure we'll get this in at this point :/.
> >


Having the 1.21 bump was already a significant benefit for the project in
my opinion.
so if you drop the 1.22 the impact is much reduced.


>
> I've some tweaks in master-next I'm testing to see if it does sort
> 1.22...
>

I also will do some tests with your changes in main-next to see if I found
any runtime issue.

Jose


>
>
> Cheers,
>
> Richard
>
>
Jose Quaresma March 6, 2024, 10:21 a.m. UTC | #8
Jose Quaresma via lists.openembedded.org <quaresma.jose=
gmail.com@lists.openembedded.org> escreveu (terça, 5/03/2024 à(s) 14:55):

>
>
> Richard Purdie <richard.purdie@linuxfoundation.org> escreveu (domingo,
> 3/03/2024 à(s) 23:03):
>
>> On Thu, 2024-02-29 at 22:19 +0000, Richard Purdie via
>> lists.openembedded.org wrote:
>> > On Thu, 2024-02-29 at 21:42 +0000, Jose Quaresma wrote:
>> > >
>> > >
>> > > A quinta, 29/02/2024, 09:35, Jose Quaresma via
>> > > lists.openembedded.org
>> > > <quaresma.jose=gmail.com@lists.openembedded.org> escreveu:
>> > > >
>> > > >
>> > > > Richard Purdie <richard.purdie@linuxfoundation.org> escreveu
>> > > > (quinta, 29/02/2024 à(s) 08:18):
>> > > > > On Wed, 2024-02-28 at 21:16 -0800, Khem Raj wrote:
>> > > > > > Fails to compile bunch of  recipes using go e.g. influxdb,
>> > > > > > crucible,
>> > > > > > syzkaller in meta-oe see
>> > > > > >
>> > > > > >
>> https://autobuilder.yoctoproject.org/typhoon/#/builders/88/builds/3667/steps/15/logs/stdio
>> > > > >
>> > > > > Also fails for oe-selftest:
>> > > > >
>> > > > >
>> https://autobuilder.yoctoproject.org/typhoon/#/builders/80/builds/6415/steps/14/logs/stdio
>> > > > >
>> > > > > and on arm hosts:
>> > > > >
>> > > > >
>> https://autobuilder.yoctoproject.org/typhoon/#/builders/97/builds/7999/steps/13/logs/stdio
>> > > > >
>> > > >
>> > > >
>> > > >
>> > > > Thanks for testing, I will take a look on all of this today.
>> > >
>> > > I have no progress today and unfortunately I won't have time to
>> > > work
>> > > on this in the next few days :( if anyone wants to continue with
>> > > this
>> > > effort, feel free to do so.
>> > >
>> > > my apologies.
>> >
>> > FWIW https://github.com/golang/go/issues/65887 looked relevant to the
>> > first issue.
>> >
>> > We are really late in the schedule to pull in things like this so I'm
>> > not sure we'll get this in at this point :/.
>> >
>
>
> Having the 1.21 bump was already a significant benefit for the project in
> my opinion.
> so if you drop the 1.22 the impact is much reduced.
>
>
>>
>> I've some tweaks in master-next I'm testing to see if it does sort
>> 1.22...
>>
>
> I also will do some tests with your changes in main-next to see if I found
> any runtime issue.
>

The stack I have tested may be considered a bit limited but I didn't find
anything relevant that prevents integration.
If this bump to 1.22 can be tested with meta-virt the results would be a
wider range.

Jose


>
> Jose
>
>
>>
>>
>> Cheers,
>>
>> Richard
>>
>>
>
> --
> Best regards,
>
> José Quaresma
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#196634):
> https://lists.openembedded.org/g/openembedded-core/message/196634
> Mute This Topic: https://lists.openembedded.org/mt/104628621/5052612
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> quaresma.jose@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
Richard Purdie March 6, 2024, 10:58 a.m. UTC | #9
On Wed, 2024-03-06 at 02:22 -0800, Jose Quaresma wrote:
> 
> 
> Jose Quaresma via lists.openembedded.org
> <quaresma.jose=gmail.com@lists.openembedded.org> escreveu (terça,
> 5/03/2024 à(s) 14:55):
> > 
> > 
> > Richard Purdie <richard.purdie@linuxfoundation.org> escreveu
> > (domingo, 3/03/2024 à(s) 23:03):
> > > On Thu, 2024-02-29 at 22:19 +0000, Richard Purdie via
> > > lists.openembedded.org wrote:
> > > > On Thu, 2024-02-29 at 21:42 +0000, Jose Quaresma wrote:
> > > > > 
> > > > > 
> > > > > A quinta, 29/02/2024, 09:35, Jose Quaresma via
> > > > > lists.openembedded.org
> > > > > <quaresma.jose=gmail.com@lists.openembedded.org> escreveu:
> > > > > > 
> > > > > > 
> > > > > > Richard Purdie <richard.purdie@linuxfoundation.org>
> > > > > > escreveu
> > > > > > (quinta, 29/02/2024 à(s) 08:18):
> > > > > > > On Wed, 2024-02-28 at 21:16 -0800, Khem Raj wrote:
> > > > > > > > Fails to compile bunch of  recipes using go e.g.
> > > > > > > > influxdb,
> > > > > > > > crucible,
> > > > > > > > syzkaller in meta-oe see
> > > > > > > > 
> > > > > > > > https://autobuilder.yoctoproject.org/typhoon/#/builders/88/builds/3667/steps/15/logs/stdio
> > > > > > > 
> > > > > > > Also fails for oe-selftest:
> > > > > > > 
> > > > > > > https://autobuilder.yoctoproject.org/typhoon/#/builders/80/builds/6415/steps/14/logs/stdio
> > > > > > > 
> > > > > > > and on arm hosts:
> > > > > > > 
> > > > > > > https://autobuilder.yoctoproject.org/typhoon/#/builders/97/builds/7999/steps/13/logs/stdio
> > > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > Thanks for testing, I will take a look on all of this
> > > > > > today.
> > > > > 
> > > > > I have no progress today and unfortunately I won't have time
> > > > > to
> > > > > work
> > > > > on this in the next few days :( if anyone wants to continue
> > > > > with
> > > > > this
> > > > > effort, feel free to do so.
> > > > > 
> > > > > my apologies.
> > > > 
> > > > FWIW https://github.com/golang/go/issues/65887 looked relevant
> > > > to the
> > > > first issue.
> > > > 
> > > > We are really late in the schedule to pull in things like this
> > > > so I'm
> > > > not sure we'll get this in at this point :/.
> > > > 
> > > 
> > 
> > 
> > Having the 1.21 bump was already a significant benefit for the
> > project in my opinion.
> > so if you drop the 1.22 the impact is much reduced.
> > 
> > >  
> > > 
> > > I've some tweaks in master-next I'm testing to see if it does
> > > sort
> > > 1.22...
> > > 
> > 
> > 
> > I also will do some tests with your changes in main-next to see if
> > I found any runtime issue.
> > 
> 
> 
> The stack I have tested may be considered a bit limited but I didn't
> find anything relevant that prevents integration.
> If this bump to 1.22 can be tested with meta-virt the results would
> be a wider range.

I believe Khem tested meta-oe and Bruce agreed he was ok with merging
this so I will probably merge the 1.22 patches in -next.

Cheers,

Richard
Jose Quaresma March 6, 2024, 11:04 a.m. UTC | #10
Richard Purdie <richard.purdie@linuxfoundation.org> escreveu (quarta,
6/03/2024 à(s) 10:58):

> On Wed, 2024-03-06 at 02:22 -0800, Jose Quaresma wrote:
> >
> >
> > Jose Quaresma via lists.openembedded.org
> > <quaresma.jose=gmail.com@lists.openembedded.org> escreveu (terça,
> > 5/03/2024 à(s) 14:55):
> > >
> > >
> > > Richard Purdie <richard.purdie@linuxfoundation.org> escreveu
> > > (domingo, 3/03/2024 à(s) 23:03):
> > > > On Thu, 2024-02-29 at 22:19 +0000, Richard Purdie via
> > > > lists.openembedded.org wrote:
> > > > > On Thu, 2024-02-29 at 21:42 +0000, Jose Quaresma wrote:
> > > > > >
> > > > > >
> > > > > > A quinta, 29/02/2024, 09:35, Jose Quaresma via
> > > > > > lists.openembedded.org
> > > > > > <quaresma.jose=gmail.com@lists.openembedded.org> escreveu:
> > > > > > >
> > > > > > >
> > > > > > > Richard Purdie <richard.purdie@linuxfoundation.org>
> > > > > > > escreveu
> > > > > > > (quinta, 29/02/2024 à(s) 08:18):
> > > > > > > > On Wed, 2024-02-28 at 21:16 -0800, Khem Raj wrote:
> > > > > > > > > Fails to compile bunch of  recipes using go e.g.
> > > > > > > > > influxdb,
> > > > > > > > > crucible,
> > > > > > > > > syzkaller in meta-oe see
> > > > > > > > >
> > > > > > > > >
> https://autobuilder.yoctoproject.org/typhoon/#/builders/88/builds/3667/steps/15/logs/stdio
> > > > > > > >
> > > > > > > > Also fails for oe-selftest:
> > > > > > > >
> > > > > > > >
> https://autobuilder.yoctoproject.org/typhoon/#/builders/80/builds/6415/steps/14/logs/stdio
> > > > > > > >
> > > > > > > > and on arm hosts:
> > > > > > > >
> > > > > > > >
> https://autobuilder.yoctoproject.org/typhoon/#/builders/97/builds/7999/steps/13/logs/stdio
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Thanks for testing, I will take a look on all of this
> > > > > > > today.
> > > > > >
> > > > > > I have no progress today and unfortunately I won't have time
> > > > > > to
> > > > > > work
> > > > > > on this in the next few days :( if anyone wants to continue
> > > > > > with
> > > > > > this
> > > > > > effort, feel free to do so.
> > > > > >
> > > > > > my apologies.
> > > > >
> > > > > FWIW https://github.com/golang/go/issues/65887 looked relevant
> > > > > to the
> > > > > first issue.
> > > > >
> > > > > We are really late in the schedule to pull in things like this
> > > > > so I'm
> > > > > not sure we'll get this in at this point :/.
> > > > >
> > > >
> > >
> > >
> > > Having the 1.21 bump was already a significant benefit for the
> > > project in my opinion.
> > > so if you drop the 1.22 the impact is much reduced.
> > >
> > > >
> > > >
> > > > I've some tweaks in master-next I'm testing to see if it does
> > > > sort
> > > > 1.22...
> > > >
> > >
> > >
> > > I also will do some tests with your changes in main-next to see if
> > > I found any runtime issue.
> > >
> >
> >
> > The stack I have tested may be considered a bit limited but I didn't
> > find anything relevant that prevents integration.
> > If this bump to 1.22 can be tested with meta-virt the results would
> > be a wider range.
>
> I believe Khem tested meta-oe and Bruce agreed he was ok with merging
> this so I will probably merge the 1.22 patches in -next.
>

Great news!
and thank you for helping to solve this big problem that I had been trying
to fix for a good few months.

Jose


> Cheers,
>
> Richard
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#196663):
> https://lists.openembedded.org/g/openembedded-core/message/196663
> Mute This Topic: https://lists.openembedded.org/mt/104628621/5052612
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> quaresma.jose@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
diff mbox series

Patch

diff --git a/meta/recipes-devtools/go/go/0005-cmd-dist-separate-host-and-target-builds.patch b/meta/recipes-devtools/go/go/0005-cmd-dist-separate-host-and-target-builds.patch
index 29598449da..aa2df58995 100644
--- a/meta/recipes-devtools/go/go/0005-cmd-dist-separate-host-and-target-builds.patch
+++ b/meta/recipes-devtools/go/go/0005-cmd-dist-separate-host-and-target-builds.patch
@@ -3,8 +3,6 @@  From: Alex Kube <alexander.j.kube@gmail.com>
 Date: Wed, 23 Oct 2019 21:18:12 +0430
 Subject: [PATCH 5/9] cmd/dist: separate host and target builds
 
-Upstream-Status: Inappropriate [OE specific]
-
 Change the dist tool to allow for OE-style cross-
 and cross-canadian builds:
 
@@ -33,13 +31,20 @@  Adapted to Go 1.13 from patches originally submitted to
 the meta/recipes-devtools/go tree by
 Matt Madison <matt@madison.systems>.
 
+Rework the patch to avoid identation, it's more hard to read
+but easy to rebase.
+Jose Quaresma <jose.quaresma@foundries.io>
+
+Upstream-Status: Inappropriate [OE specific]
+
 Signed-off-by: Alexander J Kube <alexander.j.kube@gmail.com>
+Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
 ---
- src/cmd/dist/build.go | 152 +++++++++++++++++++++++++++++++-----------
- 1 file changed, 113 insertions(+), 39 deletions(-)
+ src/cmd/dist/build.go | 76 ++++++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 75 insertions(+), 1 deletion(-)
 
 diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go
-index 5d31718..1c7f308 100644
+index 5d3171856a..d0ba54c072 100644
 --- a/src/cmd/dist/build.go
 +++ b/src/cmd/dist/build.go
 @@ -44,6 +44,7 @@ var (
@@ -119,17 +124,14 @@  index 5d31718..1c7f308 100644
  		xprintf("\n")
  	}
  
--	gogcflags = os.Getenv("GO_GCFLAGS") // we were using $BOOT_GO_GCFLAGS until now
--	setNoOpt()
--	goldflags = os.Getenv("GO_LDFLAGS") // we were using $BOOT_GO_LDFLAGS until now
 +	// For split host/target cross/cross-canadian builds, we don't
 +	// want to be setting these flags until after we have compiled
 +	// the toolchain that runs on the build host.
 +	if !crossBuild {
-+		gogcflags = os.Getenv("GO_GCFLAGS") // we were using $BOOT_GO_GCFLAGS until now
-+		setNoOpt()
-+		goldflags = os.Getenv("GO_LDFLAGS") // we were using $BOOT_GO_LDFLAGS until now
-+	}
+ 	gogcflags = os.Getenv("GO_GCFLAGS") // we were using $BOOT_GO_GCFLAGS until now
+ 	setNoOpt()
+ 	goldflags = os.Getenv("GO_LDFLAGS") // we were using $BOOT_GO_LDFLAGS until now
++}
  	goBootstrap := pathf("%s/go_bootstrap", tooldir)
  	cmdGo := pathf("%s/go", gorootBin)
  	if debug {
@@ -137,25 +139,27 @@  index 5d31718..1c7f308 100644
  		xprintf("\n")
  	}
  	xprintf("Building Go toolchain2 using go_bootstrap and Go toolchain1.\n")
--	os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch))
-+	if crossBuild {
++	if !crossBuild {
+ 	os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch))
++} else {
 +		os.Setenv("CC", defaultcc[""])
-+	} else {
-+		os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch))
 +	}
  	// Now that cmd/go is in charge of the build process, enable GOEXPERIMENT.
  	os.Setenv("GOEXPERIMENT", goexperiment)
  	goInstall(goBootstrap, toolchain...)
-@@ -1421,46 +1454,84 @@ func cmdbootstrap() {
+@@ -1421,6 +1454,7 @@ func cmdbootstrap() {
  		copyfile(pathf("%s/compile3", tooldir), pathf("%s/compile", tooldir), writeExec)
  	}
  
--	if goos == oldgoos && goarch == oldgoarch {
--		// Common case - not setting up for cross-compilation.
--		timelog("build", "toolchain")
--		if vflag > 0 {
--			xprintf("\n")
-+	if crossBuild {
++	if !crossBuild {
+ 	if goos == oldgoos && goarch == oldgoarch {
+ 		// Common case - not setting up for cross-compilation.
+ 		timelog("build", "toolchain")
+@@ -1462,6 +1496,42 @@ func cmdbootstrap() {
+ 		checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...)
+ 		copyfile(pathf("%s/compile4", tooldir), pathf("%s/compile", tooldir), writeExec)
+ 	}
++} else {
 +		gogcflags = os.Getenv("GO_GCFLAGS")
 +		goldflags = os.Getenv("GO_LDFLAGS")
 +		tool_files, _ := filepath.Glob(pathf("%s/*", tooldir))
@@ -189,94 +193,24 @@  index 5d31718..1c7f308 100644
 +			goInstall(goBootstrap, toBuild...)
 +			checkNotStale(goBootstrap, toBuild...)
 +			// Skip cmdGo staleness checks here, since we can't run the target's cmdGo binary
- 		}
--		xprintf("Building packages and commands for %s/%s.\n", goos, goarch)
- 	} else {
--		// GOOS/GOARCH does not match GOHOSTOS/GOHOSTARCH.
--		// Finish GOHOSTOS/GOHOSTARCH installation and then
--		// run GOOS/GOARCH installation.
--		timelog("build", "host toolchain")
--		if vflag > 0 {
--			xprintf("\n")
-+
-+		if goos == oldgoos && goarch == oldgoarch {
-+			// Common case - not setting up for cross-compilation.
-+			timelog("build", "toolchain")
-+			if vflag > 0 {
-+				xprintf("\n")
-+			}
-+			xprintf("Building packages and commands for %s/%s.\n", goos, goarch)
-+		} else {
-+			// GOOS/GOARCH does not match GOHOSTOS/GOHOSTARCH.
-+			// Finish GOHOSTOS/GOHOSTARCH installation and then
-+			// run GOOS/GOARCH installation.
-+			timelog("build", "host toolchain")
-+			if vflag > 0 {
-+				xprintf("\n")
-+			}
-+			xprintf("Building packages and commands for host, %s/%s.\n", goos, goarch)
-+			goInstall(goBootstrap, "std", "cmd")
-+			checkNotStale(goBootstrap, "std", "cmd")
-+			checkNotStale(cmdGo, "std", "cmd")
-+
-+			timelog("build", "target toolchain")
-+			if vflag > 0 {
-+				xprintf("\n")
-+			}
-+			goos = oldgoos
-+			goarch = oldgoarch
-+			os.Setenv("GOOS", goos)
-+			os.Setenv("GOARCH", goarch)
-+			os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch))
-+			xprintf("Building packages and commands for target, %s/%s.\n", goos, goarch)
- 		}
--		xprintf("Building packages and commands for host, %s/%s.\n", goos, goarch)
- 		goInstall(goBootstrap, "std", "cmd")
- 		checkNotStale(goBootstrap, "std", "cmd")
- 		checkNotStale(cmdGo, "std", "cmd")
- 
--		timelog("build", "target toolchain")
--		if vflag > 0 {
--			xprintf("\n")
-+		if debug {
-+			run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full")
-+			run("", ShowOutput|CheckExit, pathf("%s/buildid", tooldir), pathf("%s/pkg/%s_%s/runtime/internal/sys.a", goroot, goos, goarch))
-+			checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...)
-+			copyfile(pathf("%s/compile4", tooldir), pathf("%s/compile", tooldir), writeExec)
- 		}
--		goos = oldgoos
--		goarch = oldgoarch
--		os.Setenv("GOOS", goos)
--		os.Setenv("GOARCH", goarch)
--		os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch))
--		xprintf("Building packages and commands for target, %s/%s.\n", goos, goarch)
--	}
--	targets := []string{"std", "cmd"}
--	goInstall(goBootstrap, targets...)
--	checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...)
--	checkNotStale(goBootstrap, targets...)
--	checkNotStale(cmdGo, targets...)
--	if debug {
--		run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full")
--		checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...)
--		copyfile(pathf("%s/compile4", tooldir), pathf("%s/compile", tooldir), writeExec)
- 	}
++		}
++	}
  
  	// Check that there are no new files in $GOROOT/bin other than
-@@ -1477,8 +1548,11 @@ func cmdbootstrap() {
+ 	// go and gofmt and $GOOS_$GOARCH (target bin when cross-compiling).
+@@ -1477,8 +1547,12 @@ func cmdbootstrap() {
  		}
  	}
  
--	// Remove go_bootstrap now that we're done.
--	xremove(pathf("%s/go_bootstrap", tooldir))
 +	// Except that for split host/target cross-builds, we need to
 +	// keep it.
 +	if !crossBuild {
-+		xremove(pathf("%s/go_bootstrap", tooldir))
-+	}
+ 	// Remove go_bootstrap now that we're done.
+ 	xremove(pathf("%s/go_bootstrap", tooldir))
++}
  
  	if goos == "android" {
  		// Make sure the exec wrapper will sync a fresh $GOROOT to the device.
 -- 
-2.30.2
+2.43.0