mirror of
https://github.com/flatcar/scripts.git
synced 2025-12-07 18:31:54 +01:00
eclass/coreos-go: Improve debug messages.
To aid in debugging build problems add an ebegin/eend to the go_build routine, print out the entire go envronment, and print out the name of each go package as it is built. Signed-off-by: Geoff Levand <geoff@infradead.org>
This commit is contained in:
parent
54eae609a1
commit
47e0061e65
@ -35,10 +35,18 @@ go_build() {
|
||||
local package_name="$1"
|
||||
local binary_name="${package_name##*/}"
|
||||
|
||||
go build -x -p "$(makeopts_jobs)" \
|
||||
ebegin "go build ${package_name}"
|
||||
debug-print $(go env)
|
||||
|
||||
go build -v \
|
||||
-p "$(makeopts_jobs)" \
|
||||
-ldflags "${GO_LDFLAGS} -extldflags '${LDFLAGS}'" \
|
||||
-o "${GOBIN}/${binary_name}" "${package_name}" \
|
||||
|| die "${ECLASS}: go build failed"
|
||||
-o "${GOBIN}/${binary_name}" \
|
||||
"${package_name}"
|
||||
|
||||
local e=${?}
|
||||
local msg="${FUNCNAME}: ${package_name} failed (${e})."
|
||||
eend ${e} "${msg}" || die "${msg}"
|
||||
}
|
||||
|
||||
coreos-go_src_prepare() {
|
||||
@ -47,10 +55,6 @@ coreos-go_src_prepare() {
|
||||
export GOARCH=$(go_get_arch)
|
||||
export GOPATH="${WORKDIR}/gopath"
|
||||
export GOBIN="${GOPATH}/bin"
|
||||
|
||||
debug-print "${FUNCNAME}: GOARCH=${GOARCH}"
|
||||
debug-print "${FUNCNAME}: GOPATH=${GOPATH}"
|
||||
debug-print "${FUNCNAME}: GOBIN=${GOBIN}"
|
||||
|
||||
mkdir -p "${GOBIN}" || die "${ECLASS}: bad path: ${GOBIN}"
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user