0

Not sure is this is the right place to ask this:

I've been struggling with trying to create a recipe to compile python-cffi for the dora branch of bitbake and have had no luck yet. There seems to be several recipes out there but non work for me. Apparently the source code gz file is in a weird state and is not fetchable through the normal do_fetch command in bitbake.

When using these bitbake recipes as starting points:

python-cffi_1.11.0.bb

and

python-cffi_1.11.0.inc

I modified the code to create a new recipe called python-cffi_1.11.2.bb, then the standard do_fetch doesn't not understand how to handle the downloaded gz file.

This is the bitbake recipe I'm using (named python-cffi_1.11.2.bb)


SUMMARY = "Foreign Function Interface for Python calling C code"
# This is the format of the actual URI
SRC_URI = "https://pypi.python.org/packages/c9/70/89b68b6600d479034276fed316e14b9107d50a62f5627da37fafe083fde3/cffi-1.11.2.tar.gz#md5=a731487324b501c8295221b629d3f5f3"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=5677e2fdbf7cdda61d6dd2b57df547bf"
DEPENDS += "libffi python-pycparser"
SRC_URI[md5sum] = "a731487324b501c8295221b629d3f5f3"
RDEPENDS_${PN}_class-target = "python-io "
BBCLASSEXTEND = "native nativesdk"
inherit pypi setuptools

And I get this set of error messages in build/tmp/work/armv7a-vfp-neon-poky-linux-gnueabi/python-cffi/1.11.2-r0/temp/log.do_fetch

Apparently the fetcher gets the file downloaded correctly but then doesn't know what to do with it. The build/downloads directory has the file cffi-1.11.2.tar.gz!

...
DEBUG: Trying Upstream
NOTE: fetch https://pypi.python.org/packages/c9/70/89b68b6600d479034276fed316e14b9107d50a62f5627da37fafe083fde3/cffi-1.11.2.tar.gz#md5=a731487324b501c8295221b629d3f5f3
DEBUG: executing /usr/bin/env wget -t 2 -T 30 -nv --passive-ftp --no-check-certificate -P /home/pjm/yocto-iscan/poky/build/downloads 'https://pypi.python.org/packages/c9/70/89b68b6600d479034276fed316e14b9107d50a62f5627da37fafe083fde3/cffi-1.11.2.tar.gz#md5=a731487324b501c8295221b629d3f5f3'
DEBUG: Fetcher accessed the network with the command /usr/bin/env wget -t 2 -T 30 -nv --passive-ftp --no-check-certificate -P /home/pjm/yocto-iscan/poky/build/downloads 'https://pypi.python.org/packages/c9/70/89b68b6600d479034276fed316e14b9107d50a62f5627da37fafe083fde3/cffi-1.11.2.tar.gz#md5=a731487324b501c8295221b629d3f5f3'
DEBUG: Running export SSH_AUTH_SOCK="/run/user/1000/keyring-1bn6Fg/ssh"; export PATH="/home/pjm/yocto-iscan/poky/build/tmp/sysroots/x86_64-linux/usr/bin/python-native:/home/pjm/yocto-iscan/poky/scripts:/home/pjm/yocto-iscan/poky/build/tmp/sysroots/x86_64-linux/usr/bin/armv7a-vfp-neon-poky-linux-gnueabi:/home/pjm/yocto-iscan/poky/build/tmp/sysroots/omap3logic/usr/bin/crossscripts:/home/pjm/yocto-iscan/poky/build/tmp/sysroots/x86_64-linux/usr/sbin:/home/pjm/yocto-iscan/poky/build/tmp/sysroots/x86_64-linux/usr/bin:/home/pjm/yocto-iscan/poky/build/tmp/sysroots/x86_64-linux/sbin:/home/pjm/yocto-iscan/poky/build/tmp/sysroots/x86_64-linux//bin:/home/pjm/yocto-iscan/poky/scripts:/home/pjm/yocto-iscan/poky/bitbake/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"; export HOME="/home/pjm"; /usr/bin/env wget -t 2 -T 30 -nv --passive-ftp --no-check-certificate -P /home/pjm/yocto-iscan/poky/build/downloads 'https://pypi.python.org/packages/c9/70/89b68b6600d479034276fed316e14b9107d50a62f5627da37fafe083fde3/cffi-1.11.2.tar.gz#md5=a731487324b501c8295221b629d3f5f3'
WARNING: Failed to fetch URL https://pypi.python.org/packages/c9/70/89b68b6600d479034276fed316e14b9107d50a62f5627da37fafe083fde3/cffi-1.11.2.tar.gz#md5=a731487324b501c8295221b629d3f5f3, attempting MIRRORS if available
DEBUG: Fetcher failure for URL: 'https://pypi.python.org/packages/c9/70/89b68b6600d479034276fed316e14b9107d50a62f5627da37fafe083fde3/cffi-1.11.2.tar.gz#md5=a731487324b501c8295221b629d3f5f3'. The fetch command returned success for url https://pypi.python.org/packages/c9/70/89b68b6600d479034276fed316e14b9107d50a62f5627da37fafe083fde3/cffi-1.11.2.tar.gz#md5=a731487324b501c8295221b629d3f5f3 but /home/pjm/yocto-iscan/poky/build/downloads/cffi-1.11.2.tar.gz#md5=a731487324b501c8295221b629d3f5f3 doesn't exist?!
DEBUG: Trying MIRRORS
...

What should I change in the bitbake recipe so that the do_fetch can extract the file correctly? I assume there is some post fetch step that needs to specify that the real file is called cffi-1.11.2.tar.gz and not the file with the md5 hash hanging on the end. It seems to be looking for cffi-1.11.2.tar.gz#md5=a731487324b501c8295221b629d3f5f3 instead of cffi-1.11.2.tar.gz

P Moran
  • 1,624
  • 3
  • 18
  • 32
  • Maybe try with the url (SRC_URI) stopping before the ``#md5``? – Armin Rigo Oct 09 '17 at 20:59
  • Thanks for the reply ... Ive tried every combination I can think of. SRC_URI = "https://pypi.python.org/packages/cffi-1.11.1.tar.gz" SRC_URI = "https://pypi.python.org/pypi/cffi/1.11.1/cffi-1.11.1.tar.gz" SRC_URI = "https://pypi.python.org/packages/70/72/c825b14b212fe61791c88e09cca65b26ea0b5e7ef6a4a2f979d338fbe38d/cffi-1.11.1.tar.gz;md5sum=89dfa1bb3b3e28eafb5da3e345a19f56" SRC_URI = "http://pypi.pediapress.com/packages/mirror/cffi-1.11.1.tar.gz" SRC_URI = "file://python-cffi-1.11.1.tar.gz" – P Moran Oct 10 '17 at 01:46
  • ``SRC_URI = "https://pypi.python.org/packages/c9/70/89b68b6600d479034276fed316e14b9107d50a62f5627da37fafe083fde3/cffi-1.11.2.tar.gz"`` – Armin Rigo Oct 10 '17 at 06:33

1 Answers1

0

I think I found an answer to this issue.

It seems like the bitbake code is looking upstream for python-cffi_1.11.2 source files and never gets to the SRC_URI in the actual recipe!

Is this a bug?

If I rename the recipe cffi_1.11.2.bb it works fine.

P Moran
  • 1,624
  • 3
  • 18
  • 32