Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 485452

Summary: app-forensics/openscap-0.9.12 - checking for headers required to compile python extensions... -/ /- print sys.prefix -/ /- SyntaxError: invalid syntax
Product: Gentoo Linux Reporter: Willard Dawson <wfdawson>
Component: Current packagesAssignee: LABBE Corentin <clabbe.montjoie>
Status: RESOLVED FIXED    
Severity: normal CC: proxy-maint, swift
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: emerge --info
build log
emerge -pqv
build environment
build log
emerge --info
emerge -pqv
build environment

Description Willard Dawson 2013-09-19 23:15:28 UTC
Created attachment 359062 [details]
emerge --info

emerge -uDN world
from app-forensics/openscap-0.9.8
fails as described in Summary.
Comment 1 Willard Dawson 2013-09-19 23:16:10 UTC
Created attachment 359064 [details]
build log
Comment 2 Willard Dawson 2013-09-19 23:16:47 UTC
Created attachment 359066 [details]
emerge -pqv
Comment 3 Willard Dawson 2013-09-19 23:17:21 UTC
Created attachment 359068 [details]
build environment
Comment 4 Markos Chandras (RETIRED) gentoo-dev 2013-12-20 19:59:15 UTC
Corentin ping?
Comment 5 LABBE Corentin 2013-12-23 09:19:05 UTC
The problem was detected by the configure:
checking for headers required to compile python extensions...   File "<string>", line 1
    import sys; print sys.prefix
                        ^
SyntaxError: invalid syntax
  File "<string>", line 1
    import sys; print sys.exec_prefix
                        ^
SyntaxError: invalid syntax
not found

Does this still happen with recent version of openscap ?
Comment 6 Willard Dawson 2013-12-23 16:44:36 UTC
(In reply to clabbe.montjoie from comment #5)
> The problem was detected by the configure:
> checking for headers required to compile python extensions...   File
> "<string>", line 1
>     import sys; print sys.prefix
>                         ^
> SyntaxError: invalid syntax
>   File "<string>", line 1
>     import sys; print sys.exec_prefix
>                         ^
> SyntaxError: invalid syntax
> not found
> 
> Does this still happen with recent version of openscap ?

This issue was opened against what was and still is the most recent version,  app-forensics/openscap-0.9.12.  Updating the file attachments with the most recent attempt.
Comment 7 Willard Dawson 2013-12-23 16:45:33 UTC
Created attachment 366002 [details]
build log
Comment 8 Willard Dawson 2013-12-23 16:46:04 UTC
Created attachment 366004 [details]
emerge --info
Comment 9 Willard Dawson 2013-12-23 16:46:21 UTC
Created attachment 366006 [details]
emerge -pqv
Comment 10 Willard Dawson 2013-12-23 16:46:42 UTC
Created attachment 366008 [details]
build environment
Comment 11 Sven Vermeulen (RETIRED) gentoo-dev 2013-12-23 17:24:45 UTC
Do you have multiple Pythons installed?

If so, care to switch to Python 2.<something>? The syntax shown is not valid for Python 3, so we might need to mark it for Python-2 only (or fix it ourselves, but that might be a *very* *deep* rabbithole ;)
Comment 12 Willard Dawson 2013-12-23 18:59:51 UTC
(In reply to Sven Vermeulen from comment #11)
> Do you have multiple Pythons installed?
> 
> If so, care to switch to Python 2.<something>? The syntax shown is not valid
> for Python 3, so we might need to mark it for Python-2 only (or fix it
> ourselves, but that might be a *very* *deep* rabbithole ;)

Switching to python2.7 from my current default of python3.3 did the trick.  As that is apparently a strict dependency, openscap should require it, or look for an installed instance of 2.7 and actually use it, don't you think?  Relying on system default when python 2.7 is readily available seems, well, unreliable.
Comment 13 Sven Vermeulen (RETIRED) gentoo-dev 2013-12-23 20:05:08 UTC
True. The ebuilds already mention this, but it hasn't been implemented further in the src_* functions I guess...

"""
PYTHON_DEPEND="2"
PYTHON_COMPAT=( python{2_5,2_6,2_7} )
"""
Comment 14 Sven Vermeulen (RETIRED) gentoo-dev 2013-12-23 20:54:57 UTC
Seems like adding "python_setup" at the beginning of the src_configure() phase does the trick. If anyone else can confirm this, I'll gladly commit it.
Comment 15 Willard Dawson 2013-12-23 22:44:19 UTC
(In reply to Sven Vermeulen from comment #14)
> Seems like adding "python_setup" at the beginning of the src_configure()
> phase does the trick. If anyone else can confirm this, I'll gladly commit it.

Works for me.  `emerge app-forensics/openscap` with python3.3 set as system default completed successfully.
Comment 16 Willard Dawson 2013-12-24 17:25:26 UTC
(In reply to Willard Dawson from comment #15)
> (In reply to Sven Vermeulen from comment #14)
> > Seems like adding "python_setup" at the beginning of the src_configure()
> > phase does the trick. If anyone else can confirm this, I'll gladly commit it.
> 
> Works for me.  `emerge app-forensics/openscap` with python3.3 set as system
> default completed successfully.

Looks like openscap-1.0.1.ebuild was released to us without integrating this patch, or for that matter without openscap-0.9.12.ebuild being updated.  Should I open a new ticket for openscap-1.0.1 or is this one sufficient?
Comment 17 Sven Vermeulen (RETIRED) gentoo-dev 2013-12-26 16:48:25 UTC
The confirmation was still pending; no need for a new bugreport, I'll update the ebuilds accordingly.
Comment 18 Sven Vermeulen (RETIRED) gentoo-dev 2013-12-26 16:53:09 UTC
There ya go, fix implemented for 0.9.12, 1.0.1 and 9999.