diff mbox series

Avoid running whilst in a deleted directory.

Message ID 20251103022936.10673-1-gordon.lack@dsl.pipex.com
State New
Headers show
Series Avoid running whilst in a deleted directory. | expand

Commit Message

Gordon Lack Nov. 3, 2025, 2:29 a.m. UTC
This caused a problem when building on Kubuntu 25.10.

Whilst the real problem is the cp in Rust coreutils, it makes sense not
to be in the directory you are about to delete.

This is a resubmission to use "cd ${WORKDIR}" rather than "cd /".
---
 meta/recipes-devtools/perl/perl_5.40.2.bb | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/meta/recipes-devtools/perl/perl_5.40.2.bb b/meta/recipes-devtools/perl/perl_5.40.2.bb
index a78d2ed0be..19de35fdc7 100644
--- a/meta/recipes-devtools/perl/perl_5.40.2.bb
+++ b/meta/recipes-devtools/perl/perl_5.40.2.bb
@@ -57,7 +57,13 @@  CFLAGS:append:toolchain-clang = " -fno-strict-aliasing"
 # Needed with -march=x86-64-v3
 CFLAGS:append:toolchain-gcc:class-target:x86-64 = " -fno-builtin-memcpy -D__NO_STRING_INLINES -U_FORTIFY_SOURCE"
 
+# ${B} will have been set as our current directory immediately before
+# do_configure is called. So let's avoid any problems associated
+# with it being deleted from underneath us by moving to somewhere else.
+# We're being put back there (the new version) at the end of this code
+#
 do_configure:prepend() {
+    cd ${WORKDIR}
     rm -rf ${B}
     cp -rfp ${S} ${B}
     cp -rfp ${STAGING_DATADIR_NATIVE}/perl-cross/* ${B}