]> code.ossystems Code Review - openembedded-core.git/commitdiff
go: log build id computations
authorAlexander Kanavin <alex.kanavin@gmail.com>
Sat, 1 Jan 2022 11:29:54 +0000 (12:29 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 5 Jan 2022 17:18:11 +0000 (17:18 +0000)
go writes build-specific ids into binaries it produces
and has a custom system for calculating them from
file hashes, environment variables and other inputs
(not that dissimilar to sstate cache, actually). This can
go wrong :) in various ways (for purposes of reproducibility
in particular), so this enables useful logs to see what
happens and why.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/go.bbclass
meta/recipes-devtools/go/go-common.inc

index aa54b4a08c352dfa910f009a897aec5507eb017f..5c1fdd7d5f72178ceeaff5a7636f5bbe77ae736e 100644 (file)
@@ -2,6 +2,8 @@ inherit goarch
 
 GO_PARALLEL_BUILD ?= "${@oe.utils.parallel_make_argument(d, '-p %d')}"
 
+export GODEBUG = "gocachehash=1"
+
 GOROOT:class-native = "${STAGING_LIBDIR_NATIVE}/go"
 GOROOT:class-nativesdk = "${STAGING_DIR_TARGET}${libdir}/go"
 GOROOT = "${STAGING_LIBDIR}/go"
index dfccebdb83a4c74427ddb00040203e4292b59abf..5bbf35b7873979c42cd4fa8df4f48fed949abfd6 100644 (file)
@@ -37,6 +37,8 @@ export GO386 ?= "${TARGET_GO386}"
 export GOMIPS ?= "${TARGET_GOMIPS}"
 export GOROOT_FINAL ?= "${libdir}/go"
 
+export GODEBUG = "gocachehash=1"
+
 do_compile:prepend() {
        BUILD_CC=${BUILD_CC}
 }