[1/8,meta-oe] devtools/php: remove the failing ${D}/${TMPDIR} code

Submitted by Max Kellermann on Sept. 18, 2018, 8:26 a.m. | Patch ID: 154950

Details

Message ID 20180918082608.1088-1-max+openembedded@blarg.de
State Changes Requested
Headers show

Commit Message

Max Kellermann Sept. 18, 2018, 8:26 a.m.
From: Max Kellermann <max.kellermann@gmail.com>

Appending ${TMPDIR} to ${D} doesn't make any sense, because both are
absolute paths.  And additionally, the code fails:

 rmdir: failed to remove '/usr/src/oe/tmp-musl/work/core2-64-oe-linux-musl/php/7.1.9-r0/image//usr': Directory not empty

Signed-off-by: Max Kellermann <max.kellermann@gmail.com>
---
 meta-oe/recipes-devtools/php/php.inc | 9 ---------
 1 file changed, 9 deletions(-)

Patch hide | download patch | download mbox

diff --git a/meta-oe/recipes-devtools/php/php.inc b/meta-oe/recipes-devtools/php/php.inc
index 65dfd2d89..120f678d7 100644
--- a/meta-oe/recipes-devtools/php/php.inc
+++ b/meta-oe/recipes-devtools/php/php.inc
@@ -139,7 +139,6 @@  do_install_append_class-target() {
     if [ -d ${RECIPE_SYSROOT_NATIVE}${sysconfdir} ];then
          install -m 0644 ${RECIPE_SYSROOT_NATIVE}${sysconfdir}/pear.conf ${D}${sysconfdir}/
     fi
-    rm -rf ${D}/${TMPDIR}
     rm -rf ${D}/.registry
     rm -rf ${D}/.channels
     rm -rf ${D}/.[a-z]*
@@ -164,14 +163,6 @@  do_install_append_class-target() {
             ${D}${systemd_unitdir}/system/php-fpm.service
     fi
 
-    TMP=`dirname ${D}/${TMPDIR}`
-    while test ${TMP} != ${D}; do
-        if [ -d ${TMP} ]; then
-            rmdir ${TMP}
-        fi
-        TMP=`dirname ${TMP}`;
-    done
-
     if ${@bb.utils.contains('PACKAGECONFIG', 'apache2', 'true', 'false', d)}; then
         install -d ${D}${libdir}/apache2/modules
         install -d ${D}${sysconfdir}/apache2/modules.d

Comments

Khem Raj Sept. 24, 2018, 6:48 p.m.
http://errors.yoctoproject.org/Errors/Details/193970/
On Tue, Sep 18, 2018 at 1:36 AM Max Kellermann
<max+openembedded@blarg.de> wrote:
>
> From: Max Kellermann <max.kellermann@gmail.com>
>
> Appending ${TMPDIR} to ${D} doesn't make any sense, because both are
> absolute paths.  And additionally, the code fails:
>
>  rmdir: failed to remove '/usr/src/oe/tmp-musl/work/core2-64-oe-linux-musl/php/7.1.9-r0/image//usr': Directory not empty
>
> Signed-off-by: Max Kellermann <max.kellermann@gmail.com>
> ---
>  meta-oe/recipes-devtools/php/php.inc | 9 ---------
>  1 file changed, 9 deletions(-)
>
> diff --git a/meta-oe/recipes-devtools/php/php.inc b/meta-oe/recipes-devtools/php/php.inc
> index 65dfd2d89..120f678d7 100644
> --- a/meta-oe/recipes-devtools/php/php.inc
> +++ b/meta-oe/recipes-devtools/php/php.inc
> @@ -139,7 +139,6 @@ do_install_append_class-target() {
>      if [ -d ${RECIPE_SYSROOT_NATIVE}${sysconfdir} ];then
>           install -m 0644 ${RECIPE_SYSROOT_NATIVE}${sysconfdir}/pear.conf ${D}${sysconfdir}/
>      fi
> -    rm -rf ${D}/${TMPDIR}
>      rm -rf ${D}/.registry
>      rm -rf ${D}/.channels
>      rm -rf ${D}/.[a-z]*
> @@ -164,14 +163,6 @@ do_install_append_class-target() {
>              ${D}${systemd_unitdir}/system/php-fpm.service
>      fi
>
> -    TMP=`dirname ${D}/${TMPDIR}`
> -    while test ${TMP} != ${D}; do
> -        if [ -d ${TMP} ]; then
> -            rmdir ${TMP}
> -        fi
> -        TMP=`dirname ${TMP}`;
> -    done
> -
>      if ${@bb.utils.contains('PACKAGECONFIG', 'apache2', 'true', 'false', d)}; then
>          install -d ${D}${libdir}/apache2/modules
>          install -d ${D}${sysconfdir}/apache2/modules.d
> --
> 2.18.0
>
> --
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Max Kellermann Sept. 27, 2018, 12:54 p.m.
On 2018/09/24 20:48, Khem Raj <raj.khem@gmail.com> wrote:
> http://errors.yoctoproject.org/Errors/Details/193970/

Hm, I tried to go back and forth to find what is causing this
nonsensical path.  There must be be something which concatenates two
absolute paths, but I can't reproduce it.

In any case, the code which my patch removed makes the problem only
worse.  My build directory happens to be inside /usr/src/, and so the
shell script finally attempts to remove /usr/ which is non-empty,
which crashes the build.

Do you have an idea how to reproduce these strange paths?

Max
Khem Raj Oct. 1, 2018, 4:12 p.m.
On Thu, Sep 27, 2018 at 5:54 AM Max Kellermann
<max+openembedded@blarg.de> wrote:
>
> On 2018/09/24 20:48, Khem Raj <raj.khem@gmail.com> wrote:
> > http://errors.yoctoproject.org/Errors/Details/193970/
>
> Hm, I tried to go back and forth to find what is causing this
> nonsensical path.  There must be be something which concatenates two
> absolute paths, but I can't reproduce it.
>
> In any case, the code which my patch removed makes the problem only
> worse.  My build directory happens to be inside /usr/src/, and so the
> shell script finally attempts to remove /usr/ which is non-empty,
> which crashes the build.
>
> Do you have an idea how to reproduce these strange paths?
>

Build info has all needed bits you need and if you want to use the
distro I use to validate
then you can try

https://github.com/YoeDistro/yoe-distro

> Max