diff mbox series

go: revert an oe-specific patch

Message ID 20240204052507.623825-1-changqing.li@windriver.com
State Rejected, archived
Headers show
Series go: revert an oe-specific patch | expand

Commit Message

Changqing Li Feb. 4, 2024, 5:25 a.m. UTC
From: Changqing Li <changqing.li@windriver.com>

patch 0007-exec.go-do-not-write-linker-flags-into-buildids.patch
removes linker flags from buildids for not breaking reproducibility,
but it seems that this will make go not rebuild when linker flag
changes, Refer [1]. So revert this oe-specific patch, need to find
a more proper way to fix reproducibilities.

[1] https://github.com/golang/go/issues/63760

Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
 meta/recipes-devtools/go/go-1.20.13.inc       |  1 -
 ...not-write-linker-flags-into-buildids.patch | 41 -------------------
 2 files changed, 42 deletions(-)
 delete mode 100644 meta/recipes-devtools/go/go/0007-exec.go-do-not-write-linker-flags-into-buildids.patch

Comments

Richard Purdie Feb. 4, 2024, 10:11 a.m. UTC | #1
On Sun, 2024-02-04 at 13:25 +0800, Changqing Li wrote:
> From: Changqing Li <changqing.li@windriver.com>
> 
> patch 0007-exec.go-do-not-write-linker-flags-into-buildids.patch
> removes linker flags from buildids for not breaking reproducibility,
> but it seems that this will make go not rebuild when linker flag
> changes, Refer [1]. So revert this oe-specific patch, need to find
> a more proper way to fix reproducibilities.
> 
> [1] https://github.com/golang/go/issues/63760
> 
> Signed-off-by: Changqing Li <changqing.li@windriver.com>
> ---
>  meta/recipes-devtools/go/go-1.20.13.inc       |  1 -
>  ...not-write-linker-flags-into-buildids.patch | 41 -------------------
>  2 files changed, 42 deletions(-)
>  delete mode 100644 meta/recipes-devtools/go/go/0007-exec.go-do-not-write-linker-flags-into-buildids.patch
> 
> diff --git a/meta/recipes-devtools/go/go-1.20.13.inc b/meta/recipes-devtools/go/go-1.20.13.inc
> index b6eeb651c9..3b0beb7233 100644
> --- a/meta/recipes-devtools/go/go-1.20.13.inc
> +++ b/meta/recipes-devtools/go/go-1.20.13.inc
> @@ -11,7 +11,6 @@ SRC_URI += "\
>      file://0004-make.bash-override-CC-when-building-dist-and-go_boot.patch \
>      file://0005-cmd-dist-separate-host-and-target-builds.patch \
>      file://0006-cmd-go-make-GOROOT-precious-by-default.patch \
> -    file://0007-exec.go-do-not-write-linker-flags-into-buildids.patch \
>      file://0008-src-cmd-dist-buildgo.go-do-not-hardcode-host-compile.patch \
>      file://0009-go-Filter-build-paths-on-staticly-linked-arches.patch \
>  "

We can't just delete this as reproducibility will then break.

Please find a patch to replace this which fixes the issue and allows
reproducibility.

We probably need to filter the linker flags and remove the problematic
ones.

Cheers,

Richard
diff mbox series

Patch

diff --git a/meta/recipes-devtools/go/go-1.20.13.inc b/meta/recipes-devtools/go/go-1.20.13.inc
index b6eeb651c9..3b0beb7233 100644
--- a/meta/recipes-devtools/go/go-1.20.13.inc
+++ b/meta/recipes-devtools/go/go-1.20.13.inc
@@ -11,7 +11,6 @@  SRC_URI += "\
     file://0004-make.bash-override-CC-when-building-dist-and-go_boot.patch \
     file://0005-cmd-dist-separate-host-and-target-builds.patch \
     file://0006-cmd-go-make-GOROOT-precious-by-default.patch \
-    file://0007-exec.go-do-not-write-linker-flags-into-buildids.patch \
     file://0008-src-cmd-dist-buildgo.go-do-not-hardcode-host-compile.patch \
     file://0009-go-Filter-build-paths-on-staticly-linked-arches.patch \
 "
diff --git a/meta/recipes-devtools/go/go/0007-exec.go-do-not-write-linker-flags-into-buildids.patch b/meta/recipes-devtools/go/go/0007-exec.go-do-not-write-linker-flags-into-buildids.patch
deleted file mode 100644
index 7d9869b536..0000000000
--- a/meta/recipes-devtools/go/go/0007-exec.go-do-not-write-linker-flags-into-buildids.patch
+++ /dev/null
@@ -1,41 +0,0 @@ 
-From 0ba747e6a4b251a0d9eed0cfd8f8c491bb508040 Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin <alex.kanavin@gmail.com>
-Date: Mon, 23 Nov 2020 19:22:04 +0000
-Subject: [PATCH 7/9] exec.go: do not write linker flags into buildids
-
-The flags can contain build-specific paths, breaking reproducibility.
-
-To make this acceptable to upstream, we probably need to trim the flags,
-removing those known to be buildhost-specific.
-
-Upstream-Status: Inappropriate [needs upstream discussion]
-Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
----
- src/cmd/go/internal/work/exec.go | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go
-index cde867b..5cb1812 100644
---- a/src/cmd/go/internal/work/exec.go
-+++ b/src/cmd/go/internal/work/exec.go
-@@ -1331,7 +1331,7 @@ func (b *Builder) linkActionID(a *Action) cache.ActionID {
- 	}
- 
- 	// Toolchain-dependent configuration, shared with b.linkSharedActionID.
--	b.printLinkerConfig(h, p)
-+	//b.printLinkerConfig(h, p)
- 
- 	// Input files.
- 	for _, a1 := range a.Deps {
-@@ -1626,7 +1626,7 @@ func (b *Builder) linkSharedActionID(a *Action) cache.ActionID {
- 	fmt.Fprintf(h, "goos %s goarch %s\n", cfg.Goos, cfg.Goarch)
- 
- 	// Toolchain-dependent configuration, shared with b.linkActionID.
--	b.printLinkerConfig(h, nil)
-+	//b.printLinkerConfig(h, nil)
- 
- 	// Input files.
- 	for _, a1 := range a.Deps {
--- 
-2.30.2
-