etcd: remove gobin requirement for build

This tool is installed as a part of the build process (build.sh sources
test_lib.sh)

This tool has been removed in the latest etcd main branch. Installing it
as a part of the build process breaks bitbake (it doesn't allow
downloading of packages once in the build steps).

This tool is not needed to build etcd (it appears to be used for some
optional test cases).

The following upstream commit removes the use of gobin in the main
branch, but it's not clear to me if the alternative of just running "go
install" will fix this issue. Fundamentally etcd allows package install
during build and bitbake does not:
https://github.com/etcd-io/etcd/commit/900fc8dd7ea578fbf1944836a04e40e98a11f402

Upstream-Status: Inappropriate

Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Andrew Geissler
2023-05-02 13:46:39 -06:00
committed by Khem Raj
parent 078e867c97
commit 4cd2006c6b
2 changed files with 51 additions and 2 deletions
@@ -0,0 +1,49 @@
From a57d78a94e7cbc8cfa468b58c7d4e23668c05fec Mon Sep 17 00:00:00 2001
From: Andrew Geissler <geissonator@yahoo.com>
Date: Tue, 2 May 2023 13:36:36 -0600
Subject: [PATCH] test_lib.sh: remove gobin requirement during build
This tool is installed as a part of the build process (build.sh sources
test_lib.sh)
This tool has been removed in the latest etcd main branch. Installing it
as a part of the build process breaks bitbake (it doesn't allow
downloading of packages once in the build steps).
This tool is not needed to build etcd (it appears to be used for some
optional test cases).
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
---
scripts/test_lib.sh | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/scripts/test_lib.sh b/scripts/test_lib.sh
index 44b9d2895..da97a9c26 100644
--- a/scripts/test_lib.sh
+++ b/scripts/test_lib.sh
@@ -140,7 +140,7 @@ function run {
command=("${command[@]@Q}")
if [[ "${rpath}" != "." && "${rpath}" != "" ]]; then
repro="(cd ${rpath} && ${command[*]})"
- else
+ else
repro="${command[*]}"
fi
@@ -305,7 +305,11 @@ function tool_exists {
# Ensure gobin is available, as it runs majority of the tools
if ! command -v "gobin" >/dev/null; then
- run env GO111MODULE=off go get github.com/myitcv/gobin || exit 1
+ # This script is run as a part of the build process. Installing packages
+ # during the build process is not allowed in bitbake.
+ # Gobin is deprecated and not needed when building in the bitbake env
+ echo "Not installing gobin in bitbake env"
+ # run env GO111MODULE=off go get github.com/myitcv/gobin || exit 1
fi
# tool_get_bin [tool] - returns absolute path to a tool binary (or returns error)
--
2.37.1 (Apple Git-137.1)
+2 -2
View File
@@ -7,6 +7,7 @@ LIC_FILES_CHKSUM = "file://${S}/${GO_INSTALL}/LICENSE;md5=3b83ef96387f14655fc854
SRC_URI = " \
git://github.com/etcd-io/etcd;branch=release-3.5;protocol=https \
file://0001-xxhash-bump-to-v2.1.2.patch;patchdir=src/${GO_IMPORT} \
file://0001-test_lib.sh-remove-gobin-requirement-during-build.patch;patchdir=src/${GO_IMPORT} \
"
SRCREV = "215b53cf3b48ee761f4c40908b3874b2e5e95e9f"
@@ -39,14 +40,13 @@ go_do_compile:prepend() {
cd ${GO_INSTALL}
./build.sh
# Lots of discussion in go community about how it sets packages to
# read-only by default -> https://github.com/golang/go/issues/31481
# etcd is going to need some upstream work to support it.
# For now, set the packages which are read-only back to
# writeable so things like "bitbake -c cleanall etcd" will work.
chmod u+w -R ${S}/src/github.com/myitcv/gobin
chmod u+w -R ${WORKDIR}/build/pkg/mod
}
do_install:append() {