Search code examples
linuxbuildembeddedyocto

How to solve the error "do_package: ... not shipped in any package"?


At work, I've been facing an error during an SDK build using krogoth branch to an internal machine aimed to x86 architecture, the following description summarizes it:

ERROR: nativesdk-flatbuffers-1.12.0-r0 do_package: QA Issue: nativesdk-flatbuffers: Files/directories were installed but not shipped in any package:
  /opt/art/3.0.52.2/sysroots/x86_64-artsdk-linux/usr/lib/cmake
  /opt/art/3.0.52.2/sysroots/x86_64-artsdk-linux/usr/lib/cmake/flatbuffers
  /opt/art/3.0.52.2/sysroots/x86_64-artsdk-linux/usr/lib/cmake/flatbuffers/FlatbuffersTargets.cmake
  /opt/art/3.0.52.2/sysroots/x86_64-artsdk-linux/usr/lib/cmake/flatbuffers/FlatbuffersSharedTargets.cmake
  /opt/art/3.0.52.2/sysroots/x86_64-artsdk-linux/usr/lib/cmake/flatbuffers/FlatbuffersConfig.cmake
  /opt/art/3.0.52.2/sysroots/x86_64-artsdk-linux/usr/lib/cmake/flatbuffers/FlatbuffersTargets-release.cmake
  /opt/art/3.0.52.2/sysroots/x86_64-artsdk-linux/usr/lib/cmake/flatbuffers/FlatbuffersConfigVersion.cmake
  /opt/art/3.0.52.2/sysroots/x86_64-artsdk-linux/usr/lib/cmake/flatbuffers/FlatcTargets-release.cmake
  /opt/art/3.0.52.2/sysroots/x86_64-artsdk-linux/usr/lib/cmake/flatbuffers/FlatcTargets.cmake
  /opt/art/3.0.52.2/sysroots/x86_64-artsdk-linux/usr/lib/cmake/flatbuffers/FlatbuffersSharedTargets-release.cmake
Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install.
nativesdk-flatbuffers: 10 installed and not shipped files. [installed-vs-shipped]
ERROR: nativesdk-flatbuffers-1.12.0-r0 do_package: Fatal QA errors found, failing task.
ERROR: nativesdk-flatbuffers-1.12.0-r0 do_package: Function failed: do_package
ERROR: Logfile of failure stored in: /data/opt/art-shell/users/andre.machoski/krogoth/build/hmi-x86/tmp/work/x86_64-nativesdk-artsdk-linux/nativesdk-flatbuffers/1.12.0-r0/temp/log.do_package.2296
ERROR: Task 2782 (virtual:nativesdk:/data/opt/art-shell/users/andre.machoski/krogoth/poky/meta-art-apps/recipes-3rd/flatbuffers/flatbuffers_1.12.0.bb, do_package) failed with exit code '1'
ERROR: hmiapp-belgrano-1.0-r0 do_compile: oe_runmake failed
ERROR: hmiapp-belgrano-1.0-r0 do_compile: Function failed: do_compile (log file is located at /data/opt/art-shell/users/andre.machoski/krogoth/build/hmi-x86/tmp/work/core2-32-art-linux/hmiapp-belgrano/1.0-r0/temp/log.do_compile.2255)
ERROR: Logfile of failure stored in: /data/opt/art-shell/users/andre.machoski/krogoth/build/hmi-x86/tmp/work/core2-32-art-linux/hmiapp-belgrano/1.0-r0/temp/log.do_compile.2255

I asked a workmate for some help, and he instructed me to fill the recipe with the following content:

FILES_nativesdk-${PN} = " ${libdir}/cmake \
                        ${libdir}/cmake/flatbuffers \
                        ${libdir}/cmake/flatbuffers/FlatbuffersTargets.cmake \
                        ${libdir}/cmake/flatbuffers/FlatbuffersSharedTargets.cmake \
                        ${libdir}/cmake/flatbuffers/FlatbuffersConfig.cmake \
                        ${libdir}/cmake/flatbuffers/FlatbuffersTargets-release.cmake \
                        ${libdir}/cmake/flatbuffers/FlatbuffersConfigVersion.cmake \
                        ${libdir}/cmake/flatbuffers/FlatcTargets-release.cmake \
                        ${libdir}/cmake/flatbuffers/FlatcTargets.cmake \
                        ${libdir}/cmake/flatbuffers/FlatbuffersSharedTargets-release.cmake"

But it didn't work. How can I solve this issue?

Below is the full recipe (flatbuffers_1.12.0.bb):

SUMMARY = "Memory Efficient Serialization Library"
HOMEPAGE = "https://github.com/google/flatbuffers"
SECTION = "console/tools"
LICENSE = "Apache-2.0"

PACKAGE_BEFORE_PN = "${PN}-compiler"

RDEPENDS_${PN}-compiler = "${PN}"
RDEPENDS_${PN}-dev += "${PN}-compiler"

LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=3b83ef96387f14655fc854ddc3c6bd57"

SRCREV = "6df40a2471737b27271bdd9b900ab5f3aec746c7"

SRC_URI = "git://github.com/google/flatbuffers.git"

# Make sure C++11 is used, required for example for GCC 4.9
CXXFLAGS += "-std=c++11 -fPIC"
BUILD_CXXFLAGS += "-std=gnu++11 -fPIC"

CXXFLAGS_append_class-nativesdk += "-std=c++11 -fPIC"

# BUILD_TYPE=Release is required, otherwise flatc is not installed
EXTRA_OECMAKE += "\
    -DCMAKE_BUILD_TYPE=Release \
    -DFLATBUFFERS_BUILD_TESTS=OFF \
    -DFLATBUFFERS_BUILD_SHAREDLIB=ON \
"

inherit cmake

S = "${WORKDIR}/git"

FILES_${PN}-compiler = "${bindir}"

BBCLASSEXTEND = "native nativesdk"

FILES_nativesdk-${PN} = " ${libdir}/cmake \
                        ${libdir}/cmake/flatbuffers \
                        ${libdir}/cmake/flatbuffers/FlatbuffersTargets.cmake \
                        ${libdir}/cmake/flatbuffers/FlatbuffersSharedTargets.cmake \
                        ${libdir}/cmake/flatbuffers/FlatbuffersConfig.cmake \
                        ${libdir}/cmake/flatbuffers/FlatbuffersTargets-release.cmake \
                        ${libdir}/cmake/flatbuffers/FlatbuffersConfigVersion.cmake \
                        ${libdir}/cmake/flatbuffers/FlatcTargets-release.cmake \
                        ${libdir}/cmake/flatbuffers/FlatcTargets.cmake \
                        ${libdir}/cmake/flatbuffers/FlatbuffersSharedTargets-release.cmake"

Solution

  • When you're building for nativesdk or native (or multilib), ${PN} already contains nativesdk- prefix (or -native suffix).

    Effectively, what you're doing is setting up FILES_nativesdk-nativesdk-<pkgname> and obviously, this does not match any package being created.

    Either you use FILES_nativesdk-<pkgname> or you can also use FILES_${PN}_class-nativesdk which will set FILES_${PN} with the content you pass it to only when building for nativesdk.