Rust recipe depends on library from other recipe - postgresql

I am trying to generate a package from a Bitbake recipe for Raspberry Pi:
inherit cargo
SUMMARY = "myapp"
DESCRIPTION = "Compile and configure myapp"
LICENSE = "CLOSED"
HOMEPAGE = "git://git.myserver.com:myapp/myapp.git"
DEPENDS = "openssl postgresql"
SRC_URI = "git://git.myserver.com/myapp/myapp.git;protocol=https;user=myuser:mypass;tag=v${PV}"
SRC_URI[sha256sum] = "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
S = "${WORKDIR}/git"
The program I am compiling depends on the PostgreSQL library libpq which is generated by the postgresql package. My problem is that the linker cannot find libpq, even been in DEPENDS.
The output error is:
...
"-Wl,--end-group" "/home/yocto-image/build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/myapp/0.0.1-r0/recipe-sysroot-native/usr/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-e2523c360f03ba10.rlib" "-Wl,-Bdynamic" "-lpq" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc"
| = note: /home/yocto-image/build/tmp/hosttools/ld: cannot find -lpq
| collect2: error: ld returned 1 exit status
|
|
| error: aborting due to previous error
|
...

Finally found the solution. I was cross-compiling the code in a Ubuntu x86_64 PC. The library was necessary for the compiling machine not for the target machine (Raspberry Pi). The solution is just to install the libraries needed in Ubuntu:
sudo apt-get install libpq-dev

Related

ruamel.yaml w/out C compiler on ARM

I am trying to install ruamel.yaml on a raspberry Pi system without a C compiler and encounter a build error installing ruamel.yaml.clib (pasted below).
I see this was previously addressed for ruamel.yaml>=0.15.41, <0.16.0 (How to install ruamel.yaml w/o native extension).
Note in the output below that the path from buildroot is not valid on the device running pip install but is from the device that built the image.
$ pip install ruamel.yaml~=0.16
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting ruamel.yaml~=0.16
Using cached ruamel.yaml-0.17.10-py3-none-any.whl (108 kB)
Collecting ruamel.yaml.clib>=0.1.2; platform_python_implementation == "CPython" and python_version < "3.10"
Using cached ruamel.yaml.clib-0.2.6.tar.gz (180 kB)
ERROR: Command errored out with exit status 1:
command: /usr/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-2t0ptfu4/ruamel-yaml-clib/setup.py'"'"'; __file__='"'"'/tmp/pip-install-2t0ptfu4/ruamel-yaml-clib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-zdtfb19x
cwd: /tmp/pip-install-2t0ptfu4/ruamel-yaml-clib/
Complete output (3 lines):
sys.argv ['/tmp/pip-install-2t0ptfu4/ruamel-yaml-clib/setup.py', 'egg_info', '--egg-base', '/tmp/pip-pip-egg-info-zdtfb19x']
test compiling /tmp/tmp_ruamel_5les1064/test_ruamel_yaml.c -> test_ruamel_yaml compile error: /tmp/tmp_ruamel_5les1064/test_ruamel_yaml.c
Exception: command '{path from buildroot}/aarch64-buildroot-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
A preferred solution would be to have a ruamel.yaml.clib wheel for ARM architectures or to make clib dependency optional (pip install ruamel.yaml[clib])
I'm not sure why this broke after 0.16, but I'll try to have a look as to why this fails again (it might be that setuptools now throws a different Exception that is not caught).
Wheels for ruamel.yaml.clib in aarch64 architecture are availalbe on piwheels.
You should be able to install those after adding:
[global]
extra-index-url=https://www.piwheels.org/simple
to /etc/pip.conf.
Disclaimer: I have no control over how wheels on piwheels are generated.

Yocto: do_rootfs fails because can't find the package I'm building

Trying to add a new package in my target Intel platform with Yocto build system. New package is intel-cmt-cat and its source code is taken from here. After looking at examples, I created my simple recipe file:
% cat intel-cmt-cat_4.1.0.bb
SUMMARY = "Short summary"
DESCRIPTION = "Short description."
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://LICENSE;md5=c63eb1250e8724441150d665efe12012"
SRC_URI = "git://github.com/intel/intel-cmt-cat.git;protocol=https"
SRCREV = "30fadea5cb82ff99f56e46172c7d20fdb24b2338"
S = "${WORKDIR}/git"
Nothing fancy, and should work, however it fails (I removed lengthy dnf command, made it short):
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: myimage-1.0-r0 do_rootfs: Could not invoke dnf.
dnf -v --rpmverbosity=info -y -c dnf.conf package1 package2 ... intel-cmt-cat
...
repo: using cache for: oe-repo
not found other for:
not found modules for:
not found deltainfo for:
not found updateinfo for:
oe-repo: using metadata from Thu 04 Mar 2021 07:12:38 PM UTC.
No module defaults found
No match for argument: intel-cmt-cat
Error: Unable to find a match
...
ERROR: Function failed: do_rootfs
It appears to me that do_rootfs() function is failing. I checked the build directory, and can see that the sources have been fetched and built. However the later steps fail: as you see it is unable to locate my package (as far as I can say).
What am I doing wrong?
After reading manuals at yoctoproject.org, I came up with the following recipe:
SUMMARY = "Short summary"
DESCRIPTION = "Short description."
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://LICENSE;md5=c63eb1250e8724441150d665efe12012"
SRC_URI = "git://github.com/intel/intel-cmt-cat.git;protocol=https"
SRCREV = "30fadea5cb82ff99f56e46172c7d20fdb24b2338"
S = "${WORKDIR}/git"
TARGET_CC_ARCH += "${LDFLAGS}"
do_compile() {
oe_runmake PREFIX=/usr
}
do_install() {
oe_runmake PREFIX=${D}/usr NOLDCONFIG=y install
rm -rf ${D}/usr/man
rm -rf ${D}/usr/include
}
INSANE_SKIP_${PN} += "already-stripped"
FILES_${PN} += "${libdir}/libpqos* ${bindir}/pqos* ${bindir}/rdtset"}
intel-cmt-cat does not use cmake, just good old make and Makefile.
I only rely on the package's LDFLAGS and don't pass any in the recipe, so this caused error during build:
No GNU_HASH in the elf binary: ...
In order to workaround this, add TARGET_CC_ARCH directive.
I explicitly call oe_runmake fuunction as I want to pass on a different PREFIX value (default is /usr/local); next in do_install I pass on NOLDCONFIG=y which will not invoke ldconfig and finally skips checking (via directive INSANE_SKIP) if generated binaries have not already been stripped. This is done because the Makefile already calls install -s ... and I didn't want to patch Makefile etc.

Error on building Openembedded for Intel Quark

Trying to build Linux for Advantech UBC-221 that has Intel Quark processor.
The system is Debian 9, running on VMware. Was able to build poky succefully before.
Let me summarize what I was doing:
mkdir quark
cd quark
git clone git://git.yoctoproject.org/meta-intel-quark
git clone git://git.openembedded.org/openembedded-core
git clone git://git.yoctoproject.org/poky
cp -r poky/bitbake .
cd openembedded-core
source oe-init-build-env
bitbake-layers add-layer ~/quark/meta-intel-quark/
bitbake core-image-base
Error code I get:
WARNING: Layer quark-bsp should set LAYERSERIES_COMPAT_quark-bsp in its conf/layer.conf file to list the core layer names it is compatible with.
WARNING: Layer quark-bsp should set LAYERSERIES_COMPAT_quark-bsp in its conf/layer.conf file to list the core layer names it is compatible with.
WARNING: /home/bgabor/quark/meta-intel-quark/recipes-kernel/linux/linux-yocto-quark_3.8.bb: Variable key RDEPENDS_${KERNEL_PACKAGE_NAME}-base (${KERNEL_PACKAGE_NAME}-image) replaces original key RDEPENDS_kernel-base ().
WARNING: /home/bgabor/quark/meta-intel-quark/recipes-bsp/grub/grub_0.97.bb: Exception during build_dependencies for CFLAGS
WARNING: /home/bgabor/quark/meta-intel-quark/recipes-bsp/grub/grub_0.97.bb: Error during finalise of /home/bgabor/quark/meta-intel-quark/recipes-bsp/grub/grub_0.97.bb
ERROR: ExpansionError during parsing /home/bgabor/quark/meta-intel-quark/recipes-bsp/grub/grub_0.97.bb
Traceback (most recent call last):
bb.data_smart.ExpansionError: Failure expanding variable CFLAGS, expression was -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/home/bgabor/quark/openembedded-core/build/tmp-glibc/work/i586-oe-linux/grub/0.97+gitAUTOINC+5775f32a62-r0=/usr/src/debug/grub/0.97+gitAUTOINC+5775f32a62-r0 -fdebug-prefix-map=/home/bgabor/quark/openembedded-core/build/tmp-glibc/work/i586-oe-linux/grub/0.97+gitAUTOINC+5775f32a62-r0/recipe-sysroot= -fdebug-prefix-map=/home/bgabor/quark/openembedded-core/build/tmp-glibc/work/i586-oe-linux/grub/0.97+gitAUTOINC+5775f32a62-r0/recipe-sysroot-native= -Os -fno-strict-aliasing -Wall -Werror -Wno-shadow -Wno-unused -Wno-pointer-sign -DINTEL_QUARK_TEST=${#base_contains('PACKAGECONFIG', 'grub_test', '1', '0', d)} which triggered exception NameError: name 'base_contains' is not defined
Summary: There were 5 WARNING messages shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
I'm pretty much stuck here. Some help would be greatly appreciated!
Edit:
Tried to build on Debian 7.11 32 bit system. It went better however another error came:
bgabor#debian:~/quark/dizzy/build$ bitbake core-image-base
WARNING: Host distribution "Debian-7.11" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.
Loading cache: 100% |####################################################################################################################################################| ETA: 00:00:00
Loaded 1292 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies
Build Configuration:
BB_VERSION = "1.24.0"
BUILD_SYS = "i686-linux"
NATIVELSBSTRING = "Debian-7.11"
TARGET_SYS = "i586-poky-linux"
MACHINE = "quark"
DISTRO = "poky"
DISTRO_VERSION = "1.7.3"
TUNE_FEATURES = "m32 i586"
TARGET_FPU = ""
meta
meta-yocto
meta-yocto-bsp = "dizzy:58863ad092c9a279e305c841dbb4353de2ecfae8"
meta-intel-quark = "master:a314f0ceea986fde42d5d9b0ea449f7a563e9351"
NOTE: Preparing runqueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: Unable to install packages. Command '/home/bgabor/quark/dizzy/build/tmp/sysroots/i686-linux/usr/bin/smart --quiet --data-dir=/home/bgabor/quark/dizzy/build/tmp/work/quark-poky-linux/core-image-minimal-initramfs/1.0-r0/rootfs/var/lib/smart install -y busybox#i586 initramfs-live-install-efi#i586 run-postinsts#all initramfs-live-install#i586 udev#i586 initramfs-live-boot#quark base-passwd#i586' returned 1:
error: Can't install initramfs-live-install-1.0-r9#i586: no package provides grub
ERROR: Function failed: do_rootfs
ERROR: Logfile of failure stored in: /home/bgabor/quark/dizzy/build/tmp/work/quark-poky-linux/core-image-minimal-initramfs/1.0-r0/temp/log.do_rootfs.29435
ERROR: Task 240 (/home/bgabor/quark/dizzy/meta/recipes-core/images/core-image-minimal-initramfs.bb, do_rootfs) failed with exit code '1'
NOTE: Tasks Summary: Attempted 2529 tasks of which 2527 didn't need to be rerun and 1 failed.
No currently running tasks (2435 of 2531)
Summary: 1 task failed:
/home/bgabor/quark/dizzy/meta/recipes-core/images/core-image-minimal-initramfs.bb, do_rootfs
Summary: There was 1 WARNING message shown.
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
It does not find grub package, however I can see there are two in the recipes:
bgabor#debian:~/quark/dizzy/build$ bitbake-layers show-recipes | grep "grub" -A 3
Parsing recipes..done.
grub:
meta-intel-quark 0.97+gitAUTOINC+5775f32a62
meta 0.97
meta 2.00
--
grub-conf:
meta-intel-quark 1.0
grub-efi:
meta 2.00
gsettings-desktop-schemas:
meta 3.10.1
Tried to clean and then bitbake again but no result.
What might be the problem here?
First, Poky includes OpenEmbedded Core so you don't need to clone both, just clone Poky.
Second, the meta-intel-iot layer is pretty dead and only formally supports the Daisy release of Poky (see the README). You may have luck using newer releases, but obviously not git master (aka Thud).
https://wiki.yoctoproject.org/wiki/Releases lists the releases. Instead of checking out master of Poky, check out the relevant release branch. I suggest starting with daisy but trying something a little newer such as jethro would be a good idea.

How to enable dbus-X11 in the yocto

I'm using poky and meta-openembedded(git://git.openembedded.org/meta-openembedded(branch: master)) in yocto
I want to build metacity and cyrus-sasl(2.1.26) for my SDK platform
I run the following command
I add BBCLASSEXTEND += " nativesdk" to metacity's bb
and run bitbake nativesdk-metacity
but I will get error message
ERROR: Nothing RPROVIDES 'nativesdk-dbus-x11' (but virtual:nativesdk:poky/meta/rec on or otherwise requires it)
ERROR: Nothing RPROVIDES 'nativesdk-dbus-x11' (but virtual:nativesdk:poky/meta/recipes-core/dbus/dbus-glib_0.110.bb RDEPENDS on or otherwise requires it) ERROR: Required build target 'nativesdk-metacity' has no buildable providers. Missing or unbuildable dependency chain was: ['nativesdk-metacity', 'nativesdk-libcanberra', 'nativesdk-pulseaudio', 'nativesdk-gconf', 'nativesdk-dbus-glib', 'nativesdk-dbus-x11']
ERROR: Nothing PROVIDES 'dbus-x11'. Close matches:
dbus RPROVIDES dbus-x11
I cannot find dbus-x11's bb in my all meta
and I cannot see dbus-x11 then run bitbake -s
How can I enable dbus-x11 ??
and...
I also add BBCLASSEXTEND += " nativesdk" to cyrus-sasl_2.1.26.bb
and bitbake nativesdk-cyrus-sasl
get error message
| x86_64-pokysdk-linux-gcc --sysroot=/poky/build-fw/tmp/work/x86_64-nativesdk-pokysdk-linux/nativesdk-cyrus-sasl/2.1.26-r0/recipe-sysroot -O2 -pipe -Wl,-O1 -o saslauthd mechanisms.o auth_dce.o auth_getpwent.o auth_krb5.o auth_krb4.o auth_pam.o auth_rimap.o auth_httpform.o auth_shadow.o auth_sia.o auth_sasldb.o lak.o auth_ldap.o cache.o cfile.o krbtf.o utils.o ipc_unix.o ipc_doors.o saslauthd-main.o md5.o -lresolv
| auth_getpwent.o: In function `auth_getpwent':
| auth_getpwent.c:(.text+0x42): undefined reference to `crypt'
| auth_shadow.o: In function `auth_shadow':
| auth_shadow.c:(.text+0x109): undefined reference to `crypt'
| collect2: error: ld returned 1 exit status
| Makefile:456: recipe for target 'saslauthd' failed
How can I add -lcrypt to cyrus-sasl_2.1.26.bb bb??
thanks a lot
John

Trying to install meteor on centos 5

OS: Red Hat Enterprise Linux Server release 5.5 (Tikanga)
Trying to run this command to install meteor:
curl install.meteor.com | /bin/sh
============= Output Error ===============
Installing /tmp/meteor-install-Nv47529/meteor-0.3.6-1.x86_64.rpm
error: Failed dependencies:
libc.so.6(GLIBC_2.6)(64bit) is needed by meteor-0.3.6-1.x86_64
libc.so.6(GLIBC_2.7)(64bit) is needed by meteor-0.3.6-1.x86_64
libc.so.6(GLIBC_2.9)(64bit) is needed by meteor-0.3.6-1.x86_64
libstdc++.so.6(GLIBCXX_3.4.9)(64bit) is needed by meteor-0.3.6-1.x86_64
Installation failed.
============= Output Error ===============
glib is missing showing but check glib using
rpm -qa --qf="%{n}-%{v}-%{r}.%{arch}\n" | grep glibc | sort
showing me
compat-glibc-2.3.4-2.26.i386
compat-glibc-2.3.4-2.26.x86_64
compat-glibc-headers-2.3.4-2.26.x86_64
glibc-2.5-49.el5_5.7.i686
glibc-2.5-49.el5_5.7.x86_64
glibc-common-2.5-49.el5_5.7.x86_64
glibc-devel-2.5-49.el5_5.7.i386
glibc-devel-2.5-49.el5_5.7.x86_64
glibc-headers-2.5-49.el5_5.7.x86_64
glibc-utils-2.5-49.el5_5.7.x86_64
so any idea what is the issue?
GLIBC_2.6 is required by the RPM, you only have GLIBC_2.5 so you need to upgrade.
Alternatively, this dependency may be more strict than it needs to be; try packing Meteor yourself.