Changeset 2770

Show
Ignore:
Timestamp:
02/21/18 04:24:59 (4 months ago)
Author:
jwoithe
Message:

SConstruct: try another approach for ConfigGuess?().

The change made in r2768 seems to break scons2 when running with python2 on
some systems (reported by Dave Plater on ffado-devel). It is noted that
scons 2.4.1 under python 2.7.14 seems to be fine. The crash reported by Dave
seemed to be related to the context.Result() call:

File "/data/packages/BUILD/ffado-svn/SConstruct", line 472:

config_guess = conf.ConfigGuess?()

File "/usr/lib/python2.7/site-packages/SCons/SConf.py", line 640:

ret = self.test(context, *args, **kw)

File "/data/packages/BUILD/ffado-svn/SConstruct", line 160:

context.Result( ret )

File "/usr/lib/python2.7/site-packages/SCons/SConf.py", line 791:

raise TypeError?("Expected string, int or bool, got " + str(type(res)))

This patch moves the decode() call so it comes after the context.Result()
call. This works under scons 2.4.1 with python 2.7.14, but it seems this is
no guarantee that other combinations will be ok.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/SConstruct

    r2768 r2770  
    157157def ConfigGuess( context ): 
    158158    context.Message( "Trying to find the system triple: " ) 
    159     ret = check_output(("/bin/sh", "admin/config.guess")).decode().rstrip() 
     159    ret = check_output(("/bin/sh", "admin/config.guess")).rstrip() 
    160160    context.Result( ret ) 
    161     return ret 
     161    return ret.decode() 
    162162 
    163163def CheckForApp( context, app ):