Bug 76960

Summary: NameError: name 'src' is not defined
Product: Mesa Reporter: Vinson Lee <vlee>
Component: OtherAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact:
Severity: blocker    
Priority: medium CC: brianp, huax.lu, idr
Version: gitKeywords: regression
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Vinson Lee 2014-04-02 18:53:34 UTC
mesa: 5a68f731029258ddede4bd5d578cee203f4a80b3 (master 10.2.0-devel)

$ scons
[...]
  Generating build/linux-x86_64-debug/mapi/glapi/glprocs.h ...
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'src' is not defined

cecffa08d191615b59751dc84fe33d051e4a4b67 is the first bad commit
commit cecffa08d191615b59751dc84fe33d051e4a4b67
Author: Ian Romanick <ian.d.romanick@intel.com>
Date:   Tue Apr 1 13:04:17 2014 -0700

    glapi: Enable ES compatibility mode
    
    Ages ago Chia-I added an ES compatibility flag to several of the various
    generator scripts.  The intention was to bridge differences between ES
    and desktop in Mesa builds without ES.  It doesn't appear that it has
    ever been used.  Recent changes to static_dispatch status of several ES1
    functions caused problems in desktop-only, non-shared-glapi builds.
    Enabling the ES compatibility mode appears to fix these build problems.
    
    This is kind of a duct tape solution to this problem.  As I mentioned in
    the cover letter for the series that triggered the build problem, I
    would like to make some major changes to the generator architecture and
    the XML.  The whole point of the proposed architecture changes is to
    better handle the differences between desktop GL and ES.  I think duct
    tape is okay for now.
    
    Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76869
    Tested-by: Brian Paul <brianp@vmware.com>
    Tested-by: Lu Hua <huax.lu@intel.com>
    Cc: Vinson Lee <vlee@freedesktop.org>
    Cc: Chia-I Wu <olv@lunarg.com>

:040000 040000 49d832f3a17a5e1df34ebc1fcfa1604456a66f03 e1f9b761ab1c0183699f261e7830e3dcd1a5bf2a M	src
bisect run success
Comment 1 Ian Romanick 2014-04-02 18:58:02 UTC
Ugh... I CC'ed Vinson on that patch in hopes that he would test it before it landed.

Are you able to reproduce this without scons?  Can you give me instructions?
Comment 2 Vinson Lee 2014-04-02 19:06:14 UTC
$ /usr/bin/python -c src/mapi/glapi/gen/gl_procs.py -f src/mapi/glapi/gen/gl_and_es_API.xml
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'src' is not defined
Comment 3 Brian Paul 2014-04-02 19:13:32 UTC
Looks like this fixes it for me:

diff --git a/src/mapi/glapi/gen/SConscript b/src/mapi/glapi/gen/SConscript
index 4d827b0..e4abe90 100644
--- a/src/mapi/glapi/gen/SConscript
+++ b/src/mapi/glapi/gen/SConscript
@@ -38,7 +38,7 @@ env.CodeGenerate(
     target = '../../../mapi/glapi/glprocs.h',
     script = 'gl_procs.py',
     source = sources,
-    command = python_cmd + ' -c $SCRIPT -f $SOURCE > $TARGET'
+    command = python_cmd + ' $SCRIPT -f $SOURCE > $TARGET'
     )
 

None of the other env.CodeGenerate() calls in that file use the -c option.

PS: I didn't test the Linux scons build yesterday.
Comment 4 Ian Romanick 2014-04-02 19:27:46 UTC
Oh dear.  The -c is in the wrong place.  It should go on the other side of $SCRIPT.
Comment 5 Jose Fonseca 2014-04-03 11:53:02 UTC
I took the liberty of pushing Ian's fix.
Comment 6 Ian Romanick 2014-04-03 20:35:24 UTC
(In reply to comment #5)
> I took the liberty of pushing Ian's fix.

Thanks, and sorry about the delay.  I thought I pushed it yesterday after I got Brian's Tested-by. :(

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.