diff options
| author | Robert Yang <liezhi.yang@windriver.com> | 2020-10-15 02:01:04 -0700 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2020-10-15 10:57:12 -0400 |
| commit | 28fda6d8488588ac1d2e1799482dcebdc79cd412 (patch) | |
| tree | 1c43b4301d6ef4a67319a384ef73f04eaca0ae75 | |
| parent | 80d83eacda410377e36d6e90db4f07d71888adbb (diff) | |
| download | meta-virtualization-28fda6d8488588ac1d2e1799482dcebdc79cd412.tar.gz | |
kubernetes: Fix race issue for installing go2make
The src/import/build/root/Makefile.generated_files are called several times
during the build, so the following target which installs go2make will also run
several times:
$(META_DIR)/$(GO_PKGDEPS_FILE): FORCE
It runs automatically when the Makefile is called because of:
sinclude $(META_DIR)/$(GO_PKGDEPS_FILE)
So there is a race issue of go2make when parallel build:
hack/run-in-gopath.sh: line 34: build/tmp-glibc/work/corei7-64-wrs-linux/kubernetes/1.18.8-r0/git/src/import/_output/local/go/bin/go2make: No suc h file or directory
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
| -rw-r--r-- | recipes-containers/kubernetes/kubernetes/0001-Makefile.generated_files-Fix-race-issue-for-installi.patch | 48 | ||||
| -rw-r--r-- | recipes-containers/kubernetes/kubernetes_git.bb | 1 |
2 files changed, 49 insertions, 0 deletions
diff --git a/recipes-containers/kubernetes/kubernetes/0001-Makefile.generated_files-Fix-race-issue-for-installi.patch b/recipes-containers/kubernetes/kubernetes/0001-Makefile.generated_files-Fix-race-issue-for-installi.patch new file mode 100644 index 00000000..97273e4f --- /dev/null +++ b/recipes-containers/kubernetes/kubernetes/0001-Makefile.generated_files-Fix-race-issue-for-installi.patch | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | From 441df8a24a2c80e320f140b5d9bc352c7ce8a64a Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Robert Yang <liezhi.yang@windriver.com> | ||
| 3 | Date: Thu, 15 Oct 2020 07:27:35 +0000 | ||
| 4 | Subject: [PATCH] src/import/build/root/Makefile.generated_files: Fix race issue for installing | ||
| 5 | go2make | ||
| 6 | |||
| 7 | The src/import/build/root/Makefile.generated_files are called several times during the build, so the | ||
| 8 | following target which installs go2make will also run several times: | ||
| 9 | |||
| 10 | $(META_DIR)/$(GO_PKGDEPS_FILE): FORCE | ||
| 11 | |||
| 12 | It runs automatically when the Makefile is called because of: | ||
| 13 | sinclude $(META_DIR)/$(GO_PKGDEPS_FILE) | ||
| 14 | |||
| 15 | So there is a race issue of go2make when parallel build: | ||
| 16 | hack/run-in-gopath.sh: line 34: build/tmp-glibc/work/corei7-64-wrs-linux/kubernetes/1.18.8-r0/git/src/import/_output/local/go/bin/go2make: No such file or directory | ||
| 17 | |||
| 18 | It is because the first process is using go2make, but then the second process | ||
| 19 | removes it and reinstall it. | ||
| 20 | |||
| 21 | Check whether go2make has been installed or not before install it can fix the | ||
| 22 | problem. | ||
| 23 | |||
| 24 | Upstream-Status: Pending | ||
| 25 | |||
| 26 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | ||
| 27 | --- | ||
| 28 | src/import/build/root/Makefile.generated_files | 4 +++- | ||
| 29 | 1 file changed, 3 insertions(+), 1 deletion(-) | ||
| 30 | |||
| 31 | diff --git a/src/import/build/root/Makefile.generated_files b/src/import/build/root/Makefile.generated_files | ||
| 32 | index c8cbf27..e3f1593 100644 | ||
| 33 | --- a/src/import/build/root/Makefile.generated_files | ||
| 34 | +++ b/src/import/build/root/Makefile.generated_files | ||
| 35 | @@ -63,7 +63,9 @@ $(META_DIR)/$(GO_PKGDEPS_FILE): FORCE | ||
| 36 | if [[ "$(DBG_CODEGEN)" == 1 ]]; then \ | ||
| 37 | echo "DBG: calculating Go dependencies"; \ | ||
| 38 | fi | ||
| 39 | - hack/run-in-gopath.sh go install ./hack/make-rules/helpers/go2make | ||
| 40 | + if [ ! -e _output/local/go/bin/go2make ]; then \ | ||
| 41 | + hack/run-in-gopath.sh go install ./hack/make-rules/helpers/go2make; \ | ||
| 42 | + fi | ||
| 43 | hack/run-in-gopath.sh go2make \ | ||
| 44 | k8s.io/kubernetes/... \ | ||
| 45 | --prune k8s.io/kubernetes/staging \ | ||
| 46 | -- | ||
| 47 | 2.26.2 | ||
| 48 | |||
diff --git a/recipes-containers/kubernetes/kubernetes_git.bb b/recipes-containers/kubernetes/kubernetes_git.bb index 76c82026..1053d979 100644 --- a/recipes-containers/kubernetes/kubernetes_git.bb +++ b/recipes-containers/kubernetes/kubernetes_git.bb | |||
| @@ -15,6 +15,7 @@ SRC_URI = "git://github.com/kubernetes/kubernetes.git;branch=release-1.19;name=k | |||
| 15 | file://0001-cross-don-t-build-tests-by-default.patch \ | 15 | file://0001-cross-don-t-build-tests-by-default.patch \ |
| 16 | file://0001-generate-bindata-unset-GOBIN.patch \ | 16 | file://0001-generate-bindata-unset-GOBIN.patch \ |
| 17 | file://0001-build-golang.sh-convert-remaining-go-calls-to-use.patch \ | 17 | file://0001-build-golang.sh-convert-remaining-go-calls-to-use.patch \ |
| 18 | file://0001-Makefile.generated_files-Fix-race-issue-for-installi.patch \ | ||
| 18 | " | 19 | " |
| 19 | 20 | ||
| 20 | DEPENDS += "rsync-native \ | 21 | DEPENDS += "rsync-native \ |
