Bug 1128

Summary: Meaningless error message when python v3 is the only python available
Product: [Build System, Metadata & Runtime] Meta-yocto Reporter: Scott Garman <scott.a.garman>
Component: meta-yoctoAssignee: Scott Garman <scott.a.garman>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: Medium CC: josh, poky.bs.watcher, poky.watcher, sgw
Version: 1.0   
Target Milestone: 1.1 M2   
Hardware: x86   
OS: Multiple   
Whiteboard: 2011-06-14: Patch submitted to poky ML
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Scott Garman 2011-05-31 14:32:25 UTC
Mark Charlebois reported the following:

Using Poky from Arch Linux (read that Arch is not supported, but that comments on how well it works are welcome)

 

Had to install sudo

Found docs for Arch Linux and OE: http://wiki.openembedded.net/index.php/OEandYourDistro#Arch_Linux_.28Duke.29

Installed packages:

 

   pacman -S patch make sed python m4 bison cvs quilt sgmltools-lite docbook-xml \

   xmlto pcre boost jade git texinfo texi2html help2man subversion chrpath

 

quilt is not in the Arch packages. Had to be built from AUR

 

$ bitbake poky-image-sato

Pseudo is not present but is required, building this first before the main build

  File "/shared/yocto/poky-bernard-5.0/bitbake/bin/bitbake", line 35

    except RuntimeError, exc:

                       ^

SyntaxError: invalid syntax

This error message does not indicate that the problem was due to missing quilt. So a sanity check could be added for this.
Comment 1 Joshua Lock - Disabled 2011-06-01 09:48:55 UTC
The exception raised by quilt being missing is invalid syntax in Python.

try:
  stuff
except MyError as e:
  print(e)

is the correct syntax for exception handling, so the error is correct though still not useful.
Comment 2 Joshua Lock - Disabled 2011-06-01 09:49:56 UTC
As an aside re the support of Arch, iirc the use Python 3 by default.
Comment 3 Scott Garman 2011-06-13 14:46:38 UTC
Ok, so this bug doesn't have to do with quilt after all - we build quilt as quilt-native, and I don't have a host version installed on any of my build machines. 

I've tested that pointing bitbake to a python v3 interpreter will result in the same error Mark ran into, and that is what we need to add a check for. We've checked for old versions of python, but not v3-only ones.
Comment 4 Scott Garman 2011-06-14 15:03:41 UTC
Progress update:

This is not as simple as adding a python version check in sanity.bbclass, because the v3 python interpreter cannot even parse all of the bitbake code. I'm diving through various layers of making bitbake work on python v2 and at least superficially parse on v3 so it can get to the point of running the sanity test.
Comment 5 Joshua Lock - Disabled 2011-06-14 15:20:01 UTC
A hackier alternative here might be to do a python v3 test in the bitbake wrapper script?
Comment 6 Scott Garman 2011-06-14 15:31:31 UTC
Thanks for the suggestion, Joshua. It looks like that is the only feasible way to fix this. The impasse I've reached is that module importing from within your own package has changed, and the new syntax of specifying things is not backward-compatible. So it does not appear that I can pull this off in such a way that both v2 and v3 versions of python will work - even just to get the code to pass the parsing stage.