Skip to contentSkip to conversation

package/pkg-golang: enable trimpath option for reproducible builds

PATCH New Christian Stewart 2 participants 2 messages Dec 7, 2019 – Dec 8, 2019

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 package/pkg-golang: enable trimpath option for reproducible builds

The -trimpath option removes absolute build paths from the target binary. This results in more consistent / reproducible builds across different systems with varying paths to Buildroot.

---

v1 -> v2:

- Fixed indentation on trimpath

 package/pkg-golang.mk | 1 +
 1 file changed, 1 insertion(+)
package/pkg-golang.mk +1 -0
index e47de17aba..2494ce028c 100644
@@ -61,6 +61,7 @@ $(2)_WORKSPACE ?= _gopath
 $(2)_BUILD_OPTS += \
 	-ldflags "$$($(2)_LDFLAGS)" \
 	-tags "$$($(2)_TAGS)" \
+	-trimpath \
 	-p $(PARALLEL_JOBS)
 
 # Target packages need the Go compiler on the host.
Signature · 1 line
2.24.0
#1 lore raw

PATCH v2 1/1 package/pkg-golang: enable trimpath option for reproducible builds

Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Christian" == Christian Stewart <[email protected]> writes:

The -trimpath option removes absolute build paths from the target binary. This results in more consistent / reproducible builds across different systems with varying paths to Buildroot.

---

v1 -> v2:
- Fixed indentation on trimpath

Committed after extending the commit message to clarify that this is a new feature in go 1.13, so we shouldn't backport this to 2019.02.x.

Signature · 1 line
Bye, Peter Korsgaard