Install: omitting directory ERROR

i am trying to add a python package to my yocto image through its .whl but i am facing some troubles with the installation of binaries i their proper folder . they are properly installed under image/usr/lib/python3.10/site-packages/speech_recognition as u see :

rania@rania:~/pixii_os/pixii_os/build/tmp/work/cortexa72-cortexa53-tdx-linux/python3-speechrecognition/3.10.4-r0/devtooltmp-boutfwpa/workdir/image/usr/lib/python3.10/site-packages/speech_recognition$ tree
.
├── audio.py
├── exceptions.py
├── flac-linux-x86
├── flac-linux-x86_64
├── flac-mac
├── flac-win32.exe
├── __init__.py
├── __main__.py
├── pocketsphinx-data
│   └── en-US
│       ├── acoustic-model
│       │   ├── feat.params
│       │   ├── mdef
│       │   ├── means
│       │   ├── noisedict
│       │   ├── README
│       │   ├── sendump
│       │   ├── transition_matrices
│       │   └── variances
│       ├── language-model.lm.bin
│       ├── LICENSE.txt
│       └── pronounciation-dictionary.dict
├── __pycache__
│   ├── audio.cpython-310.pyc
│   ├── exceptions.cpython-310.pyc
│   ├── __init__.cpython-310.pyc
│   └── __main__.cpython-310.pyc
└── recognizers
    ├── google.py
    ├── __init__.py
    ├── __pycache__
    │   ├── google.cpython-310.pyc
    │   ├── __init__.cpython-310.pyc
    │   └── whisper.cpython-310.pyc
    └── whisper.py

NB some files suppose to be deleted according to my recipe but they are not
here’s the recipe

LICENSE = "BSD-3-Clause & GPL-2.0-only & Unknown"
LIC_FILES_CHKSUM = "file://LICENSE-FLAC.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
                    file://LICENSE.txt;md5=2954ce0ca8c545fe806fcad8c24cb7d0 \
                    file://speech_recognition/pocketsphinx-data/en-US/LICENSE.txt;md5=93bfe6b712fe592d844ef581e1e53d47"

SRC_URI = "https://files.pythonhosted.org/packages/75/0a/52111a3dc0a8b554da0037532ed6cd1d06057d74ada865ec4fe2e4400c47/speechrecognition-${PV}.tar.gz"
SRC_URI[md5sum] = "ec71c849176e24863d48eda501bf334a"
SRC_URI[sha1sum] = "6c3d5e4e70a58330df686c1e841b3f9eaf7b4210"
SRC_URI[sha256sum] = "986bafcf61f14625c2f3cea6a471838edd379ed68aeed7b8f3c0fb41e21f1125"
SRC_URI[sha384sum] = "b91a5551c435459b8f70becc40d126a70350b3e9147302c0bac04334e3af9cb44b02c8df8ada5dd6f846d82e05bbf595"
SRC_URI[sha512sum] = "dde249b5e88e0ec228d72bc180e732091447cab7fccbb10204d2aaeb556fba8f6e236c8bdfc2be78d81f13e0fb72e38934305df77143569f65447235ef9e724f"

S = "${WORKDIR}/speechrecognition-${PV}"

inherit setuptools3

do_install:append() {

    install -d ${D}${PYTHON_SITEPACKAGES_DIR}/speech_recognition
    install -m 755 ${S}/speech_recognition/* ${D}${PYTHON_SITEPACKAGES_DIR}/speech_recognition/
   

    rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/speech_recognition/flac-linux-x86_64
    rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/speech_recognition/flac-linux-x86
    rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/speech_recognition/flac-mac
    rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/speech_recognition/flac-win32.exe
}

FILES_${PN} = "${PYTHON_SITEPACKAGES_DIR}/speech_recognition/*"
FILES_${PN} += "${PYTHON_SITEPACKAGES_DIR}/speech_recognition/__pycache__/*"
FILES_${PN} += "${PYTHON_SITEPACKAGES_DIR}/speech_recognition/pocketsphinx-data/*"
FILES_${PN} += "${PYTHON_SITEPACKAGES_DIR}/speech_recognition/recognizers/*"


here are logs

install: omitting directory '/home/rania/pixii_os/pixii_os/build/tmp/work/cortexa72-cortexa53-tdx-linux/python3-speechrecognition/3.10.4-r0/devtooltmp-boutfwpa/workdir/speechrecognition-3.10.4/speech_recognition/__pycache__'
| install: omitting directory '/home/rania/pixii_os/pixii_os/build/tmp/work/cortexa72-cortexa53-tdx-linux/python3-speechrecognition/3.10.4-r0/devtooltmp-boutfwpa/workdir/speechrecognition-3.10.4/speech_recognition/pocketsphinx-data'
| install: omitting directory '/home/rania/pixii_os/pixii_os/build/tmp/work/cortexa72-cortexa53-tdx-linux/python3-speechrecognition/3.10.4-r0/devtooltmp-boutfwpa/workdir/speechrecognition-3.10.4/speech_recognition/recognizers'

NB i tried cp -r but got no binaries installed in the output folder

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


The issue you’re facing is due to the install command not handling directories recursively, which is why directories like __pycache__, pocketsphinx-data, and recognizers are being omitted. You’ve already tried using cp -r, but it seems that didn’t resolve the issue. Here are some steps you can take to address this:

  1. Use cp -r Correctly:
    Ensure that when you use cp -r, you are specifying the correct source and destination paths. The command should look something like this:

    cp -r ${S}/speech_recognition/* ${D}${PYTHON_SITEPACKAGES_DIR}/speech_recognition/
    

    Make sure that the destination directory ${D}${PYTHON_SITEPACKAGES_DIR}/speech_recognition/ exists before running the cp command.

  2. Verify Directory Creation:
    Before copying, ensure that the destination directory is created. You can add this line before the cp command:

    install -d ${D}${PYTHON_SITEPACKAGES_DIR}/speech_recognition
    
  3. Check for Errors:
    If cp -r is not copying the files as expected, check for any errors in the logs that might indicate why the files are not being copied. Ensure that the source directory ${S}/speech_recognition/ contains the expected files and directories.

  4. Debugging:
    If the issue persists, you might want to manually inspect the contents of ${S}/speech_recognition/ to ensure all necessary files and directories are present before the copy operation.

  5. Alternative Approach:
    If cp -r still doesn’t work, consider using a different approach to copy the directories, such as using rsync if available, which can handle recursive copying and provide more detailed output for debugging:

    rsync -av ${S}/speech_recognition/ ${D}${PYTHON_SITEPACKAGES_DIR}/speech_recognition/
    

By ensuring the correct use of cp -r or trying rsync, you should be able to include all necessary directories and files in your Yocto image.

Please, also check if these links can help you solve your problem:

Failed in "do_image_bootfs" when building "tdx-reference-multimedia-image".

i got this error when using rsync

ERROR: Task (/home/rania/pixii_os/pixii_os/layers/meta-pixii/recipes-devtools/python/python3-speechrecognition_3.10.4.bb:do_install) failed with exit code '1' 
Pseudo log:
path mismatch [3 links]: ino 3183616 db '/home/rania/pixii_os/pixii_os/build/tmp/work/cortexa72-cortexa53-tdx-linux/python3-speechrecognition/3.10.4-r0/devtooltmp-boutfwpa/workdir/image/usr/lib/python3.10' req '/home/rania/pixii_os/pixii_os/build/tmp/work/cortexa72-cortexa53-tdx-linux/python3-speechrecognition/3.10.4-r0/devtooltmp-boutfwpa/workdir/image/usr'.
inode mismatch: '/home/rania/pixii_os/pixii_os/build/tmp/work/cortexa72-cortexa53-tdx-linux/python3-speechrecognition/3.10.4-r0/devtooltmp-boutfwpa/workdir/image/usr' ino 3183614 in db, 3183616 in request.
Setup complete, sending SIGUSR1 to pid 6759.

i used cp and it gives me an empty workdir

cp -r worked thanks for your help

Hi @rania !

Thank you for sharing the solution!

We sent you an email. Please get back to us there when you have time.

Best regards,