[yocto] Mercurial Fetcher and AUTOREV

roy_garrard at selinc.com roy_garrard at selinc.com
Thu Jun 16 14:27:28 PDT 2016


I'm trying to get a bitbake file to pull down the latest revision of a 
mercurial repo when it builds. It's unfortunately undocumented (
https://www.yoctoproject.org/docs/1.6/bitbake-user-manual/bitbake-user-manual.html#auto-revisions
), though there are a few mailing list posts on the topic. None of my 
attempts to recreate their methods have panned out.

This is what the .bb file looks like:

###############################################################################
# Variables for locations.
###############################################################################
SRC_URI = "hg://selhg//hg/products/test;rev=${SRCREV}
;protocol=ssh;branch=default;module=root"
SRCREV = "${AUTOREV}"

# Sources are downloaded to an hg subdirectory when pulling a repo.
S = "${WORKDIR}/hg"

###############################################################################
# The version of the library we're going to install.
###############################################################################
# Set PV to SRCPV so bitbake knows it should always check SRC_URI for a 
new
# version of the application.
PV = "${SRCPV}"
PR = "r0"
PE = "1"


And here's the relevant part of the output error:


/usr/bin/env hg up -C -r AUTOINC
| DEBUG: Python function base_do_unpack finished
| DEBUG: Python function do_unpack finished
| ERROR: Function failed: Fetcher failure: Fetch command failed with exit 
code 255, output:
| abort: unknown revision 'AUTOINC'!
| 
NOTE: recipe test-1_AUTOINC+AUTOINC-r0: task do_unpack: Failed
DEBUG: Teardown for bitbake-worker
NOTE: Tasks Summary: Attempted 361 tasks of which 359 didn't need to be 
rerun and 1 failed.

Summary: 1 task failed:
  /home/roygarr/git/poky/meta/recipes-core/test/test_0.0.1.bb, do_unpack
Summary: There was 1 ERROR message shown, returning a non-zero exit code.


The problem seems to be that AUTOREV is resolving to AUTOINC instead of a 
hash number. There are a few mumblings across the forums that this has to 
do with the PV and SRCREV variables, but I haven't been able to connect 
the dots.

I have had some success in recreating this with the Git fetcher. The .bb 
file is almost identical, but something about it works out in a more 
positive way. My money's on the "rev=" argument that the hg fetcher needs 
but the git fetcher doesn't.

###############################################################################
# Variables for locations.
###############################################################################
SRC_URI = 
"git://lpul-hg.ad.selinc.com/git/repos/products/test;protocol=ssh;branch=master"
SRCREV = "${AUTOREV}"

# Sources are downloaded to a git subdirectory when pulling a repo.
S = "${WORKDIR}/git"

###############################################################################
# The version of the library we're going to install.
###############################################################################
# Set PV to SRCPV so bitbake knows it should always check SRC_URI for a 
new
# version of the application.
PV = "${SRCPV}"
PR = "r0"
PE = "1"

...

DEBUG: Executing task do_clean
NOTE: recipe test-1_AUTOINC+1072c0d5c6-r0: task do_clean: Started
NOTE: recipe test-1_AUTOINC+1072c0d5c6-r0: task do_clean: Succeeded


Any insight you can offer would be appreciated.

- Roy, Intern at SEL

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20160616/2e997ab0/attachment.html>


More information about the yocto mailing list