Skip to contentSkip to conversation

Get rid of do_shared_workdir task

PATCH In review Ed Bartosh 3 participants 5 messages Mar 11, 2015 – Mar 12, 2015

lore
Share & tools
lore

Ed Bartosh

author
#0 lore raw

PATCH 1/1 Get rid of do_shared_workdir task

Merged do_shared_workdir into kernel_do_compile

This change should fix race condition between do_compilemodules and do_shared_workdir. Race occurs when do_compilemodules changes include/generated/ directory content while do_shared_workdir tries to copy it.

Fixes [YOCTO #7321]

---
 meta/classes/kernel-yocto.bbclass                | 2 +-
 meta/classes/kernel.bbclass                      | 5 ++---
 meta/classes/module-base.bbclass                 | 2 +-
 meta/recipes-kernel/linux/kernel-devsrc.bb       | 2 +-
 meta/recipes-kernel/linux/linux-dummy.bb         | 5 -----
 meta/recipes-kernel/lttng/lttng-modules_2.6.0.bb | 2 +-
 meta/recipes-kernel/perf/perf.bb                 | 2 +-
 7 files changed, 7 insertions(+), 13 deletions(-)
meta/classes/kernel-yocto.bbclass +1 -1
index 8db4899..27a027d 100644
@@ -1,5 +1,5 @@
 # remove tasks that modify the source tree in case externalsrc is inherited
-SRCTREECOVEREDTASKS += "do_kernel_link_vmlinux do_kernel_configme do_validate_branches do_kernel_configcheck do_kernel_checkout do_shared_workdir do_fetch do_unpack do_patch"
+SRCTREECOVEREDTASKS += "do_kernel_link_vmlinux do_kernel_configme do_validate_branches do_kernel_configcheck do_kernel_checkout do_fetch do_unpack do_patch"
 
 # returns local (absolute) path names for all valid patches in the
 # src_uri
meta/classes/kernel.bbclass +2 -3
index 125ed88..7914242 100644
@@ -192,6 +192,7 @@ kernel_do_compile() {
 	if test "${KERNEL_IMAGETYPE_FOR_MAKE}.gz" = "${KERNEL_IMAGETYPE}"; then
 		gzip -9c < "${KERNEL_IMAGETYPE_FOR_MAKE}" > "${KERNEL_OUTPUT}"
 	fi
+	shared_workdir
 }
 
 do_compile_kernelmodules() {
@@ -234,8 +235,6 @@ kernel_do_install() {
 }
 do_install[prefuncs] += "package_get_auto_pr"
 
-addtask shared_workdir after do_compile before do_install
-
 emit_depmod_pkgdata() {
 	# Stash data for depmod
 	install -d ${PKGDESTWORK}/kernel-depmod/
@@ -245,7 +244,7 @@ emit_depmod_pkgdata() {
 
 PACKAGEFUNCS += "emit_depmod_pkgdata"
 
-do_shared_workdir () {
+shared_workdir () {
 	cd ${B}
 
 	kerneldir=${STAGING_KERNEL_BUILDDIR}
meta/classes/module-base.bbclass +1 -1
index 3eb2e92..31ab95f 100644
@@ -15,7 +15,7 @@ KERNEL_OBJECT_SUFFIX = ".ko"
 # kernel modules are generally machine specific
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 
-do_configure[depends] += "virtual/kernel:do_shared_workdir"
+do_configure[depends] += "virtual/kernel:kernel_do_compile"
 
 # Function to ensure the kernel scripts are created. Expected to
 # be called before do_compile. See module.bbclass for an exmaple.
meta/recipes-kernel/linux/kernel-devsrc.bb +1 -1
index e36de1b..f2a1d7c 100644
@@ -16,7 +16,7 @@ inherit module-base
 # We need the kernel to be staged (unpacked, patched and configured) before
 # we can grab the source and make the source package. We also need the bits from
 # ${B} not to change while we install, so virtual/kernel must finish do_compile.
-do_install[depends] += "virtual/kernel:do_shared_workdir"
+do_install[depends] += "virtual/kernel:kernel_do_compile"
 # Need the source, not just the output of populate_sysroot
 do_install[depends] += "virtual/kernel:do_compile"
 
meta/recipes-kernel/linux/linux-dummy.bb +0 -5
index cc0e4e6..8f4ddc4 100644
@@ -33,10 +33,6 @@ do_compile () {
 	:
 }
 
-do_shared_workdir () {
-	:
-}
-
 do_install() {
 	:
 }
@@ -51,4 +47,3 @@ do_deploy() {
 
 addtask bundle_initramfs after do_install before do_deploy
 addtask deploy after do_install
-addtask shared_workdir after do_compile before do_install
meta/recipes-kernel/lttng/lttng-modules_2.6.0.bb +1 -1
index d0039b3..9d07ae4 100644
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=1412caf5a1aa90d6a48588a4794c0eac \
                     file://lgpl-2.1.txt;md5=243b725d71bb5df4a1e5920b344b86ad"
 
 DEPENDS = "virtual/kernel"
-do_configure[depends] += "virtual/kernel:do_shared_workdir"
+do_configure[depends] += "virtual/kernel:kernel_do_compile"
 
 inherit module
 
meta/recipes-kernel/perf/perf.bb +1 -1
index f69d177..59d6be2 100644
@@ -32,7 +32,7 @@ DEPENDS = " \
     bison flex \
 "
 
-do_configure[depends] += "virtual/kernel:do_shared_workdir"
+do_configure[depends] += "virtual/kernel:kernel_do_compile"
 
 PROVIDES = "virtual/perf"
 
Signature · 1 line
2.1.4
#1 lore raw

Ed,

This should go to the [email protected], also please review the Patch and Commit guidelines:

http://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines

Sau!

Quoted 134 lines · Ed Bartosh

Merged do_shared_workdir into kernel_do_compile

This change should fix race condition between do_compilemodules and do_shared_workdir. Race occurs when do_compilemodules changes include/generated/ directory content while do_shared_workdir tries to copy it.

Fixes [YOCTO #7321]

---
  meta/classes/kernel-yocto.bbclass                | 2 +-
  meta/classes/kernel.bbclass                      | 5 ++---
  meta/classes/module-base.bbclass                 | 2 +-
  meta/recipes-kernel/linux/kernel-devsrc.bb       | 2 +-
  meta/recipes-kernel/linux/linux-dummy.bb         | 5 -----
  meta/recipes-kernel/lttng/lttng-modules_2.6.0.bb | 2 +-
  meta/recipes-kernel/perf/perf.bb                 | 2 +-
  7 files changed, 7 insertions(+), 13 deletions(-)
meta/classes/kernel-yocto.bbclass +1 -1
index 8db4899..27a027d 100644
@@ -1,5 +1,5 @@
  # remove tasks that modify the source tree in case externalsrc is inherited
-SRCTREECOVEREDTASKS += "do_kernel_link_vmlinux do_kernel_configme do_validate_branches do_kernel_configcheck do_kernel_checkout do_shared_workdir do_fetch do_unpack do_patch"
+SRCTREECOVEREDTASKS += "do_kernel_link_vmlinux do_kernel_configme do_validate_branches do_kernel_configcheck do_kernel_checkout do_fetch do_unpack do_patch"
 
  # returns local (absolute) path names for all valid patches in the
  # src_uri
meta/classes/kernel.bbclass +2 -3
index 125ed88..7914242 100644
@@ -192,6 +192,7 @@ kernel_do_compile() {
  	if test "${KERNEL_IMAGETYPE_FOR_MAKE}.gz" = "${KERNEL_IMAGETYPE}"; then
  		gzip -9c < "${KERNEL_IMAGETYPE_FOR_MAKE}" > "${KERNEL_OUTPUT}"
  	fi
+	shared_workdir
  }
 
  do_compile_kernelmodules() {
@@ -234,8 +235,6 @@ kernel_do_install() {
  }
  do_install[prefuncs] += "package_get_auto_pr"
 
-addtask shared_workdir after do_compile before do_install
-
  emit_depmod_pkgdata() {
  	# Stash data for depmod
  	install -d ${PKGDESTWORK}/kernel-depmod/
@@ -245,7 +244,7 @@ emit_depmod_pkgdata() {
 
  PACKAGEFUNCS += "emit_depmod_pkgdata"
 
-do_shared_workdir () {
+shared_workdir () {
  	cd ${B}
 
  	kerneldir=${STAGING_KERNEL_BUILDDIR}
meta/classes/module-base.bbclass +1 -1
index 3eb2e92..31ab95f 100644
@@ -15,7 +15,7 @@ KERNEL_OBJECT_SUFFIX = ".ko"
  # kernel modules are generally machine specific
  PACKAGE_ARCH = "${MACHINE_ARCH}"
 
-do_configure[depends] += "virtual/kernel:do_shared_workdir"
+do_configure[depends] += "virtual/kernel:kernel_do_compile"
 
  # Function to ensure the kernel scripts are created. Expected to
  # be called before do_compile. See module.bbclass for an exmaple.
meta/recipes-kernel/linux/kernel-devsrc.bb +1 -1
index e36de1b..f2a1d7c 100644
@@ -16,7 +16,7 @@ inherit module-base
  # We need the kernel to be staged (unpacked, patched and configured) before
  # we can grab the source and make the source package. We also need the bits from
  # ${B} not to change while we install, so virtual/kernel must finish do_compile.
-do_install[depends] += "virtual/kernel:do_shared_workdir"
+do_install[depends] += "virtual/kernel:kernel_do_compile"
  # Need the source, not just the output of populate_sysroot
  do_install[depends] += "virtual/kernel:do_compile"
 
meta/recipes-kernel/linux/linux-dummy.bb +0 -5
index cc0e4e6..8f4ddc4 100644
@@ -33,10 +33,6 @@ do_compile () {
  	:
  }
 
-do_shared_workdir () {
-	:
-}
-
  do_install() {
  	:
  }
@@ -51,4 +47,3 @@ do_deploy() {
 
  addtask bundle_initramfs after do_install before do_deploy
  addtask deploy after do_install
-addtask shared_workdir after do_compile before do_install
meta/recipes-kernel/lttng/lttng-modules_2.6.0.bb +1 -1
index d0039b3..9d07ae4 100644
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=1412caf5a1aa90d6a48588a4794c0eac \
                      file://lgpl-2.1.txt;md5=243b725d71bb5df4a1e5920b344b86ad"
 
  DEPENDS = "virtual/kernel"
-do_configure[depends] += "virtual/kernel:do_shared_workdir"
+do_configure[depends] += "virtual/kernel:kernel_do_compile"
 
  inherit module
 
meta/recipes-kernel/perf/perf.bb +1 -1
index f69d177..59d6be2 100644
@@ -32,7 +32,7 @@ DEPENDS = " \
      bison flex \
  "
 
-do_configure[depends] += "virtual/kernel:do_shared_workdir"
+do_configure[depends] += "virtual/kernel:kernel_do_compile"
 
  PROVIDES = "virtual/perf"
 
#2 lore raw
In reply to Ed Bartosh
Quoted 8 lines · Ed Bartosh

Merged do_shared_workdir into kernel_do_compile

This change should fix race condition between do_compilemodules and do_shared_workdir. Race occurs when do_compilemodules changes include/generated/ directory content while do_shared_workdir tries to copy it.

Fixes [YOCTO #7321]

Why would you be working on a bug, that is currently assigned to me .. without even mentioning it ?

I have several patches in flight for this, but didn't want to bring them into play
yet, since the risks of juggling this again .. are far greater than the shared directory issues IMHO.

I actually have some uses of the shared workdir, that were nice to enable without having to go through the whole compile again .. that is no longer possible, and again, a reason to stop juggling this around.

Brue

Quoted 133 lines
---
 meta/classes/kernel-yocto.bbclass                | 2 +-
 meta/classes/kernel.bbclass                      | 5 ++---
 meta/classes/module-base.bbclass                 | 2 +-
 meta/recipes-kernel/linux/kernel-devsrc.bb       | 2 +-
 meta/recipes-kernel/linux/linux-dummy.bb         | 5 -----
 meta/recipes-kernel/lttng/lttng-modules_2.6.0.bb | 2 +-
 meta/recipes-kernel/perf/perf.bb                 | 2 +-
 7 files changed, 7 insertions(+), 13 deletions(-)
meta/classes/kernel-yocto.bbclass +1 -1
index 8db4899..27a027d 100644
@@ -1,5 +1,5 @@
 # remove tasks that modify the source tree in case externalsrc is inherited
-SRCTREECOVEREDTASKS += "do_kernel_link_vmlinux do_kernel_configme do_validate_branches do_kernel_configcheck do_kernel_checkout do_shared_workdir do_fetch do_unpack do_patch"
+SRCTREECOVEREDTASKS += "do_kernel_link_vmlinux do_kernel_configme do_validate_branches do_kernel_configcheck do_kernel_checkout do_fetch do_unpack do_patch"
 
 # returns local (absolute) path names for all valid patches in the
 # src_uri
meta/classes/kernel.bbclass +2 -3
index 125ed88..7914242 100644
@@ -192,6 +192,7 @@ kernel_do_compile() {
        if test "${KERNEL_IMAGETYPE_FOR_MAKE}.gz" = "${KERNEL_IMAGETYPE}"; then
                gzip -9c < "${KERNEL_IMAGETYPE_FOR_MAKE}" > "${KERNEL_OUTPUT}"
        fi
+       shared_workdir
 }
 
 do_compile_kernelmodules() {
@@ -234,8 +235,6 @@ kernel_do_install() {
 }
 do_install[prefuncs] += "package_get_auto_pr"
 
-addtask shared_workdir after do_compile before do_install
-
 emit_depmod_pkgdata() {
        # Stash data for depmod
        install -d ${PKGDESTWORK}/kernel-depmod/
@@ -245,7 +244,7 @@ emit_depmod_pkgdata() {
 
 PACKAGEFUNCS += "emit_depmod_pkgdata"
 
-do_shared_workdir () {
+shared_workdir () {
        cd ${B}
 
        kerneldir=${STAGING_KERNEL_BUILDDIR}
meta/classes/module-base.bbclass +1 -1
index 3eb2e92..31ab95f 100644
@@ -15,7 +15,7 @@ KERNEL_OBJECT_SUFFIX = ".ko"
 # kernel modules are generally machine specific
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 
-do_configure[depends] += "virtual/kernel:do_shared_workdir"
+do_configure[depends] += "virtual/kernel:kernel_do_compile"
 
 # Function to ensure the kernel scripts are created. Expected to
 # be called before do_compile. See module.bbclass for an exmaple.
meta/recipes-kernel/linux/kernel-devsrc.bb +1 -1
index e36de1b..f2a1d7c 100644
@@ -16,7 +16,7 @@ inherit module-base
 # We need the kernel to be staged (unpacked, patched and configured) before
 # we can grab the source and make the source package. We also need the bits from
 # ${B} not to change while we install, so virtual/kernel must finish do_compile.
-do_install[depends] += "virtual/kernel:do_shared_workdir"
+do_install[depends] += "virtual/kernel:kernel_do_compile"
 # Need the source, not just the output of populate_sysroot
 do_install[depends] += "virtual/kernel:do_compile"
 
meta/recipes-kernel/linux/linux-dummy.bb +0 -5
index cc0e4e6..8f4ddc4 100644
@@ -33,10 +33,6 @@ do_compile () {
        :
 }
 
-do_shared_workdir () {
-       :
-}
-
 do_install() {
        :
 }
@@ -51,4 +47,3 @@ do_deploy() {
 
 addtask bundle_initramfs after do_install before do_deploy
 addtask deploy after do_install
-addtask shared_workdir after do_compile before do_install
meta/recipes-kernel/lttng/lttng-modules_2.6.0.bb +1 -1
index d0039b3..9d07ae4 100644
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=1412caf5a1aa90d6a48588a4794c0eac \
                     file://lgpl-2.1.txt;md5=243b725d71bb5df4a1e5920b344b86ad"
 
 DEPENDS = "virtual/kernel"
-do_configure[depends] += "virtual/kernel:do_shared_workdir"
+do_configure[depends] += "virtual/kernel:kernel_do_compile"
 
 inherit module
 
meta/recipes-kernel/perf/perf.bb +1 -2
index f69d177..59d6be2 100644
@@ -32,7 +32,7 @@ DEPENDS = " \
     bison flex \
 "
 
-do_configure[depends] += "virtual/kernel:do_shared_workdir"
+do_configure[depends] += "virtual/kernel:kernel_do_compile"
 
 PROVIDES = "virtual/perf"
 
--

2.1.4

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end"
#3 lore raw
Quoted 8 lines · Bruce Ashfield
Quoted 7 lines · Ed Bartosh

Merged do_shared_workdir into kernel_do_compile

This change should fix race condition between do_compilemodules and do_shared_workdir. Race occurs when do_compilemodules changes include/generated/ directory content while do_shared_workdir tries to copy it.

Quoted 4 lines
Quoted 1 line

Fixes [YOCTO #7321]

Why would you be working on a bug, that is currently assigned to me .. without even mentioning it ?

Aha! I see the bug was updated right before the patch was sent. So assuming that you only started working on it right before that update and send .. we aren't too badly off.

I still could have provided my status and feedback before hand though :)

Bruce

Quoted 151 lines

I have several patches in flight for this, but didn't want to bring them into play
yet, since the risks of juggling this again .. are far greater than the shared directory issues IMHO.

I actually have some uses of the shared workdir, that were nice to enable without having to go through the whole compile again .. that is no longer possible, and again, a reason to stop juggling this around.

Brue

Quoted 128 lines
---
 meta/classes/kernel-yocto.bbclass                | 2 +-
 meta/classes/kernel.bbclass                      | 5 ++---
 meta/classes/module-base.bbclass                 | 2 +-
 meta/recipes-kernel/linux/kernel-devsrc.bb       | 2 +-
 meta/recipes-kernel/linux/linux-dummy.bb         | 5 -----
 meta/recipes-kernel/lttng/lttng-modules_2.6.0.bb | 2 +-
 meta/recipes-kernel/perf/perf.bb                 | 2 +-
 7 files changed, 7 insertions(+), 13 deletions(-)
meta/classes/kernel-yocto.bbclass +1 -1
index 8db4899..27a027d 100644
@@ -1,5 +1,5 @@
 # remove tasks that modify the source tree in case externalsrc is inherited
-SRCTREECOVEREDTASKS += "do_kernel_link_vmlinux do_kernel_configme do_validate_branches do_kernel_configcheck do_kernel_checkout do_shared_workdir do_fetch do_unpack do_patch"
+SRCTREECOVEREDTASKS += "do_kernel_link_vmlinux do_kernel_configme do_validate_branches do_kernel_configcheck do_kernel_checkout do_fetch do_unpack do_patch"
 
 # returns local (absolute) path names for all valid patches in the
 # src_uri
meta/classes/kernel.bbclass +2 -3
index 125ed88..7914242 100644
@@ -192,6 +192,7 @@ kernel_do_compile() {
        if test "${KERNEL_IMAGETYPE_FOR_MAKE}.gz" = "${KERNEL_IMAGETYPE}"; then
                gzip -9c < "${KERNEL_IMAGETYPE_FOR_MAKE}" > "${KERNEL_OUTPUT}"
        fi
+       shared_workdir
 }
 
 do_compile_kernelmodules() {
@@ -234,8 +235,6 @@ kernel_do_install() {
 }
 do_install[prefuncs] += "package_get_auto_pr"
 
-addtask shared_workdir after do_compile before do_install
-
 emit_depmod_pkgdata() {
        # Stash data for depmod
        install -d ${PKGDESTWORK}/kernel-depmod/
@@ -245,7 +244,7 @@ emit_depmod_pkgdata() {
 
 PACKAGEFUNCS += "emit_depmod_pkgdata"
 
-do_shared_workdir () {
+shared_workdir () {
        cd ${B}
 
        kerneldir=${STAGING_KERNEL_BUILDDIR}
meta/classes/module-base.bbclass +1 -1
index 3eb2e92..31ab95f 100644
@@ -15,7 +15,7 @@ KERNEL_OBJECT_SUFFIX = ".ko"
 # kernel modules are generally machine specific
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 
-do_configure[depends] += "virtual/kernel:do_shared_workdir"
+do_configure[depends] += "virtual/kernel:kernel_do_compile"
 
 # Function to ensure the kernel scripts are created. Expected to
 # be called before do_compile. See module.bbclass for an exmaple.
meta/recipes-kernel/linux/kernel-devsrc.bb +1 -1
index e36de1b..f2a1d7c 100644
@@ -16,7 +16,7 @@ inherit module-base
 # We need the kernel to be staged (unpacked, patched and configured) before
 # we can grab the source and make the source package. We also need the bits from
 # ${B} not to change while we install, so virtual/kernel must finish do_compile.
-do_install[depends] += "virtual/kernel:do_shared_workdir"
+do_install[depends] += "virtual/kernel:kernel_do_compile"
 # Need the source, not just the output of populate_sysroot
 do_install[depends] += "virtual/kernel:do_compile"
 
meta/recipes-kernel/linux/linux-dummy.bb +0 -5
index cc0e4e6..8f4ddc4 100644
@@ -33,10 +33,6 @@ do_compile () {
        :
 }
 
-do_shared_workdir () {
-       :
-}
-
 do_install() {
        :
 }
@@ -51,4 +47,3 @@ do_deploy() {
 
 addtask bundle_initramfs after do_install before do_deploy
 addtask deploy after do_install
-addtask shared_workdir after do_compile before do_install
meta/recipes-kernel/lttng/lttng-modules_2.6.0.bb +1 -1
index d0039b3..9d07ae4 100644
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=1412caf5a1aa90d6a48588a4794c0eac \
                     file://lgpl-2.1.txt;md5=243b725d71bb5df4a1e5920b344b86ad"
 
 DEPENDS = "virtual/kernel"
-do_configure[depends] += "virtual/kernel:do_shared_workdir"
+do_configure[depends] += "virtual/kernel:kernel_do_compile"
 
 inherit module
 
meta/recipes-kernel/perf/perf.bb +1 -2
index f69d177..59d6be2 100644
@@ -32,7 +32,7 @@ DEPENDS = " \
     bison flex \
 "
 
-do_configure[depends] += "virtual/kernel:do_shared_workdir"
+do_configure[depends] += "virtual/kernel:kernel_do_compile"
 
 PROVIDES = "virtual/perf"
 
--

2.1.4

Quoted 5 lines

--
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

--
"Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end"

Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end"
#4 lore raw
Quoted 7 lines
Quoted 4 lines · Bruce Ashfield

Why would you be working on a bug, that is currently assigned to me .. without
even mentioning it ?

Quoted 8 lines

Aha! I see the bug was updated right before the patch was sent. So assuming
that you only started working on it right before that update and send .. we
aren't too badly off.

I still could have provided my status and feedback before hand though :)

OK, next time I will. I just started to work on this issue and decided to send patch just to start conversation. Sorry for the mess.

Let's continue discussing this in the bug.

Ed