Bug 1128 - Meaningless error message when python v3 is the only python available
Summary: Meaningless error message when python v3 is the only python available
Status: RESOLVED FIXED
Alias: None
Product: Meta-yocto
Classification: Build System, Metadata & Runtime
Component: meta-yocto (show other bugs)
Version: 1.0
Hardware: x86 Multiple
: Medium enhancement
Target Milestone: 1.1 M2
Assignee: Scott Garman
QA Contact:
URL:
Whiteboard: 2011-06-14: Patch submitted to poky ML
Depends on:
Blocks:
 
Reported: 2011-05-31 14:32 UTC by Scott Garman
Modified: 2011-06-28 09:48 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.