labgrid-project / meta-labgrid

OpenEmbedded layer for integrating the labgrid exporter on a device
MIT License
11 stars 12 forks source link

kirkstone: python3-xmodem: do_install append is no longer required #34

Open ngenetzky-appareo opened 1 year ago

ngenetzky-appareo commented 1 year ago

The following packaging logic from python3-xmodem is causing an error when used with kirkstone layer. It appears that is logic is on longer required as we can see the correct files are installed in the correct locations (rather than in "${D}/usr/doc/").


do_install:append() {
    # Move the documentation files to the expected location so they are
    # packaged in the *-docs package.
    mkdir -p ${D}${docdir}/
    mv ${D}/usr/doc/* ${D}${docdir}/
    rmdir ${D}/usr/doc
}

Here is the error that is produced:

mv: cannot stat '<SNIP>/python3-xmodem/0.4.6-r0.2/image/usr/doc/*': No such file or directory
WARNING: exit code 1 from a shell command.                                   
ERROR: Logfile of failure stored in: <SNIP>/python3-xmodem/0.4.6-r0.2/temp/log.do_install.10947  

We can see that the correct files are installed:

$ find <SNIP>/python3-xmodem/0.4.6-r0/image/
<SNIP>/python3-xmodem/0.4.6-r0/image/
<SNIP>/python3-xmodem/0.4.6-r0/image/usr
<SNIP>/python3-xmodem/0.4.6-r0/image/usr/share
<SNIP>/python3-xmodem/0.4.6-r0/image/usr/share/doc
<SNIP>/python3-xmodem/0.4.6-r0/image/usr/share/doc/ymodem.txt
<SNIP>/python3-xmodem/0.4.6-r0/image/usr/share/doc/XMODEM.TXT
<SNIP>/python3-xmodem/0.4.6-r0/image/usr/share/doc/XMODEM1K.TXT
<SNIP>/python3-xmodem/0.4.6-r0/image/usr/share/doc/XMODMCRC.TXT
<SNIP>/python3-xmodem/0.4.6-r0/image/usr/lib
<SNIP>/python3-xmodem/0.4.6-r0/image/usr/lib/python3.9
<SNIP>/python3-xmodem/0.4.6-r0/image/usr/lib/python3.9/site-packages
<SNIP>/python3-xmodem/0.4.6-r0/image/usr/lib/python3.9/site-packages/xmodem-0.4.6-py3.9.egg-info
<SNIP>/python3-xmodem/0.4.6-r0/image/usr/lib/python3.9/site-packages/xmodem-0.4.6-py3.9.egg-info/SOURCES.txt
<SNIP>/python3-xmodem/0.4.6-r0/image/usr/lib/python3.9/site-packages/xmodem-0.4.6-py3.9.egg-info/PKG-INFO
<SNIP>/python3-xmodem/0.4.6-r0/image/usr/lib/python3.9/site-packages/xmodem-0.4.6-py3.9.egg-info/top_level.txt
<SNIP>/python3-xmodem/0.4.6-r0/image/usr/lib/python3.9/site-packages/xmodem-0.4.6-py3.9.egg-info/dependency_links.txt
<SNIP>/python3-xmodem/0.4.6-r0/image/usr/lib/python3.9/site-packages/xmodem
<SNIP>/python3-xmodem/0.4.6-r0/image/usr/lib/python3.9/site-packages/xmodem/__pycache__
<SNIP>/python3-xmodem/0.4.6-r0/image/usr/lib/python3.9/site-packages/xmodem/__pycache__/__main__.cpython-39.pyc
<SNIP>/python3-xmodem/0.4.6-r0/image/usr/lib/python3.9/site-packages/xmodem/__pycache__/__init__.cpython-39.pyc
<SNIP>/python3-xmodem/0.4.6-r0/image/usr/lib/python3.9/site-packages/xmodem/__main__.py
<SNIP>/python3-xmodem/0.4.6-r0/image/usr/lib/python3.9/site-packages/xmodem/__init__.py
ngenetzky-appareo commented 1 year ago

Mentioning the author in the commit that added the logic.

CC: @hnez

commit 2d3933a18413548d15b7c3160df4195fe982a4c1
Author: Leonard Göhrs <l.goehrs@pengutronix.de>
Date:   Mon May 9 08:58:31 2022 +0200

    python3-xmodem: add post install hook to move docs to correct location

    Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>

diff --git a/recipes-backport/python/python3-xmodem_0.4.6.bb b/recipes-backport/python/python3-xmodem_0.4.6.bb
index 9d722b8..d89aabd 100644
--- a/recipes-backport/python/python3-xmodem_0.4.6.bb
+++ b/recipes-backport/python/python3-xmodem_0.4.6.bb
@@ -12,3 +12,11 @@ RDEPENDS:${PN} += " \
 "

 BBCLASSEXTEND = "native nativesdk"
+
+do_install:append() {
+    # Move the documentation files to the expected location so they are
+    # packaged in the *-docs package.
+    mkdir -p ${D}${docdir}/
+    mv ${D}/usr/doc/* ${D}${docdir}/
+    rmdir ${D}/usr/doc
+}
Emantor commented 1 year ago

33 mentions that kirkstone is not supported from the current master version, does it build successfully when you remove the do_install:append?