How do i patch in yocto? - patch

I am attempting to build an image for the jetson-nano using yocto poky-warrior and meta-tegra warrior-l4t-r32.2 layer.
I've been following this thread because he had the same problem as me, and the answer on that thread fixed it, but then a new problem occoured.Building with
bitbake core-image-minimal
Stops with an error stating
ERROR: Task (…/jetson-nano/layers/poky-warrior/meta/recipes-core/libxcrypt/libxcrypt.bb:do_configure) failed with exit code '1'
I've been told that applying the following patch would fix this problem:
diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes- core/busybox/busybox.inc
index 174ce5a8c0..e8d651a010 100644
--- a/meta/recipes-core/busybox/busybox.inc
+++ b/meta/recipes-core/busybox/busybox.inc
## -128,7 +128,7 ## do_prepare_config () {
${S}/.config.oe-tmp > ${S}/.config
fi
sed -i 's/CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-R -n"/CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-R -b"/' ${S}/.config
- sed -i 's|${DEBUG_PREFIX_MAP}||g' ${S}/.config
+ #sed -i 's|${DEBUG_PREFIX_MAP}||g' ${S}/.config
}
# returns all the elements from the src uri that are .cfg files
diff --git a/meta/recipes-core/libxcrypt/libxcrypt.bb b/meta/recipes-core/libxcrypt/libxcrypt.bb
index 3b9af6d739..350f7807a7 100644
--- a/meta/recipes-core/libxcrypt/libxcrypt.bb
+++ b/meta/recipes-core/libxcrypt/libxcrypt.bb
## -24,7 +24,7 ## FILES_${PN} = "${libdir}/libcrypt*.so.* ${libdir}/libcrypt-*.so ${libdir}/libowc
S = "${WORKDIR}/git"
BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE} -std=gnu99"
-TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${includedir} -Wno-error=missing-attributes"
-CPPFLAGS_append_class-nativesdk = " -Wno-error=missing-attributes"
+TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${includedir} "
+CPPFLAGS_append_class-nativesdk = " "
BBCLASSEXTEND = "nativesdk"
So I've made a libxcrypt.patch file and copy pasted the patch content and put the file in my poky meta layer. But how do I apply the patch?
I can't figure out what to do from here, do I need to make an bbappend file or add to one?- if so which one? or do I need to edit a .bb file?- maybe libxcrypt.bb? And do I need to add these lines:
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI += "file://path/to/patch/file"
I've been trying to look at similar stackoverflow posts about this but they don't seem to be precise enough for me to work it out as I am completely new to yocto and the likes.
So far I've tried to add the lines
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI += "file://path/to/patch/file"
to the libxcrypt.bb file but it says it cannot find the file to patch.
Then I found out this could potentially be solved with adding ;striplevel=0 to the SRC_URI line, so I did this:
SRC_URI += "file://path/to/patch/file;striplevel=0"
Which did nothing. Then I tried to put
--- a/meta/recipes-core/busybox/busybox.inc
+++ b/meta/recipes-core/busybox/busybox.inc
In the top of the patch file, but this also did nothing.
This is the full error message without attempting to apply the patch:
ERROR: libxcrypt-4.4.2-r0 do_configure: configure failed
ERROR: libxcrypt-4.4.2-r0 do_configure: Function failed: do_configure (log file is located at /home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/temp/log.do_configure.42560)
ERROR: Logfile of failure stored in: /home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/temp/log.do_configure.42560
Log data follows:
| DEBUG: SITE files ['endian-little', 'bit-64', 'arm-common', 'arm-64', 'common-linux', 'common-glibc', 'aarch64-linux', 'common']
| DEBUG: Executing shell function autotools_preconfigure
| DEBUG: Shell function autotools_preconfigure finished
| DEBUG: Executing python function autotools_aclocals
| DEBUG: SITE files ['endian-little', 'bit-64', 'arm-common', 'arm-64', 'common-linux', 'common-glibc', 'aarch64-linux', 'common']
| DEBUG: Python function autotools_aclocals finished
| DEBUG: Executing shell function do_configure
| automake (GNU automake) 1.16.1
| Copyright (C) 2018 Free Software Foundation, Inc.
| License GPLv2+: GNU GPL version 2 or later <https://gnu.org/licenses/gpl-2.0.html>
| This is free software: you are free to change and redistribute it.
| There is NO WARRANTY, to the extent permitted by law.
|
| Written by Tom Tromey <tromey#redhat.com>
| and Alexandre Duret-Lutz <adl#gnu.org>.
| AUTOV is 1.16
| NOTE: Executing ACLOCAL="aclocal --system-acdir=/home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/recipe-sysroot/usr/share/aclocal/ --automake-acdir=/home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/recipe-sysroot-native/usr/share/aclocal-1.16" autoreconf -Wcross --verbose --install --force --exclude=autopoint -I /home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/git/m4/ -I /home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/recipe-sysroot-native/usr/share/aclocal/
| autoreconf: Entering directory `.'
| autoreconf: configure.ac: not using Gettext
| autoreconf: running: aclocal --system-acdir=/home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/recipe-sysroot/usr/share/aclocal/ --automake-acdir=/home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/recipe-sysroot-native/usr/share/aclocal-1.16 -I /home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/git/m4/ -I /home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/recipe-sysroot-native/usr/share/aclocal/ --force -I m4
| autoreconf: configure.ac: tracing
| autoreconf: running: libtoolize --copy --force
| libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'm4'.
| libtoolize: copying file 'm4/ltmain.sh'
| libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
| libtoolize: copying file 'm4/libtool.m4'
| libtoolize: copying file 'm4/ltoptions.m4'
| libtoolize: copying file 'm4/ltsugar.m4'
| libtoolize: copying file 'm4/ltversion.m4'
| libtoolize: copying file 'm4/lt~obsolete.m4'
| autoreconf: running: /home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/recipe-sysroot-native/usr/bin/autoconf --include=/home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/git/m4/ --include=/home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/recipe-sysroot-native/usr/share/aclocal/ --force
| autoreconf: running: /home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/recipe-sysroot-native/usr/bin/autoheader --include=/home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/git/m4/ --include=/home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/recipe-sysroot-native/usr/share/aclocal/ --force
| autoreconf: running: automake --add-missing --copy --force-missing
| configure.ac:31: installing 'm4/compile'
| configure.ac:30: installing 'm4/config.guess'
| configure.ac:30: installing 'm4/config.sub'
| configure.ac:17: installing 'm4/install-sh'
| configure.ac:17: installing 'm4/missing'
| Makefile.am: installing './INSTALL'
| Makefile.am: installing 'm4/depcomp'
| parallel-tests: installing 'm4/test-driver'
| autoreconf: running: gnu-configize
| autoreconf: Leaving directory `.'
| NOTE: Running ../git/configure --build=x86_64-linux --host=aarch64-poky-linux --target=aarch64-poky-linux --prefix=/usr --exec_prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/libexec --datadir=/usr/share --sysconfdir=/etc --sharedstatedir=/com --localstatedir=/var --libdir=/usr/lib --includedir=/usr/include --oldincludedir=/usr/include --infodir=/usr/share/info --mandir=/usr/share/man --disable-silent-rules --disable-dependency-tracking --with-libtool-sysroot=/home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/recipe-sysroot --disable-static
| configure: loading site script /home/mci/yocto/dev-jetson-nano/layers/poky-warrior/meta/site/endian-little
| configure: loading site script /home/mci/yocto/dev-jetson-nano/layers/poky-warrior/meta/site/arm-common
| configure: loading site script /home/mci/yocto/dev-jetson-nano/layers/poky-warrior/meta/site/arm-64
| configure: loading site script /home/mci/yocto/dev-jetson-nano/layers/poky-warrior/meta/site/common-linux
| configure: loading site script /home/mci/yocto/dev-jetson-nano/layers/poky-warrior/meta/site/common-glibc
| configure: loading site script /home/mci/yocto/dev-jetson-nano/layers/poky-warrior/meta/site/common
| configure: loading site script /home/mci/yocto/dev-jetson-nano/layers/meta-openembedded/meta-networking/site/endian-little
| checking for a BSD-compatible install... /home/mci/yocto/dev-jetson-nano/build/tmp/hosttools/install -c
| checking whether build environment is sane... yes
| checking for aarch64-poky-linux-strip... aarch64-poky-linux-strip
| checking for a thread-safe mkdir -p... /home/mci/yocto/dev-jetson-nano/build/tmp/hosttools/mkdir -p
| checking for gawk... gawk
| checking whether make sets $(MAKE)... yes
| checking whether make supports nested variables... yes
| checking build system type... x86_64-pc-linux-gnu
| checking host system type... aarch64-poky-linux-gnu
| checking for aarch64-poky-linux-gcc... aarch64-poky-linux-gcc -march=armv8-a+crc -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/recipe-sysroot
| checking whether the C compiler works... no
| configure: error: in `/home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/build':
| configure: error: C compiler cannot create executables
| See `config.log' for more details
| NOTE: The following config.log files may provide further information.
| NOTE: /home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/build/config.log
| ERROR: configure failed
| WARNING: /home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/temp/run.do_configure.42560:1 exit 1 from 'exit 1'
| ERROR: Function failed: do_configure (log file is located at /home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/temp/log.do_configure.42560)
ERROR: Task (/home/mci/yocto/dev-jetson-nano/layers/poky-warrior/meta/recipes-core/libxcrypt/libxcrypt.bb:do_configure) failed with exit code '1'
NOTE: Tasks Summary: Attempted 883 tasks of which 848 didn't need to be rerun and 1 failed.
This is the full error log when I try to add the lines to the libxcrypt.bb file to apply the patch:
ERROR: libxcrypt-4.4.2-r0 do_patch: Command Error: 'quilt --quiltrc /home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/recipe-sysroot-native/etc/quiltrc push' exited with 0 Output:
Applying patch libxcrypt.patch
can't find file to patch at input line 7
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- a/meta/recipes-core/busybox/busybox.inc
|+++ b/meta/recipes-core/busybox/busybox.inc
|diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
|index 174ce5a8c0..e8d651a010 100644
|--- a/meta/recipes-core/busybox/busybox.inc
|+++ b/meta/recipes-core/busybox/busybox.inc
--------------------------
No file to patch. Skipping patch.
1 out of 1 hunk ignored
can't find file to patch at input line 20
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/meta/recipes-core/libxcrypt/libxcrypt.bb b/meta/recipes-core/libxcrypt/libxcrypt.bb
|index 3b9af6d739..350f7807a7 100644
|--- a/meta/recipes-core/libxcrypt/libxcrypt.bb
|+++ b/meta/recipes-core/libxcrypt/libxcrypt.bb
--------------------------
No file to patch. Skipping patch.
1 out of 1 hunk ignored
Patch libxcrypt.patch does not apply (enforce with -f)
ERROR: libxcrypt-4.4.2-r0 do_patch:
ERROR: libxcrypt-4.4.2-r0 do_patch: Function failed: patch_do_patch
ERROR: Logfile of failure stored in: /home/mci/yocto/dev-jetson-nano/build/tmp/work/aarch64-poky-linux/libxcrypt/4.4.2-r0/temp/log.do_patch.34179
ERROR: Task (/home/mci/yocto/dev-jetson-nano/layers/poky-warrior/meta/recipes-core/libxcrypt/libxcrypt.bb:do_patch) failed with exit code '1'
NOTE: Tasks Summary: Attempted 811 tasks of which 793 didn't need to be rerun and 1 failed.
I know this might be a trivial question for a lot, but as a new developer this is very hard to figure out on my own.

The concept of patching by adding patch files to meta layers and referencing them in SRC_URI only applies to patching the source code of packages. You can't use it to patch meta data (recipes) itself as you are trying to.
Instead you can manually change your local recipes, or add bbappends to your layer to change the existing recipes in poky. The best way to fix it permanently is to look for upstream fixes and update your poky layer if there are fixes, or if not send patches to upstream to fix it.
For the bbappend solution for libxcrypt, you would for example create a libxcrypt.bbappend with something like this as content:
TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${includedir} "
CPPFLAGS_reomve_class-nativesdk = "-Wno-error=missing-attributes"

The patch you have is for the yocto/poky sources themselves (as opposed to the more usual case of having patches for the actual components that yocto builds and bbappends that modify recipes in other layers somehow).
So if you really want to use this patch, there's no need to "integrate" it into yocto, just run run git am <patchfile> in your poky root dir or use "patch" command directly. This is not very maintainable since your poky now differs from upstream but might work...
It should be possible to do the same changes using bbappends that you could then store in your own layer (this way the poky repo would be untouched) but the patch you have does not do that. This would be the most "proper" way of paching that you asked about in the comment -- but if you know that you aren't going to ever upgrade poky then it might not be work worth doing.

Related

Yocto: recipe cannot be made due to missing directories

I am starting to work on Yocto, and trying to put in my first recipe. I already put in the layer for it, called: "meta-layer". This layer was added using the bitbake-layers (create and add) tools, and looks like this:
With the conf/layer.conf in there looking like this:
# We have a conf and classes directory, add to BBPATH
BBPATH .= ":${LAYERDIR}"
# We have recipes-* directories, add to BBFILES
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
${LAYERDIR}/recipes-*/*/*.bbappend"
BBFILE_COLLECTIONS += "meta-layer"
BBFILE_PATTERN_meta-layer = "^${LAYERDIR}/"
BBFILE_PRIORITY_meta-layer = "6"
LAYERDEPENDS_meta-layer = "core"
LAYERSERIES_COMPAT_meta-layer = "mickledore"
And the bblayers.conf in the build folder looks like this:
# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
POKY_BBLAYERS_CONF_VERSION = "2"
BBPATH = "${TOPDIR}"
BBFILES ?= "${LAYERDIR}/recipes-*/*/*.bb \
${LAYERDIR}/recipes-*/*/*.bbappend"
BBLAYERS ?= " \
/home/ydaelemans/workdir/poky/meta \
/home/ydaelemans/workdir/poky/meta-poky \
/home/ydaelemans/workdir/poky/meta-yocto-bsp \
/home/ydaelemans/workdir/poky/meta-qt5 \
/home/ydaelemans/workdir/poky/meta-hello \
/home/ydaelemans/workdir/poky/build/workspace \
/home/ydaelemans/workdir/poky/build/meta-layer \
"
When I now add a recipe using the devtool add, it adds the recipe .bb file in the wrong place (I think?), namely in
devtool add hello /home/ydaelemans//workdir/poky/meta-layer/recipes-hello
/home/ydaelemans/workdir/poky/build/workspace/recipes/hello/hello.bb
Which is in the build directory instead of the layer in the source directory. When trying to run here it will give errors that it cannot find the source files. So I copy it back into the layer (one level above the source files). From here I make some adjustments for it (since I am running a QT program, and yes the qt meta is already pulled and build on this setup). Now this file will look like this:
SUMMARY = "bitbake-layers recipe"
DESCRIPTION = "Recipe created by bitbake-layers"
LICENSE = "CLOSED"
DEPENDS += "qtbase wayland"
SRC_URI = "file://hello.pro \
file://main.cpp \
file://mainwindow.cpp \
file://mainwindow.h \
file://mainwindow.ui \
file://hello.pro.user \
file://hello.pro.user \
file://Makefile"
S = "{WORKDIR}"
do_install:append () {
# install -d ${D}${bindir}
# install -m 0775 qt-app ${D}${bindir}/
}
FILES_${PN} += "${bindir}/qt-app"
inherit qmake5
When I then run it using:
bitbake -b /home/ydaelemans/workdir/poky/meta-layer/recipes-hello/hello.bb
I get these errors:
dir/poky/meta-layer/recipes-hello/hello.bb
WARNING: Buildfile specified, dependencies will not be handled. If this is not what you want, do not use -b / --buildfile.
Loading cache: 100% |########################################################| Time: 0:00:00
Loaded 1786 entries from dependency cache.
Build Configuration:
BB_VERSION = "2.2.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "universal"
TARGET_SYS = "arm-poky-linux-gnueabi"
MACHINE = "qemuarm"
DISTRO = "poky"
DISTRO_VERSION = "4.1"
TUNE_FEATURES = "arm vfp cortexa15 neon thumb callconvention-hard"
TARGET_FPU = "hard"
meta
meta-poky
meta-yocto-bsp = "master:0ce159991d8e49f8fa97bdf5f088fdfd753a32dc"
meta-qt5 = "master:1d1b19ff577835bf847152eed44d52e8267d9093"
meta-hello
workspace
meta-layer = "master:0ce159991d8e49f8fa97bdf5f088fdfd753a32dc"
Initialising tasks: 100% |###################################################| Time: 0:00:01
Sstate summary: Wanted 0 Local 0 Mirrors 0 Missed 0 Current 0 (0% match, 0% complete)
NOTE: No setscene tasks
NOTE: Executing Tasks
ERROR: hello-1.0-r0 do_configure: ExecutionError('/home/ydaelemans/workdir/poky/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/hello/1.0-r0/temp/run.qmake5_base_postconfigure.22783', 2, None, None)
ERROR: Logfile of failure stored in: /home/ydaelemans/workdir/poky/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/hello/1.0-r0/temp/log.do_configure.22783
Log data follows:
| DEBUG: Executing python function extend_recipe_sysroot
| DEBUG: Python function extend_recipe_sysroot finished
| DEBUG: Executing python function externalsrc_configure_prefunc
| DEBUG: Python function externalsrc_configure_prefunc finished
| DEBUG: Executing shell function qmake5_base_preconfigure
| DEBUG: Shell function qmake5_base_preconfigure finished
| DEBUG: Executing shell function do_configure
| DEBUG: Shell function do_configure finished
| DEBUG: Executing python function do_qa_configure
| DEBUG: Python function do_qa_configure finished
| DEBUG: Executing shell function qmake5_base_postconfigure
| WARNING: exit code 2 from a shell command.
| /home/ydaelemans/workdir/poky/build/tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/hello/1.0-r0/temp/run.qmake5_base_postconfigure.22783: 152: cannot create /home/ydaelemans/workdir/poky/build/tmp/work-shared/hello/1.0-r0/configure.sstate: Directory nonexistent
ERROR: Task (/home/ydaelemans/workdir/poky/meta-layer/recipes-hello/hello.bb:do_configure) failed with exit code '1'
NOTE: Tasks Summary: Attempted 7 tasks of which 6 didn't need to be rerun and 1 failed.
Summary: 1 task failed:
/home/ydaelemans/workdir/poky/meta-layer/recipes-hello/hello.bb:do_configure
Summary: There was 1 WARNING message.
Summary: There was 1 ERROR message, returning a non-zero exit code.
It looks like it is failing on the configuration, which I am not touching. It seems weird that I would need to make that directory by hand no? Or is that indeed what you need to do?
PS: why does devtool add put my recipe .bb file in the build directory instead of at the layers in the source directory?
Regarding the PATH of your recipe after devtool add, it is completely normal.
Devtool uses a “Workspace” layer in which to accomplish builds. This layer is not specific to any single devtool command but is rather a common working area used across the tool.
https://docs.yoctoproject.org/ref-manual/devtool-reference.html
Normally after devtool add the PATH in bblayers.conf should be updated.
Regarding the configuration error, you shouldn't create it by hand. I highly recommand you to avoid using devtool add if you are confused.
Run bitbake -c cleanall hello
Create your layer, and your recipe.
Add the PATH to bblayers.conf
Add in your distro file IMAGE_INSTALL_append = " Hello" (do not forget the space before Hello"
And this it. Launch bitbake.
Please read the documentation

msys / mingw command line requires or rejects exe extension based on whether stdout is redirected with ConEmu console

The underlying cause of this problem is described elsewhere, with partial workarounds provided.
For example: stdout is not a tty and stdin is not a tty
An example of a command line I'm having problems with in MSYS2 or MINGW64 environments is this:
# psql -c '\d' | grep public
stdout is not a tty
Here's the output, if issued without piping to grep:
# psql -c '\d'
List of relations
Schema | Name | Type | Owner
--------+----------------+----------+----------
public | tagname | table | postgres
public | tagname_id_seq | sequence | postgres
(2 rows)
In order to redirect stdout, it's apparently necessary to edit the command line, changing psql to psql.exe. This modification does the trick:
# psql.exe -c '\d' | grep public
public | tagname | table | postgres
public | tagname_id_seq | sequence | postgres
This version works, whether or not stdout is redirected:
# psql.exe -c '\d'
List of relations
Schema | Name | Type | Owner
--------+----------------+----------+----------
public | tagname | table | postgres
public | tagname_id_seq | sequence | postgres
(2 rows)
Note that the problem only exists for some programs. For example, /usr/bin/find is indifferent to whether the .exe extension is specified. Also, the cygwin version of psql.exe does not suffer from this limitation.
The workaround of appending .exe could be hidden with an alias if you could always call psql as psql.exe, but there are problems with interactive sessions when called with the extension. (in ConEmu terminal under MSYS_NT-10.0-19042, for example)
So my question is this: is it possible to create a wrapper program (for example, in golang or C, or a shell script) to hide this problem? The goal would be to support optionally redirectable command lines without requiring the .exe extension.
Assuming the wrapper is named "fixtty", it would spawn a command line that could be redirected or not. In other words, neither of these command lines would fail with an error message:
# fixtty psql -c '\d'
# fixtty psql -c '\d' | grep public
A wrapper script (call it fixtty) that hides the problem:
#!/bin/bash
if [ -t 1 ]; then
# stdout is a terminal
"$#"
else
# stdout is a file or pipe
PROG=$1 ; shift
set -- "$PROG.exe" "$#" # append .exe suffix
"$#"
fi
Usage:
$ fixtty psql -c '\d' # unfiltered `stdout`
$ fixtty psql -c '\d' | grep public # filtered
$ fixtty psql # launch interactive session

How do I cross-compile a Qt-project with a recipe in yocto

I am trying to Cross-compile a qt-project from a recipe. I have created a recipe file but when I try to bitbake it. I am met with error
Here is my recipe file
DESCRIPITION = "my_project File Transfer"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = "git://git#bitbucket.org/johndoe/my_ui.git;protocol=ssh;rev=master"
S = "${WORKDIR}/git/my_project"
RDEPENDS_${PN} ="bash"
inherit qmake5
require recipes-qt/qt5/qt5.inc
do_install_append() {
## Creating Folder Structure
install -d ${D}/opt/my_project/bin
install -d ${D}/home/root/my_project
install -d ${D}/home/root/my_project/font
install -d ${D}/home/root/my_project/Images
install -d ${D}/home/root/my_project/Qml
###compile the project
oe_runmake INSTALL_ROOT=${D} install
#### Copying files
install -m 0755 ${S}/font/* ${D}/home/root/my_project/font/
install -m 0755 ${S}/Images/* ${D}/home/root/my_project/Images/
install -m 0755 ${S}/Qml/* ${D}/home/root/my_project/Qml/
}
FILES_${PN} = "/home/root/my_project"
The error that I see is
Sstate summary: Wanted 335 Found 327 Missed 8 Current 1958 (97% match, 99% complete)
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: myproject-project-1.0-r0 do_configure: Error calling /home/blue/yacto/rpi-qt5/build/tmp/work/all-poky-linux/myproject-project/1.0-r0/recipe-sysroot-native/usr/bin/qmake -makefile -o Makefile /home/blue/yacto/rpi-qt5/build/tmp/work/all-poky-linux/myproject-project/1.0-r0/git/myproject/myproject.pro --
ERROR: myproject-project-1.0-r0 do_configure: Function failed: do_configure (log file is located at /home/blue/yacto/rpi-qt5/build/tmp/work/all-poky-linux/myproject-project/1.0-r0/temp/log.do_configure.20982)
ERROR: Logfile of failure stored in: /home/blue/yacto/rpi-qt5/build/tmp/work/all-poky-linux/myproject-project/1.0-r0/temp/log.do_configure.20982
Log data follows:
| DEBUG: Executing shell function qmake5_base_preconfigure
| DEBUG: Shell function qmake5_base_preconfigure finished
| DEBUG: Executing shell function do_configure
| NOTE: qmake prevar substitution: ' '
| Could not find qmake spec 'linux-oe-g++'.
| Error processing project file: /home/blue/yacto/rpi-qt5/build/tmp/work/all-poky-linux/myproject-project/1.0-r0/git/myproject/myproject.pro
| ERROR: Error calling /home/blue/yacto/rpi-qt5/build/tmp/work/all-poky-linux/myproject-project/1.0-r0/recipe-sysroot-native/usr/bin/qmake -makefile -o Makefile /home/blue/yacto/rpi-qt5/build/tmp/work/all-poky-linux/myproject-project/1.0-r0/git/myproject/myproject.pro --
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_configure (log file is located at /home/blue/yacto/rpi-qt5/build/tmp/work/all-poky-linux/myproject-project/1.0-r0/temp/log.do_configure.20982)
ERROR: Task (/home/blue/yacto/poky-warrior-21.0.1/meta-rpi_custom/recipes-custom/myproject-project/myproject-project_1.0.bb:do_configure) failed with exit code '1'
NOTE: Tasks Summary: Attempted 4242 tasks of which 4241 didn't need to be rerun and 1 failed.
Summary: 1 task failed:
/home/blue/yacto/poky-warrior-21.0.1/meta-rpi_custom/recipes-custom/myproject-project/myproject-project_1.0.bb:do_configure
I know that in order to cross-compile. I had to run qmake from my cross-compile tool-chain location and then run make command on it.
I am guessing that is what's missing in my recipe. So my question is, Do I add that in my do_configure
if thats the case can anyone help me or point me how do I populate my do_configure
Is it as simple as source /opt/poky/2.7.1/environment----
then qmake
I am drawing a blank at this step
Please let me know what am I doing wrong
Edit1: remove inherit allarch from recipe
I would just leave inherit qmake5 and put DEPENDS + = "qtbase qtxyz ...", qtxyz would be the list of other dependency modules.

Failed when build qtwayland in Yocto

I am building qt framework with Yocto Rocko, I ran into below error when building qtwayland package.
| ERROR: Error calling /LTSI4.9/R-Car_SKM3ULCB/LTSI4.4/porter/tmp/work/armv7vehf-neon-vfpv4-agl-linux-gnueabi/qtwayland/5.8.0+gitAUTOINC+0e2a950895-r0/recipe-sysroot-native/usr/bin/qt5/qmake -makefile -o Makefile /LTSI4.9/R-Car_SKM3ULCB/LTSI4.4/porter/tmp/work/armv7vehf-neon-vfpv4-agl-linux-gnueabi/qtwayland/5.8.0+gitAUTOINC+0e2a950895-r0/git/qtwayland.pro -- -no-feature-drm-egl-server -no-feature-libhybris-egl-server -no-feature-wayland-brcm -feature-wayland-client -feature-wayland-egl -feature-wayland-server -no-feature-xcomposite-egl -no-feature-xcomposite-glx
|
| Running configuration tests...
| Done running configuration tests.
|
| Configure summary:
|
| Qt Wayland Drivers:
| EGL .................................... no
| Rasberry Pi ............................ no
| XComposite EGL ......................... no
| XComposite GLX ......................... no
| DRM EGL ................................ no
| libhybris EGL .......................... no
| Qt Wayland Client ........................ yes
| Qt Wayland Compositor .................... yes
|
| Note: No wayland-egl support detected. Cross-toolkit compatibility disabled.
|
| ERROR: Feature 'wayland-egl' was enabled, but the pre-condition 'features.wayland-client && features.opengl && features.egl && libs.wayland-egl' failed.
|
| ERROR: Feature 'wayland-egl' was enabled, but the pre-condition 'features.wayland-server && features.opengl && features.egl && libs.wayland-egl' failed.
|
| Check config.log for details.
|
| ERROR: Function failed: do_configure (log file is located at .../temp/log.do_configure.16034)
The building progress was failed at do_configure task. I believed that due to certain missed things from wayland-egl. Any idea can help ?
I try to add wayland feature to the DISTRO feature in local.conf
DISTRO_FEATURES_NATIVESDK_append = " wayland"
DISTRO_FEATURES_append = " wayland"
The Yocto build is successful now. Cheers!
15.0 version qtwayland i got same issue.
i created qtwayland_%.bbappend file included
PACKAGECONFIG_remove_pn-qtwayland = "xcomposite-glx"
or else add above line your local.conf
In my case problem is solved.

Installing Pear, what did I do by entering these commands on my terminal

I'm trying to figure out how to install Pear on my Mac (10.6.6).
Not understanding what they're telling me at pear.php.net, I got some code from http://clickontyler.com/blog/2008/01/how-to-install-pear-in-mac-os-x-leopard/
First, I entered curl http://pear.php.net/go-pear > go-pear.php in my terminal.
It resulted in this output
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 88004 100 88004 0 0 47537 0 0:00:01 0:00:01 --:--:-- 59744
What does that all mean? Am I on the right track?
Next, I entered sudo php -q go-pear.php
and it gave me the long output below. In short I have no idea where I am in the installation process. However, I'm pretty sure that I'm not where I'm supposed to be at following the tutorial at http://clickontyler.com/blog/2008/01/how-to-install-pear-in-mac-os-x-leopard/
because the tutorial tells me to select all the default choices, and I don't see any options to select.
The next line of code is asking me to modify the php.ini files and it requires a password so I'm worried about doing it...Can anyone tell me if I'm on the right track?
sudo cp /etc/php.ini.default /etc/php.ini
Usage: php [options] [-f] <file> [--] [args...]
php [options] -r <code> [--] [args...]
php [options] [-B <begin_code>] -R <code> [-E <end_code>] [--] [args...]
php [options] [-B <begin_code>] -F <file> [-E <end_code>] [--] [args...]
php [options] -- [args...]
php [options] -a
-a Run interactively
-c <path>|<file> Look for php.ini file in this directory
-n No php.ini file will be used
-d foo[=bar] Define INI entry foo with value 'bar'
-e Generate extended information for debugger/profiler
-f <file> Parse and execute <file>.
-h This help
-i PHP information
-l Syntax check only (lint)
-m Show compiled in modules
-r <code> Run PHP <code> without using script tags <?..?>
-B <begin_code> Run PHP <begin_code> before processing input lines
-R <code> Run PHP <code> for every input line
-F <file> Parse and execute <file> for every input line
-E <end_code> Run PHP <end_code> after processing all input lines
-H Hide any passed arguments from external tools.
-s Output HTML syntax highlighted source.
-v Version number
-w Output source with stripped comments and whitespace.
-z <file> Load Zend extension <file>.
args... Arguments passed to script. Use -- args when first argument
starts with - or script is read from stdin
--ini Show configuration file names
--rf <name> Show information about function <name>.
--rc <name> Show information about class <name>.
--re <name> Show information about extension <name>.
--ri <name> Show configuration for extension <name>.
php does not have an argument -q. Its also mentioned in go-pear.php (http://pear.php.net/go-pear) itself, but I dont know, what it wants to tell me. However, try
sudo php go-pear.php
and then follow the instructions.
Update:
-q was used, to start the interpreter in "quiet" mode. It seems, that this option does not exists anymore, because php always starts "quiet", but it should not cause an error, anyway. Now make sure you are in the same directory as the file go-pear.php before you call php go-pear.php.
The first part shows that you successfully downloaded the file to go-pear.php.
The second part is showing that -q isn't a valid option. The third part is asking for the root password, since you're doing 'sudo'.
I used this, though I wasn't installing on Mac:
Getting and installing the PEAR package manager

Resources