About the wrong URI in tcf-agent_git.bb in Poky - eclipse

I'm a new hand and try to build a xilinx by pocto.
As the guide, I cloned repositories (branch thud), source oe-... and change MACHINE="zedborad-zynq7", then bitbake petalinux-image-minimal, but I get following error:
ERROR: tcf-agent-1.7.0+gitAUTOINC+dad3a6f568-r0 do_fetch: Fetcher
failure: Fetch command ...
https://git.eclipse.org/gitroot/tcf/org.eclipse.tcf.agent.git
refs/:refs/ failed with exit code 128, output: fatal: repository
'https://git.eclipse.org/gitroot/tcf/org.eclipse.tcf.agent.git/' not
found ... ERROR: Task
(~/poky/meta/recipes-devtools/tcf-agent/tcf-agent_git.bb:do_fetch)
failed with exit code '1'
The issue is that the statement in tcf-agent_git.bb:
SRC_URI = "git://git.eclipse.org/gitroot/tcf/org.eclipse.tcf.agent \
It is NOT the wrong address, In fact, I can clone successfully with this address. On the other hand, any my modify on this variable will NOT work either.
I already grep -rn "eclipse.org", but only find this file.
Any recommendation will be welcome.
Thanks lot.
——————————————————————————
I can't resolve this issue finally.
I find that the builder does NOT fetch from the address the SRC_URL offer at all, instead, it fetches from a mirror given somewhere.
As a test, I edited the .bb file, add PREMIRRORS="" and MIRROS="", and add protocal=git statement for the SRC_URI. The statements are effective realy, the builder fetches from the SRC_URL address, but the protocol is still HTTPS, the function still fails.
My solution is cloning the source manually, and putting it to corresponding directory, in order to let the builder know this, I also touch a package_name.done and chmod 777 in the same directory, then I can continue.

I've run into the exact same issue using Xilinx Yocto stack (rel-v2018.3 branch). For me, the problem wasn't in the tcf-agent_git.bb recipe in core/meta/recipes-devtools/tcf-agent, but in the tcf-agent_%.bbappend file in meta-petalinux/recipes-devtools/tcf-agent. In there, I replaced
SRC_URI = " \
git://git.eclipse.org/gitroot/tcf/org.eclipse.tcf.agent.git;branch=master;protocol=https \
file://fix_ranlib.patch;striplevel=2 \
file://ldflags.patch \
file://tcf-agent.init \
file://tcf-agent.service \
"
with
SRC_URI = " \
git://git.eclipse.org/gitroot/tcf/org.eclipse.tcf.agent.git;branch=master \
file://fix_ranlib.patch;striplevel=2 \
file://ldflags.patch \
file://tcf-agent.init \
file://tcf-agent.service \
"
and it finishes building correctly.
The former used to work fine last time I built the image (a few months ago) but for some reason the protocol=https option makes it fail now.

Your SRC_URI seems wrong.
it should be
SRC_URI = "git://git.eclipse.org/gitroot/tcf/org.eclipse.tcf.agent.git \
This one is working perfect for me.
Note : The back slash () at the end means you have multiple line SRC_URI. correct it if you have only single line.

In December 2021, using branch rel-v2020.1, I needed to change the line into :
SRC_URI = "git://git.eclipse.org/r/tcf/org.eclipse.tcf.agent.git;protocol=https \

Related

yocto-bitbake mirror keep branch

for my yocto project I'm mirroring to my repo to a private one, it's working fine for basic SRC_URI, but for url that have a branch defined it will erase it and bring the default one (master), making it fail since the branch referenced in the original uri was a tag.
DEBUG: Fetcher failure: Unable to find revision xxx_git_commit_hash_xxx in branch master even from upstream
In my .bb file:
SRC_URI = "git://github.com/google/protobuf.git;branch=3.11.x \
and in my local.conf (in the build folder) for the mirroring i have:
SOURCE_TOMYMIRROR="myUser#MyServerIdServer:/The/Path/to/directory"
PREMIRRORS_prepend ?= "\
git://.*/.* git://${SOURCE_TOMYMIRROR}/HOST/PATH;protocol=ssh\n \
"
(Yes i want to keep HOST and PATH as path to get the repo)
I can see in the logs that my repo is correctly fetch, but the "new" url is without branch and I can't find a way to keep the .bb one
I tried to understand and look at the documentation, but i don't see a way to keep a specific parameter (like the HOST and PATH variable)
So i tried to look at the init.py which define the rules, but i couldn't figure out if it's possible.
I think the right notation would be specifying the branch as well into the premirror URL.
SOURCE_MIRROR_URL = "git://${SOURCE_TOMYMIRROR};protocol=ssh;branch=3.11.x"
PREMIRRORS_prepend = " git://.*/.* ${SOURCE_MIRROR_URL} \
"
Yes it did work,i didn't need premirror_prepend, here's mine :
SOURCE_TOMYMIRROR="myUser#MyServerIdServer:/The/Path/to/directory"
SOURCE_MIRROR_URL="git://${SOURCE_TOMYMIRROR}/HOST/PATH;protocol=ssh"
INHERIT += "own-mirrors"
And if i want to add new url mirror i can use Mirror
MIRRORS += "\
git://.*/.* ${SOURCE_TOMYMIRROR_2}/HOST/PATH \n \
https?$://.*/.* ${SOURCE_TOMYMIRROR_2}/HOST/PATH \n \
"

How bitbake searches for recipe in build process?

I am trying to find out that how bitbake search for recipe in build process ?
For example,
I have a recipe something like below:
DESCRIPTION = "PetaLinux GSTREAMER supported packages"
inherit packagegroup
GSTREAMER_PACKAGES = " \
gstreamer1.0 \
gstreamer1.0-python \
gstreamer1.0-meta-base \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad \
gstreamer1.0-rtsp-server \
gst-shark \
gstd \
gst-perf \
gst-interpipes \
"
GSTREAMER_PACKAGES_append_zynqmp = " gstreamer1.0-omx"
RDEPENDS_${PN} = "${GSTREAMER_PACKAGES}"
When I searched gstreamer1.0 related recipe in yocto layers, I found two recipe, one of them is gstreamer1.0_1.16.1.bb in meta layer, and the other is gstreamer1.0_%.bbappend in meta-petalinux layer.
Both of these layers was added to the BBLAYERS in bblayers.conf file and the priorities that spesified with BBFILE_PRIORITY_* in related layer's layer.conf file is same.
So,
Which recipe will be used in build process in that case ?
What is the recipe lookup rules in yocto ?
I changed somethings to understand the behaviour:
For example,
I entered the invalid github URL that spesified in gstreamer1.0_%.bbappend recipe. When I tried to build the linux system, I encountered with an error. Thats fine.
Then I corrected the github URL in this recipe and entered invalid source code address that spesified in gstreamer1.0_1.16.1.bb recipe. When I tried to build linux system, process finished successfully.
Then I increased the priority of meta layer. I supposed to encounter with an error in this case but again build process finished successfully.
Could you please help me to understand this behaviour ?
Thanks.
You have two different files: a .bb and a .bbappend.
A .bb is the base recipe of one (or multiple) packages. It generally describe how to fetch, configure, compile, install files in a package for your target.
A .bbappend file is an 'append' file. It allows a meta (here meta-petalinux) to modify an existing recipe in another meta without copying it. A .bbappend can modify any steps of the bb file: source fetch, configure, compile, install...
You can for example create your own bbappend of Gstreamer, to enable pango (disbaled by default on my Yocto). The bbappend filename is gstreamer1.0-plugins-base_%.bbappend and only contains PACKAGECONFIG_append = "pango"
The Yocto Manual can give you more information on bbappend files here.

Yocto recipes not found

I'm learning Yocto and to try it I'm following a very detailed example.
When I try to build the image (qt5.image) it returns a couple of errors after parsing recipes:
$bitbake qt5-image
...
ERROR: No recipes available for:
/home/dev/yocto/poky/meta-raspberrypi/recipes-bsp/u-boot/u-boot_2019.07.bbappend
/home/dev/yocto/poky/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.16%.bbappend
The error is pretty clear, but because those meta- are not mine, but downloaded from the official repository git://git.yoctoproject.org/meta-raspberrypi I'm not sure why this error may happen.
Is there something I can fix by myself?
UPDATE:
Here the content of bblayer.conf I've adjusted the paths but it's the same file of the example linked above:
$ cat conf/bblayers.conf
# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
POKY_BBLAYERS_CONF_VERSION = "2"
BBPATH = "${TOPDIR}"
BBFILES ?= ""
BBLAYERS ?= " \
${HOME}/yocto/poky/meta \
${HOME}/yocto/poky/meta-poky \
${HOME}/yocto/poky/meta-openembedded/meta-oe \
${HOME}/yocto/poky/meta-openembedded/meta-multimedia \
${HOME}/yocto/poky/meta-openembedded/meta-networking \
${HOME}/yocto/poky/meta-openembedded/meta-perl \
${HOME}/yocto/poky/meta-openembedded/meta-python \
${HOME}/yocto/poky/meta-qt5 \
${HOME}/yocto/poky/meta-raspberrypi \
${HOME}/rpi/meta-rpi \
"
What the error message is telling you is that meta-raspberrypi layer is trying to modify recipes that it expects to exist in another layer. In this case the u-boot and gstreamer1.0-omx recipes come from "meta" (so the yocto/openembedded main layer).
You should check that your layers are all using the same branches (and are all up-to-date). I'm guessing that your meta layer (typically from poky git) is on some release branch and your meta-raspberrypi is using master. In that case the build would fail like yours does (e.g. gstreamer1.0-omx would be version 1.14.4 and the bbappend would look for another version).
I had the same issue, what I did is to checkout meta-raspberrypi with branch corresponding to the poky branch:
git clone -b warrior git://git.yoctoproject.org/poky
cd poky
git clone -b warrior git://git.yoctoproject.org/meta-raspberrypi
source oe-init-build-env
Add layer to conf/bblayers.conf
Change MACHINE in conf/local.conf
bitbake rpi-basic-image
Can you make sure 'meta-raspberrypi' is included in bblayers.conf file. You can check this layer included in
build-*/conf/bblayers.conf
If it is not included, add this layer into bbpath in bblayers.conf and rebuild it.
If it's still available could you please send the complete logs for the error?

bitbake failed with ExpansionError

Context:
I'm following the NXP i.MX7 Reference to build a Linux image for the i.MX 7 SABRE board. This process went smoothly, and I was successful in building and loading the krogoth image on the board. The problem arise when I tried to add the openembedded-core layer to my image. I immediately get the error below. I included my bblayers.conf for reference. Any help would be appreciated. I don't even need sqlite, so if there's a way to bypass it, then that would be fine.
Error:
ERROR: ExpansionError during parsing /fsl-community-bsp-platform/sources/openembedded-core/meta/recipes-support/sqlite/sqlite3_3.16.2.bb: Failure expanding variable SQLITE_PV, expression was ${#sqlite_download_version(d)} which triggered exception TypeError: getVar() takes at least 3 arguments (2 given)
bblayers.conf
POKY_BBLAYERS_CONF_VERSION = "2"
BBPATH = "${TOPDIR}"
BSPDIR := "${#os.path.abspath(os.path.dirname(d.getVar('FILE', True)) + '/../..')}"
BBFILES ?= ""
BBLAYERS = " \
${BSPDIR}/sources/poky/meta \
${BSPDIR}/sources/poky/meta-poky \
\
${BSPDIR}/sources/openembedded-core/meta \
\
${BSPDIR}/sources/meta-openembedded/meta-oe \
${BSPDIR}/sources/meta-openembedded/meta-multimedia \
\
${BSPDIR}/sources/meta-fsl-arm \
${BSPDIR}/sources/meta-fsl-arm-extra \
${BSPDIR}/sources/meta-fsl-demos \
"
The only difference between a successful build, and a failling build is the line: ${BSPDIR}/sources/openembedded-core/meta.
Don't add openembedded-core/meta to your bblayers.conf!
In your list, BBLAYERS =, the two entries
${BSPDIR}/sources/poky/meta \
${BSPDIR}/sources/openembedded-core/meta \
are both the same layer. meta in Poky, is taken directly from OpenEmbedded. The Poky repository is combined from multiple upstream repositoris using a script, combo-layer. (Which in my opinion is unfortunate, though I can see why it's being done).
If you wan't e.g. a newer version of meta, you need to update poky, or remove poky completely, and download openembedded-core and bitbake separately.
In my experience building BSP with yocto, specifically with NXP imx7, I have got ExpansionError very frequent. Most of the time, I found out that there is redundant package or layer or recipe in some cases. Once you remove them from installation, It works smooth.
In your case, Just remove following from the build and It should be fine.
${BSPDIR}/sources/openembedded-core/meta \

How can I change the installation path of an autotools-based Bitbake recipe?

I have an autotools-based BitBake recipe which I would like to have binaries installed in /usr/local/bin and libraries installed in /usr/local/lib (instead of /usr/bin and /usr/lib, which are the default target directories).
Here's a part of the autotools.bbclass file which I found important.
CONFIGUREOPTS = " --build=${BUILD_SYS} \
--host=${HOST_SYS} \
--target=${TARGET_SYS} \
--prefix=${prefix} \
--exec_prefix=${exec_prefix} \
--bindir=${bindir} \
--sbindir=${sbindir} \
--libexecdir=${libexecdir} \
--datadir=${datadir} \
--sysconfdir=${sysconfdir} \
--sharedstatedir=${sharedstatedir} \
--localstatedir=${localstatedir} \
--libdir=${libdir} \
...
I thought that the easiest way to accomplish what I wanted to do would be to simply change ${bindir} and ${libdir}, or perhaps change ${prefix} to /usr/local, but I haven't had any success in this area. Is there a way to change these installation variables, or am I thinking about this in the wrong way?
Update:
Strategy 1
As per Ross Burton's suggestion, I've tried adding the following to my recipe:
prefix="/usr/local"
exec_prefix="/usr/local"
but this causes the build to fail during that recipe's do_configure() task, and returns the following:
| checking for GLIB... no
| configure: error: Package requirements (glib-2.0 >= 2.12.3) were not met:
|
| No package 'glib-2.0' found
This package can be found during a normal build without these modified variables. I thought that adding the following line might allow the system to find the package metadata for glib:
PKG_CONFIG_PATH = " ${STAGING_DIR_HOST}/usr/lib/pkgconfig "
but this seems to have made no difference.
Strategy 2
I've also tried Ross Burton's other suggestion to add these variable assignments into my distribution's configuration file, but this causes it to fail during meta/recipes-extended/tzdata's do_install() task. It returns that DEFAULT_TIMEZONE is set to an invalid value. Here's the source of the error from tzdata_2015g.bb
# Install default timezone
if [ -e ${D}${datadir}/zoneinfo/${DEFAULT_TIMEZONE} ]; then
install -d ${D}${sysconfdir}
echo ${DEFAULT_TIMEZONE} > ${D}${sysconfdir}/timezone
ln -s ${datadir}/zoneinfo/${DEFAULT_TIMEZONE} ${D}${sysconfdir}/localtime
else
bberror "DEFAULT_TIMEZONE is set to an invalid value."
exit 1
fi
I'm assuming that I've got a problem with ${datadir}, which references ${prefix}.
Do you want to change paths for everything or just one recipe? Not sure why you'd want to change just one recipe to /usr/local, but whatever.
If you want to change all of them, then the simple way is to set prefix in your local.conf or distro configuration (prefix = "/usr/local").
If you want to do it in a particular recipe, then just assigning prefix="/usr/local" and exec_prefix="/usr/local" in the recipe will work.
These variables are defined in meta/conf/bitbake.conf, where you can see that bindir is $exec_prefix/bin, which is probably why assigning prefix didn't work for you.
Your first strategy was on the right track, but you were clobbering more than you wanted by changing only "prefix". If you look in sources/poky/meta/conf/bitbake.conf you'll find everything you are clobbering when you set the variable "prefix" to something other than "/usr" (like it was in my case). In order to modify only the install path with what would manually be the "--prefix" option to configure, I needed to set all the variables listed here in that recipe:
prefix="/your/install/path/here"
datadir="/usr/share"
sharedstatedir="/usr/com"
exec_prefix="/usr"