Skip to contentSkip to conversation

java-library.bbclass: resolve do_deletebinaries race condition

PATCH In review Douglas Royds 3 participants 4 messages Mar 5

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 java-library.bbclass: resolve do_deletebinaries race condition

From: Stanley Stanton <[email protected]>

The do_deletebinaries task is attempting to delete directories created and destroyed by other bitbake classes such as sstate.bbclass and create-spdx-2.2.bbclass. If these classes remove their directories before do_deletebinaries has a chance to delete them, but after they are found, the following types of errors occur:

Log data follows:

| DEBUG: Executing shell function do_deletebinaries
| find: ‘/build/tmp/work/x86_64-linux/junit-native/3.8.2/sstate-build-create_spdx’: No such file or directory
| WARNING: exit code 1 from a shell command.

Rewrite do_deletebinaries such that it is explicitly not looking through directories that are managed by other bitbake classes, to avoid this race condition.

---
 classes/java-library.bbclass | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
classes/java-library.bbclass +3 -4
index 67541d2..033d6d4 100644
@@ -55,10 +55,9 @@ ALTJARFILENAMES = "${BPN}.jar"
 # Java "source" distributions often contain precompiled things
 # we want to delete first.
 do_deletebinaries() {
-  find ${WORKDIR} ! -path "${RECIPE_SYSROOT}/*" ! -path "${RECIPE_SYSROOT_NATIVE}/*" \
-                  -name "*.jar" -exec rm {} \;
-  find ${WORKDIR} ! -path "${RECIPE_SYSROOT}/*" ! -path "${RECIPE_SYSROOT_NATIVE}/*" \
-                  -name "*.class" -exec rm {} \;
+  dirs_to_search="$(find ${WORKDIR}/* -maxdepth 0 -type d | grep -Ev "recipe-sysroot|sstate|spdx")"
+  find $dirs_to_search -name "*.jar" -exec rm {} \;
+  find $dirs_to_search -name "*.class" -exec rm {} \;
 }
 
 addtask deletebinaries after do_unpack before do_patch
Signature · 1 line
2.43.0
#1 lore raw

PATCH 1/1 cacao: Update for gcc13

Modern g++ versions require operator== and operator!= for the DumpMemoryAllocator.

Moved over to github, where this commit has been accepted upstream.

---
 recipes-core/cacao/cacao_git.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
recipes-core/cacao/cacao_git.bb +2 -2
index fef7f34..12b8db3 100644
@@ -10,8 +10,8 @@ PROVIDES:class-native = "virtual/java-native"
 DEPENDS = "zlib libtool classpath virtual/javac-native bdwgc"
 RPROVIDES:${PN} = "java2-runtime"
 
-SRCREV = "6c4694f9bd175386a8c451531e9a5ad97aa23b6f"
-SRC_URI = "git://bitbucket.org/cacaovm/cacao.git;protocol=https;branch=master \
+SRCREV = "b29fd96d2fd1dd8afc897febdb5261371f2c9348"
+SRC_URI = "git://github.com/tekknolagi/cacao.git;protocol=https;branch=master \
            file://0001-java.in-Do-not-use-hardcode-paths.patch \
            file://0002-cacao-use-system-s-boehm-garbage-collector.patch \
 "
Signature · 1 line
2.43.0
#2 lore raw
In reply to Douglas Royds

- patches for meta-java should go to yocto-patches ML ([email protected]), though now I see that this info isn't updated in all places
- AFAIK meta-java is still in deep sleep due to bitrot, and accepts no patches due to this, until someone makes the layer build at least

in any case, cc'd Tim, the last maintainer that I know of.

Quoted 50 lines · Douglas Royds via lists.openembedded.org

From: Stanley Stanton <[email protected]>

The do_deletebinaries task is attempting to delete directories created and destroyed by other bitbake classes such as sstate.bbclass and create-spdx-2.2.bbclass. If these classes remove their directories before do_deletebinaries has a chance to delete them, but after they are found, the following types of errors occur:

Log data follows:

| DEBUG: Executing shell function do_deletebinaries
| find: ‘/build/tmp/work/x86_64-linux/junit-native/3.8.2/sstate-build-create_spdx’: No such file or directory
| WARNING: exit code 1 from a shell command.

Rewrite do_deletebinaries such that it is explicitly not looking through directories that are managed by other bitbake classes, to avoid this race condition.

---
 classes/java-library.bbclass | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
classes/java-library.bbclass +3 -5
index 67541d2..033d6d4 100644
@@ -55,10 +55,9 @@ ALTJARFILENAMES = "${BPN}.jar"
 # Java "source" distributions often contain precompiled things
 # we want to delete first.
 do_deletebinaries() {
-  find ${WORKDIR} ! -path "${RECIPE_SYSROOT}/*" ! -path "${RECIPE_SYSROOT_NATIVE}/*" \
-                  -name "*.jar" -exec rm {} \;
-  find ${WORKDIR} ! -path "${RECIPE_SYSROOT}/*" ! -path "${RECIPE_SYSROOT_NATIVE}/*" \
-                  -name "*.class" -exec rm {} \;
+  dirs_to_search="$(find ${WORKDIR}/* -maxdepth 0 -type d | grep -Ev "recipe-sysroot|sstate|spdx")"
+  find $dirs_to_search -name "*.jar" -exec rm {} \;
+  find $dirs_to_search -name "*.class" -exec rm {} \;
 }
 
 addtask deletebinaries after do_unpack before do_patch
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#124864): https://lists.openembedded.org/g/openembedded-devel/message/124864
Mute This Topic: https://lists.openembedded.org/mt/118149274/6084445
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#3 lore raw
Quoted 7 lines · Gyorgy Sarvari

- patches for meta-java should go to yocto-patches ML ([email protected]), though now I see that this info isn't updated in all places
- AFAIK meta-java is still in deep sleep due to bitrot, and accepts no patches due to this, until someone makes the layer build at least

The state of things has not changed:

https://www.linkedin.com/pulse/state-meta-java-tim-orling-tcrqc/
https://lists.yoctoproject.org/g/yocto-patches/message/986

My guess is anybody actually using the layer is on the 'kirkstone' release, as meta-java has been increasingly more and more broken since then.

in any case, cc'd Tim, the last maintainer that I know of.

Quoted 61 lines · Douglas Royds via lists.openembedded.org
Quoted 11 lines

From: Stanley Stanton <[email protected]>

The do_deletebinaries task is attempting to delete directories created and destroyed by other bitbake classes such as sstate.bbclass and create-spdx-2.2.bbclass. If these classes remove their directories before do_deletebinaries has a chance to delete them, but after they are found, the following types of errors occur:

Log data follows:
| DEBUG: Executing shell function do_deletebinaries | find:

‘/build/tmp/work/x86_64-linux/junit-native/3.8.2/sstate-build-create_spdx’:
No such file or directory

Quoted 17 lines

| WARNING: exit code 1 from a shell command.

Rewrite do_deletebinaries such that it is explicitly not looking through directories that are managed by other bitbake classes, to avoid this race condition.

---
 classes/java-library.bbclass | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
classes/java-library.bbclass +0 -0
index 67541d2..033d6d4 100644

classes/java-library.bbclass ALTJARFILENAMES = "${BPN}.jar" · line 58

Quoted 4 lines
classes/java-library.bbclass +0 -1
@@ -55,10 +55,9 @@ ALTJARFILENAMES = "${BPN}.jar"
 # Java "source" distributions often contain precompiled things
 # we want to delete first.
 do_deletebinaries() {
-  find ${WORKDIR} ! -path "${RECIPE_SYSROOT}/*" ! -path

"${RECIPE_SYSROOT_NATIVE}/*" \

classes/java-library.bbclass ALTJARFILENAMES = "${BPN}.jar" · line 60

Quoted 2 lines
classes/java-library.bbclass +0 -2
-                  -name "*.jar" -exec rm {} \;
-  find ${WORKDIR} ! -path "${RECIPE_SYSROOT}/*" ! -path

"${RECIPE_SYSROOT_NATIVE}/*" \

classes/java-library.bbclass ALTJARFILENAMES = "${BPN}.jar" · line 58

Quoted 2 lines
classes/java-library.bbclass +1 -1
-                  -name "*.class" -exec rm {} \;
+  dirs_to_search="$(find ${WORKDIR}/* -maxdepth 0 -type d | grep -Ev

"recipe-sysroot|sstate|spdx")"

Quoted 9 lines
classes/java-library.bbclass +2 -1
+  find $dirs_to_search -name "*.jar" -exec rm {} \;
+  find $dirs_to_search -name "*.class" -exec rm {} \;
 }
 
 addtask deletebinaries after do_unpack before do_patch
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group. View/Reply Online (#124864):

https://lists.openembedded.org/g/openembedded-devel/message/124864

Quoted 3 lines

Mute This Topic: https://lists.openembedded.org/mt/118149274/6084445
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [

[email protected]]

Quoted 2 lines

-=-=-=-=-=-=-=-=-=-=-=-