Problem using Subversion in Pyro
I have a recipe that fetches code from an SVN repository and uses ${SRCPV} to obtain its version number. This works fine under Morty but the recipe crashes out with an error under Pyro because it can't find the SVN executable.
Eventually I traced this down to the fact that SVN is missing from the list of host apps defined in HOSTTOOLS in bitbake.conf. If I add an assignment in local.conf to append svn to HOSTTOOLS all is well again.
I think that this is almost certainly a bug but I thought I'd raise the question here just in case it's really me doing something wrong. ALAN LEVY
Lead Consultant, Embedded Systems
Tel > +44 (0) 1799 533200
Email > [email protected]
[http://www.plextek.com/wp-content/uploads/Footer-AlanLevy.jpg]<http://www.plextek.com/technicalpaper/an-introduction-to-yocto/>
[http://www.plextek.com/wp-content/uploads/2016/04/Plextek-LOGO-for-email.jpg]<http://www.plextek.com/>
www.plextek.com<http://www.plextek.com/>
The Plextek Building, London Road, Great Chesterford, Saffron Walden, CB10 1NY, UK
Plextek is the trading name of Plextek Services Ltd. Registered in England and Wales, no. 09826669
Quoted 7 lines · Alan Levy
I have a recipe that fetches code from an SVN repository and uses ${SRCPV} to obtain its version number. This works fine under Morty but the recipe crashes out with an error under Pyro because it can’t find the SVN executable.
Quoted 8 lines
Eventually I traced this down to the fact that SVN is missing from the list of host apps defined in HOSTTOOLS in bitbake.conf. If I add an assignment in local.conf to append svn to HOSTTOOLS all is well again.
I think that this is almost certainly a bug but I thought I’d raise the question here just in case it’s really me doing something wrong.
There is a subversion recipe in oe-core, and it should be built (in the native variant) specifically for this purpose (base.bbclass):
# Svn packages should DEPEND on subversion-native if scheme == "svn":
needsrcrev = True d.appendVarFlag('do_fetch', 'depends', '
subversion-native:do_populate_sysroot')
BUT... we no longer have recipes in oe-core that fetch from svn:// so it does not get tested, and may well have regressed.
Can you check if it does get build, and whether the subversion binary gets installed into your recipe's sysroot?
Alex
Quoted 5 lines · Alan Levy
Eventually I traced this down to the fact that SVN is missing from the list of host apps defined in HOSTTOOLS in bitbake.conf. If I add an assignment in local.conf to append svn to HOSTTOOLS all is well again.
As Alex says we typically use subversion-native as we can't rely on the host subversion being new enough for some features we need.
Does your recipe fetch using svn:// in SRC_URI? If so then it should have svn in the sysroot already. A minimal example would be useful.
Ross
It does get built, and it apparently does get used to do the actual fetching, just not for miscellaneous functions such as populating SRCREV which rely on the svn executable being on the PATH. This appears to be deliberate since there is a FETCHCMD_svn variable in bitbake.conf. The simplest way for me to force an svn executable onto PATH was to add it to HOSTTOOLS but that may not be what is really intended.
ALAN LEVY, Lead Consultant, Embedded Systems
Plextek Consulting, The Plextek Building, London Road, Great Chesterford, Saffron Walden, CB10 1NY, UK
T: +44 (0) 1799 533200 E: [email protected] W: www.plextek.com
-----Original Message-----
From: Alexander Kanavin [mailto:[email protected]]
Sent: 18 May 2017 13:41
To: [email protected]; Alan Levy
Subject: Re: [yocto] Problem using Subversion in Pyro
Quoted 7 lines · Alan Levy
I have a recipe that fetches code from an SVN repository and uses ${SRCPV} to obtain its version number. This works fine under Morty but the recipe crashes out with an error under Pyro because it can't find the SVN executable.
Quoted 8 lines
Eventually I traced this down to the fact that SVN is missing from the list of host apps defined in HOSTTOOLS in bitbake.conf. If I add an assignment in local.conf to append svn to HOSTTOOLS all is well again.
I think that this is almost certainly a bug but I thought I'd raise the question here just in case it's really me doing something wrong.
There is a subversion recipe in oe-core, and it should be built (in the native variant) specifically for this purpose (base.bbclass):
# Svn packages should DEPEND on subversion-native if scheme == "svn":
needsrcrev = True d.appendVarFlag('do_fetch', 'depends', '
subversion-native:do_populate_sysroot')
BUT... we no longer have recipes in oe-core that fetch from svn:// so it does not get tested, and may well have regressed.
Can you check if it does get build, and whether the subversion binary gets installed into your recipe's sysroot?
Alex
Quoted 7 lines · Alan Levy
It does get built, and it apparently does get used to do the actual fetching, just not for miscellaneous functions such as populating SRCREV which rely on the svn executable being on the PATH. This appears to be deliberate since there is a
FETCHCMD_svnvariable in bitbake.conf. The simplest way for me to force an svn executable onto PATH was to add it to HOSTTOOLS but that may not be what is really intended.
SRCREV is supposed to be hardcoded in the recipe. What is the reason you need to use svn to set it? Can you show how it's specifically done in your recipe?
Alex
I want to assign SRCREV to PV, which is perfectly legitimate, so that I can capture the SVN revision number used to build the code. Here's a simple recipe which exhibits the problem:
DESCRIPTION = "Recipe to test SVN"PACKAGE_ARCH = "${MACHINE_ARCH}"
LICENSE = "CLOSED"
PV = "${SRCPV}"
SRCREV = "${AUTOREV}"SRC_URI = "svn://server/path;module=my_module"
If you comment out the line referring to SRCPV all is well, if you include it bitbake blows up, even if I just perform cleansstate.
ALAN LEVY, Lead Consultant, Embedded Systems
Plextek Consulting, The Plextek Building, London Road, Great Chesterford, Saffron Walden, CB10 1NY, UK
T: +44 (0) 1799 533200 E: [email protected] W: www.plextek.com
-----Original Message-----
From: Alexander Kanavin [mailto:[email protected]]
Sent: 18 May 2017 14:14
To: Alan Levy; [email protected]
Subject: Re: [yocto] Problem using Subversion in Pyro
Quoted 7 lines · Alan Levy
It does get built, and it apparently does get used to do the actual fetching, just not for miscellaneous functions such as populating SRCREV which rely on the svn executable being on the PATH. This appears to be deliberate since there is a
FETCHCMD_svnvariable in bitbake.conf. The simplest way for me to force an svn executable onto PATH was to add it to HOSTTOOLS but that may not be what is really intended.
SRCREV is supposed to be hardcoded in the recipe. What is the reason you need to use svn to set it? Can you show how it's specifically done in your recipe?
Alex
Just noticed the typo on my part - it's SRCPV that causes the problem, not SRCREV. Apologies for the confusion; a maze of twisty little variables, all alike
ALAN LEVY, Lead Consultant, Embedded Systems
Plextek Consulting, The Plextek Building, London Road, Great Chesterford, Saffron Walden, CB10 1NY, UK
T: +44 (0) 1799 533200 E: [email protected] W: www.plextek.com
-----Original Message-----
From: Alan Levy
Sent: 18 May 2017 14:32
To: 'Alexander Kanavin'; [email protected]
Subject: RE: [yocto] Problem using Subversion in Pyro
I want to assign SRCREV to PV, which is perfectly legitimate, so that I can capture the SVN revision number used to build the code. Here's a simple recipe which exhibits the problem:
DESCRIPTION = "Recipe to test SVN"PACKAGE_ARCH = "${MACHINE_ARCH}"
LICENSE = "CLOSED"
PV = "${SRCPV}"
SRCREV = "${AUTOREV}"SRC_URI = "svn://server/path;module=my_module"
If you comment out the line referring to SRCPV all is well, if you include it bitbake blows up, even if I just perform cleansstate.
ALAN LEVY, Lead Consultant, Embedded Systems
Plextek Consulting, The Plextek Building, London Road, Great Chesterford, Saffron Walden, CB10 1NY, UK
T: +44 (0) 1799 533200 E: [email protected] W: www.plextek.com
-----Original Message-----
From: Alexander Kanavin [mailto:[email protected]]
Sent: 18 May 2017 14:14
To: Alan Levy; [email protected]
Subject: Re: [yocto] Problem using Subversion in Pyro
Quoted 7 lines · Alan Levy
It does get built, and it apparently does get used to do the actual fetching, just not for miscellaneous functions such as populating SRCREV which rely on the svn executable being on the PATH. This appears to be deliberate since there is a
FETCHCMD_svnvariable in bitbake.conf. The simplest way for me to force an svn executable onto PATH was to add it to HOSTTOOLS but that may not be what is really intended.
SRCREV is supposed to be hardcoded in the recipe. What is the reason you need to use svn to set it? Can you show how it's specifically done in your recipe?
Alex
Quoted 1 line · Alan Levy
Just noticed the typo on my part - it's SRCPV that causes the problem, not SRCREV. Apologies for the confusion; a maze of twisty little variables, all alike
So how does it blow up? Can I see the python traceback?
You can also write a minimal recipe with a public svn repo; I can try to help, but I'd like you to provide a reproducible example :)
Alex
Here it is, certain names have been changed to protect the guilty. As you can see at the bottom svn isn't on the path, so bitbake blows up when it tries to evaluate SRCPV:
ERROR: ExpansionError during parsing <path>/my_recipe.bb | ETA: 0:00:01
Traceback (most recent call last):
bb.data_smart.ExpansionError: Failure expanding variable SRCPV, expression was ${@bb.fetch2.get_srcrev(d)} which triggered exception FetchError: Fetcher failure: Fetch command export DBUS_SESSION_BUS_ADDRESS="unix:abstract=/tmp/dbus-ykmscGFFM1"; export SSH_AUTH_SOCK="/run/user/1000/keyring/ssh"; export PATH="/home/user/project/yocto/build/tmp/sysroots-uninative/x86_64-linux/usr/bin:/home/user/project/yocto/poky/scripts:/home/user/project/yocto/build/tmp/work/picozed_zynq7-poky-linux-gnueabi/my-recipe/fetcheravoidrecurse-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi:/home/user/project/yocto/build/tmp/work/picozed_zynq7-poky-linux-gnueabi/my-recipe/fetcheravoidrecurse-r0/recipe-sysroot/usr/bin/crossscripts:/home/user/project/yocto/build/tmp/work/picozed_zynq7-poky-linux-gnueabi/my-recipe/fetcheravoidrecurse-r0/recipe-sysroot-native/usr/sbin:/home/user/project/yocto/build/tmp/work/picozed_zynq7-poky-linux-gnueabi/my-recipe/fetcheravoidrecurse-r0/recipe-sysroot-native/usr/bin:/home/user/project/yocto/build/tmp/work/picozed_zynq7-poky-linux-gnueabi/my-recipe/fetcheravoidrecurse-r0/recipe-sysroot-native/sbin:/home/user/project/yocto/build/tmp/work/picozed_zynq7-poky-linux-gnueabi/my-recipe/fetcheravoidrecurse-r0/recipe-sysroot-native/bin:/home/user/project/yocto/poky/bitbake/bin:/home/user/project/yocto/build/tmp/hosttools"; export HOME="/home/user"; LANG=C LC_ALL=C /usr/bin/env svn --non-interactive --trust-server-cert log --limit 1 --no-auth-cache ! http://server/path/my_module/ failed with exit code 127, output:/usr/bin/env: 'svn': No such file or directory
ALAN LEVY, Lead Consultant, Embedded Systems
Plextek Consulting, The Plextek Building, London Road, Great Chesterford, Saffron Walden, CB10 1NY, UK
T: +44 (0) 1799 533200 E: [email protected] W: www.plextek.com
-----Original Message-----
From: Alexander Kanavin [mailto:[email protected]]
Sent: 18 May 2017 14:48
To: Alan Levy; [email protected]
Subject: Re: [yocto] Problem using Subversion in Pyro
Quoted 3 lines · Alan Levy
Just noticed the typo on my part - it's SRCPV that causes the problem, not SRCREV. Apologies for the confusion; a maze of twisty little variables, all alike
So how does it blow up? Can I see the python traceback?
You can also write a minimal recipe with a public svn repo; I can try to help, but I'd like you to provide a reproducible example :)
Alex
Quoted 4 lines · Alan Levy
Here it is, certain names have been changed to protect the guilty. As you can see at the bottom svn isn't on the path, so bitbake blows up when it tries to evaluate SRCPV:
Quoted 13 lines
ERROR: ExpansionError during parsing <path>/my_recipe.bb
| ETA: 0:00:01 Traceback (most recent call last):
bb.data_smart.ExpansionError: Failure expanding variable SRCPV,
expression was ${@bb.fetch2.get_srcrev(d)} which triggered exception
FetchError: Fetcher failure: Fetch command export
DBUS_SESSION_BUS_ADDRESS="unix:abstract=/tmp/dbus-ykmscGFFM1"; export
SSH_AUTH_SOCK="/run/user/1000/keyring/ssh"; export PATH="/home/user/project/yocto/build/tmp/sysroots-uninative/x86_64-linux/usr/bin:/home/user/project/yocto/poky/scripts:/home/user/project/yocto/build/tmp/work/picozed_zynq7-poky-linux-gnueabi/my-recipe/fetcheravoidrecurse-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi:/home/user/project/yocto/build/tmp/work/picozed_zynq7-poky-linux-gnueabi/my-recipe/fetcheravoidrecurse-r0/recipe-sysroot/usr/bin/crossscripts:/home/user/project/yocto/build/tmp/work/picozed_zynq7-poky-linux-gnueabi/my-recipe/fetcheravoidrecurse-r0/recipe-sysroot-native/usr/sbin:/home/user/project/yocto/build/tmp/work/picozed_zynq7-poky-linux-gnueabi/my-recipe/fetcheravoidrecurse-r0/recipe-sysroot-native/usr/bin:/home/user/project/yocto/build/tmp/work/picozed_zynq7-poky-linux-gnueabi/my-recipe/fetcheravoidrecurse-r0/recipe-sysroot-native/sbin:/home/user/project/yocto/build/tmp/work/picozed_zynq7-poky-linux-gnueabi/my-recipe/fetcheravoidrecurse-r0/recipe-sysroot-native/bin:/home/user/project/yocto/poky/bitbake/bin:/home/user/project/yocto/build/tmp/hosttools"; export HOME="/home/user"; LANG=C LC_ALL=C/usr/bin/envsvn
--non-interactive --trust-server-cert log --limit 1 --no-auth-cache !
http://server/path/my_module/ failed with exit code 127, output:/usr/bin/env: 'svn': No such file or directory
Right. This seems to happen way before the fetch task and so does require host svn, I guess you'll need to take it to bitbake mailing list. It works for git because we are using host's git for the same purpose.
Alex
OK, done that now. Thanks for your assistance
Alan
ALAN LEVY, Lead Consultant, Embedded Systems
Plextek Consulting, The Plextek Building, London Road, Great Chesterford, Saffron Walden, CB10 1NY, UK
T: +44 (0) 1799 533200 E: [email protected] W: www.plextek.com
-----Original Message-----
From: Alexander Kanavin [mailto:[email protected]]
Sent: 18 May 2017 15:12
To: Alan Levy; [email protected]
Subject: Re: [yocto] Problem using Subversion in Pyro
Quoted 22 lines · Alan Levy
Here it is, certain names have been changed to protect the guilty. As you can see at the bottom svn isn't on the path, so bitbake blows up when it tries to evaluate SRCPV:
ERROR: ExpansionError during parsing <path>/my_recipe.bb
| ETA: 0:00:01 Traceback (most recent call last):
bb.data_smart.ExpansionError: Failure expanding variable SRCPV, expression was ${@bb.fetch2.get_srcrev(d)} which triggered exception
FetchError: Fetcher failure: Fetch command export DBUS_SESSION_BUS_ADDRESS="unix:abstract=/tmp/dbus-ykmscGFFM1"; export SSH_AUTH_SOCK="/run/user/1000/keyring/ssh"; export PATH="/home/user/project/yocto/build/tmp/sysroots-uninative/x86_64-lin ux/usr/bin:/home/user/project/yocto/poky/scripts:/home/user/project/yo cto/build/tmp/work/picozed_zynq7-poky-linux-gnueabi/my-recipe/fetchera voidrecurse-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi:/h ome/user/project/yocto/build/tmp/work/picozed_zynq7-poky-linux-gnueabi /my-recipe/fetcheravoidrecurse-r0/recipe-sysroot/usr/bin/crossscripts:/home/user/project/yocto/build/tmp/work/picozed_zynq7-poky-linux-gnueabi/my-recipe/fetcheravoidrecurse-r0/recipe-sysroot-native/usr/sbin:/ho me/user/project/yocto/build/tmp/work/picozed_zynq7-poky-linux-gnueabi/ my-recipe/fetcheravoidrecurse-r0/recipe-sysroot-native/usr/bin:/home/u ser/project/yocto/build/tmp/work/picozed_zynq7-poky-linux-gnueabi/my-r
Quoted 9 lines
ecipe/fetcheravoidrecurse-r0/recipe-sysroot-native/sbin:/home/user/pro ject/yocto/build/tmp/work/picozed_zynq7-poky-linux-gnueabi/my-recipe/f etcheravoidrecurse-r0/recipe-sysroot-native/bin:/home/user/project/yoc to/poky/bitbake/bin:/home/user/project/yocto/build/tmp/hosttools"; export HOME="/home/user"; LANG=C LC_ALL=C
/usr/bin/envsvn --non-interactive --trust-server-cert log --limit 1 --no-auth-cache !
http://server/path/my_module/ failed with exit code 127, output:/usr/bin/env: 'svn': No such file or directory
Right. This seems to happen way before the fetch task and so does require host svn, I guess you'll need to take it to bitbake mailing list. It works for git because we are using host's git for the same purpose.
Alex