* [meta-virtualization][PATCH] kubernetes: Fix race issue for installing go2make
@ 2020-10-15 9:01 Robert Yang
2020-10-15 14:58 ` Bruce Ashfield
0 siblings, 1 reply; 2+ messages in thread
From: Robert Yang @ 2020-10-15 9:01 UTC (permalink / raw)
To: meta-virtualization, bruce.ashfield
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>
---
...ed_files-Fix-race-issue-for-installi.patch | 48 +++++++++++++++++++
.../kubernetes/kubernetes_git.bb | 1 +
2 files changed, 49 insertions(+)
create mode 100644 recipes-containers/kubernetes/kubernetes/0001-Makefile.generated_files-Fix-race-issue-for-installi.patch
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 0000000..97273e4
--- /dev/null
+++ b/recipes-containers/kubernetes/kubernetes/0001-Makefile.generated_files-Fix-race-issue-for-installi.patch
@@ -0,0 +1,48 @@
+From 441df8a24a2c80e320f140b5d9bc352c7ce8a64a Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Thu, 15 Oct 2020 07:27:35 +0000
+Subject: [PATCH] src/import/build/root/Makefile.generated_files: 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 such file or directory
+
+It is because the first process is using go2make, but then the second process
+removes it and reinstall it.
+
+Check whether go2make has been installed or not before install it can fix the
+problem.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ src/import/build/root/Makefile.generated_files | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/src/import/build/root/Makefile.generated_files b/src/import/build/root/Makefile.generated_files
+index c8cbf27..e3f1593 100644
+--- a/src/import/build/root/Makefile.generated_files
++++ b/src/import/build/root/Makefile.generated_files
+@@ -63,7 +63,9 @@ $(META_DIR)/$(GO_PKGDEPS_FILE): FORCE
+ if [[ "$(DBG_CODEGEN)" == 1 ]]; then \
+ echo "DBG: calculating Go dependencies"; \
+ fi
+- hack/run-in-gopath.sh go install ./hack/make-rules/helpers/go2make
++ if [ ! -e _output/local/go/bin/go2make ]; then \
++ hack/run-in-gopath.sh go install ./hack/make-rules/helpers/go2make; \
++ fi
+ hack/run-in-gopath.sh go2make \
+ k8s.io/kubernetes/... \
+ --prune k8s.io/kubernetes/staging \
+--
+2.26.2
+
diff --git a/recipes-containers/kubernetes/kubernetes_git.bb b/recipes-containers/kubernetes/kubernetes_git.bb
index 76c8202..1053d97 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
file://0001-cross-don-t-build-tests-by-default.patch \
file://0001-generate-bindata-unset-GOBIN.patch \
file://0001-build-golang.sh-convert-remaining-go-calls-to-use.patch \
+ file://0001-Makefile.generated_files-Fix-race-issue-for-installi.patch \
"
DEPENDS += "rsync-native \
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [meta-virtualization][PATCH] kubernetes: Fix race issue for installing go2make
2020-10-15 9:01 [meta-virtualization][PATCH] kubernetes: Fix race issue for installing go2make Robert Yang
@ 2020-10-15 14:58 ` Bruce Ashfield
0 siblings, 0 replies; 2+ messages in thread
From: Bruce Ashfield @ 2020-10-15 14:58 UTC (permalink / raw)
To: Robert Yang; +Cc: meta-virtualization
[-- Attachment #1: Type: text/plain, Size: 4598 bytes --]
merged
Bruce
On Thu, Oct 15, 2020 at 5:01 AM Robert Yang <liezhi.yang@windriver.com>
wrote:
> 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>
> ---
> ...ed_files-Fix-race-issue-for-installi.patch | 48 +++++++++++++++++++
> .../kubernetes/kubernetes_git.bb | 1 +
> 2 files changed, 49 insertions(+)
> create mode 100644
> recipes-containers/kubernetes/kubernetes/0001-Makefile.generated_files-Fix-race-issue-for-installi.patch
>
> 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 0000000..97273e4
> --- /dev/null
> +++
> b/recipes-containers/kubernetes/kubernetes/0001-Makefile.generated_files-Fix-race-issue-for-installi.patch
> @@ -0,0 +1,48 @@
> +From 441df8a24a2c80e320f140b5d9bc352c7ce8a64a Mon Sep 17 00:00:00 2001
> +From: Robert Yang <liezhi.yang@windriver.com>
> +Date: Thu, 15 Oct 2020 07:27:35 +0000
> +Subject: [PATCH] src/import/build/root/Makefile.generated_files: 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 such file or directory
> +
> +It is because the first process is using go2make, but then the second
> process
> +removes it and reinstall it.
> +
> +Check whether go2make has been installed or not before install it can fix
> the
> +problem.
> +
> +Upstream-Status: Pending
> +
> +Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
> +---
> + src/import/build/root/Makefile.generated_files | 4 +++-
> + 1 file changed, 3 insertions(+), 1 deletion(-)
> +
> +diff --git a/src/import/build/root/Makefile.generated_files
> b/src/import/build/root/Makefile.generated_files
> +index c8cbf27..e3f1593 100644
> +--- a/src/import/build/root/Makefile.generated_files
> ++++ b/src/import/build/root/Makefile.generated_files
> +@@ -63,7 +63,9 @@ $(META_DIR)/$(GO_PKGDEPS_FILE): FORCE
> + if [[ "$(DBG_CODEGEN)" == 1 ]]; then \
> + echo "DBG: calculating Go dependencies"; \
> + fi
> +- hack/run-in-gopath.sh go install ./hack/make-rules/helpers/go2make
> ++ if [ ! -e _output/local/go/bin/go2make ]; then \
> ++ hack/run-in-gopath.sh go install
> ./hack/make-rules/helpers/go2make; \
> ++ fi
> + hack/run-in-gopath.sh go2make \
> + k8s.io/kubernetes/... \
> + --prune k8s.io/kubernetes/staging \
> +--
> +2.26.2
> +
> diff --git a/recipes-containers/kubernetes/kubernetes_git.bb
> b/recipes-containers/kubernetes/kubernetes_git.bb
> index 76c8202..1053d97 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
> file://0001-cross-don-t-build-tests-by-default.patch \
> file://0001-generate-bindata-unset-GOBIN.patch \
>
> file://0001-build-golang.sh-convert-remaining-go-calls-to-use.patch \
> +
> file://0001-Makefile.generated_files-Fix-race-issue-for-installi.patch \
> "
>
> DEPENDS += "rsync-native \
> --
> 2.17.1
>
>
--
- Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end
- "Use the force Harry" - Gandalf, Star Trek II
[-- Attachment #2: Type: text/html, Size: 6287 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-10-15 14:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-15 9:01 [meta-virtualization][PATCH] kubernetes: Fix race issue for installing go2make Robert Yang
2020-10-15 14:58 ` Bruce Ashfield
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.