Re: [Scons-dev] unhashable type: 'Literal'' trying to evaluate

2018-10-25 Thread Jason Kenny
Looking into this more I see that was have code like this in _PathList:

for p in pathlist:
try:
found = '$' in p
except (AttributeError, TypeError):
type = TYPE_OBJECT
else:
if not found:
type = TYPE_STRING_NO_SUBST
else:
type = TYPE_STRING_SUBST

The issue is this code will break when Literal is a string type. (beside we 
replace the builtin type with a var) This code assumes we don't have a 
__contains__ operator. I think I have a better understanding on some small 
fixes to subt to make it "easier" to deal with.

Jason



From: Jason Kenny 
Sent: Thursday, October 25, 2018 12:16 PM
To: Jason Kenny; SCons developer list
Subject: Re: [Scons-dev] unhashable type: 'Literal'' trying to evaluate

Ya .. master has the fix for the Literal object. technically I think this 
should be a UserString still.

Jason



From: Scons-dev  on behalf of Jason Kenny 

Sent: Thursday, October 25, 2018 12:11 PM
To: SCons developer list
Subject: Re: [Scons-dev] unhashable type: 'Literal'' trying to evaluate

Not yet... Let me look

Get Outlook for 
Android


From: Scons-dev  on behalf of Bill Deegan 

Sent: Thursday, October 25, 2018 11:45:02 AM
To: SCons developer list
Subject: Re: [Scons-dev] unhashable type: 'Literal'' trying to evaluate

Have you tried the code on master?
There have been some py3 related issues similar to this resolved.
-Bill

On Thu, Oct 25, 2018 at 8:52 AM Jason Kenny 
mailto:dragon...@live.com>> wrote:
Hi,

I working on getting Parts to work on py3. I think I have most of it working at 
this point, however I had an error that concerned me:

scons: *** [_build/build_debug_posix-x86_64/hello/hello] TypeError `unhashable 
type: 'Literal'' trying to evaluate `${_concat(RPATHPREFIX, RPATH, RPATHSUFFIX, 
__env__)}'

This happens as I tweak the RPATH value with some code like this:

rlst.append(self.env.Literal('{0}$$ORIGIN/{1}{0}'.format(quote, 
self.env.Dir('$INSTALL_BIN').rel_path(
self.env.Dir('$INSTALL_LIB')

should result in a value such as:
["'$$ORIGIN/../lib'"]

This works if I subst() directly at this point. However I am getting a stack ( 
below as it is long) like this which suggests some new behavior? This code 
should be fine and should not have broken. There is no funny stuff here in 
parts.. it a very basic value being set.

Do we know of an issues with Literal() in python 3?

meantime I going to start debugging this "fun" code

- Jason

The stack...

scons: internal stack trace:
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Job.py",
 line 199, in start
task.prepare()
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Script/Main.py",
 line 175, in prepare
return SCons.Taskmaster.OutOfDateTask.prepare(self)
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Taskmaster.py",
 line 179, in prepare
self.exception_raise()
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Taskmaster.py",
 line 554, in _exception_raise
exec("raise exc_value.with_traceback(exc_traceback)")
  File "", line 1, in 
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Taskmaster.py",
 line 973, in next_task
task.make_ready()
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Script/Main.py",
 line 309, in make_ready
SCons.Taskmaster.OutOfDateTask.make_ready(self)
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Taskmaster.py",
 line 409, in make_ready_current
t.disambiguate().make_ready()
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Node/FS.py",
 line 3055, in make_ready
self.get_binfo()
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Node/__init__.py",
 line 1136, in get_binfo
binfo.bactsig = SCons.Util.MD5signature(executor.get_contents())
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Executor.py",
 line 467, in get_contents
for action in action_list])
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Executor.py",
 line 467, in 
for action in 

Re: [Scons-dev] unhashable type: 'Literal'' trying to evaluate

2018-10-25 Thread Jason Kenny
Ya .. master has the fix for the Literal object. technically I think this 
should be a UserString still.

Jason



From: Scons-dev  on behalf of Jason Kenny 

Sent: Thursday, October 25, 2018 12:11 PM
To: SCons developer list
Subject: Re: [Scons-dev] unhashable type: 'Literal'' trying to evaluate

Not yet... Let me look

Get Outlook for 
Android


From: Scons-dev  on behalf of Bill Deegan 

Sent: Thursday, October 25, 2018 11:45:02 AM
To: SCons developer list
Subject: Re: [Scons-dev] unhashable type: 'Literal'' trying to evaluate

Have you tried the code on master?
There have been some py3 related issues similar to this resolved.
-Bill

On Thu, Oct 25, 2018 at 8:52 AM Jason Kenny 
mailto:dragon...@live.com>> wrote:
Hi,

I working on getting Parts to work on py3. I think I have most of it working at 
this point, however I had an error that concerned me:

scons: *** [_build/build_debug_posix-x86_64/hello/hello] TypeError `unhashable 
type: 'Literal'' trying to evaluate `${_concat(RPATHPREFIX, RPATH, RPATHSUFFIX, 
__env__)}'

This happens as I tweak the RPATH value with some code like this:

rlst.append(self.env.Literal('{0}$$ORIGIN/{1}{0}'.format(quote, 
self.env.Dir('$INSTALL_BIN').rel_path(
self.env.Dir('$INSTALL_LIB')

should result in a value such as:
["'$$ORIGIN/../lib'"]

This works if I subst() directly at this point. However I am getting a stack ( 
below as it is long) like this which suggests some new behavior? This code 
should be fine and should not have broken. There is no funny stuff here in 
parts.. it a very basic value being set.

Do we know of an issues with Literal() in python 3?

meantime I going to start debugging this "fun" code

- Jason

The stack...

scons: internal stack trace:
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Job.py",
 line 199, in start
task.prepare()
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Script/Main.py",
 line 175, in prepare
return SCons.Taskmaster.OutOfDateTask.prepare(self)
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Taskmaster.py",
 line 179, in prepare
self.exception_raise()
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Taskmaster.py",
 line 554, in _exception_raise
exec("raise exc_value.with_traceback(exc_traceback)")
  File "", line 1, in 
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Taskmaster.py",
 line 973, in next_task
task.make_ready()
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Script/Main.py",
 line 309, in make_ready
SCons.Taskmaster.OutOfDateTask.make_ready(self)
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Taskmaster.py",
 line 409, in make_ready_current
t.disambiguate().make_ready()
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Node/FS.py",
 line 3055, in make_ready
self.get_binfo()
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Node/__init__.py",
 line 1136, in get_binfo
binfo.bactsig = SCons.Util.MD5signature(executor.get_contents())
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Executor.py",
 line 467, in get_contents
for action in action_list])
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Executor.py",
 line 467, in 
for action in action_list])
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Action.py",
 line 535, in get_contents
result = self.get_presig(target, source, env)
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Action.py",
 line 1112, in get_presig
return c.get_presig(self, target, source, env)
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Action.py",
 line 1049, in get_presig
return self._generate(target, source, env, 1, executor).get_presig(target, 
source, env)
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Action.py",
 line 1271, in get_presig
return b"".join([bytes(x.get_contents(target, source, env)) for x in 
self.list])
  File 

Re: [Scons-dev] unhashable type: 'Literal'' trying to evaluate

2018-10-25 Thread Jason Kenny
Not yet... Let me look

Get Outlook for Android


From: Scons-dev  on behalf of Bill Deegan 

Sent: Thursday, October 25, 2018 11:45:02 AM
To: SCons developer list
Subject: Re: [Scons-dev] unhashable type: 'Literal'' trying to evaluate

Have you tried the code on master?
There have been some py3 related issues similar to this resolved.
-Bill

On Thu, Oct 25, 2018 at 8:52 AM Jason Kenny 
mailto:dragon...@live.com>> wrote:
Hi,

I working on getting Parts to work on py3. I think I have most of it working at 
this point, however I had an error that concerned me:

scons: *** [_build/build_debug_posix-x86_64/hello/hello] TypeError `unhashable 
type: 'Literal'' trying to evaluate `${_concat(RPATHPREFIX, RPATH, RPATHSUFFIX, 
__env__)}'

This happens as I tweak the RPATH value with some code like this:

rlst.append(self.env.Literal('{0}$$ORIGIN/{1}{0}'.format(quote, 
self.env.Dir('$INSTALL_BIN').rel_path(
self.env.Dir('$INSTALL_LIB')

should result in a value such as:
["'$$ORIGIN/../lib'"]

This works if I subst() directly at this point. However I am getting a stack ( 
below as it is long) like this which suggests some new behavior? This code 
should be fine and should not have broken. There is no funny stuff here in 
parts.. it a very basic value being set.

Do we know of an issues with Literal() in python 3?

meantime I going to start debugging this "fun" code

- Jason

The stack...

scons: internal stack trace:
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Job.py",
 line 199, in start
task.prepare()
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Script/Main.py",
 line 175, in prepare
return SCons.Taskmaster.OutOfDateTask.prepare(self)
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Taskmaster.py",
 line 179, in prepare
self.exception_raise()
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Taskmaster.py",
 line 554, in _exception_raise
exec("raise exc_value.with_traceback(exc_traceback)")
  File "", line 1, in 
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Taskmaster.py",
 line 973, in next_task
task.make_ready()
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Script/Main.py",
 line 309, in make_ready
SCons.Taskmaster.OutOfDateTask.make_ready(self)
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Taskmaster.py",
 line 409, in make_ready_current
t.disambiguate().make_ready()
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Node/FS.py",
 line 3055, in make_ready
self.get_binfo()
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Node/__init__.py",
 line 1136, in get_binfo
binfo.bactsig = SCons.Util.MD5signature(executor.get_contents())
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Executor.py",
 line 467, in get_contents
for action in action_list])
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Executor.py",
 line 467, in 
for action in action_list])
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Action.py",
 line 535, in get_contents
result = self.get_presig(target, source, env)
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Action.py",
 line 1112, in get_presig
return c.get_presig(self, target, source, env)
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Action.py",
 line 1049, in get_presig
return self._generate(target, source, env, 1, executor).get_presig(target, 
source, env)
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Action.py",
 line 1271, in get_presig
return b"".join([bytes(x.get_contents(target, source, env)) for x in 
self.list])
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Action.py",
 line 1271, in 
return b"".join([bytes(x.get_contents(target, source, env)) for x in 
self.list])
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Action.py",
 line 535, in get_contents
result = self.get_presig(target, source, env)
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Action.py",
 line 964, in 

Re: [Scons-dev] unhashable type: 'Literal'' trying to evaluate

2018-10-25 Thread Mats Wichmann
On 10/25/2018 10:45 AM, Bill Deegan wrote:
> Have you tried the code on master?
> There have been some py3 related issues similar to this resolved.
> -Bill

for my testcase at least, this does seem to work using master.

___
Scons-dev mailing list
Scons-dev@scons.org
https://pairlist2.pair.net/mailman/listinfo/scons-dev


Re: [Scons-dev] unhashable type: 'Literal'' trying to evaluate

2018-10-25 Thread Bill Deegan
Have you tried the code on master?
There have been some py3 related issues similar to this resolved.
-Bill

On Thu, Oct 25, 2018 at 8:52 AM Jason Kenny  wrote:

> Hi,
>
> I working on getting Parts to work on py3. I think I have most of it
> working at this point, however I had an error that concerned me:
>
> scons: *** [_build/build_debug_posix-x86_64/hello/hello] TypeError
> `unhashable type: 'Literal'' trying to evaluate `${_concat(RPATHPREFIX,
> RPATH, RPATHSUFFIX, __env__)}'
>
> This happens as I tweak the RPATH value with some code like this:
>
> rlst.append(self.env.Literal('{0}$$ORIGIN/{1}{0}'.format(quote, self
> .env.Dir('$INSTALL_BIN').rel_path(
> self.env.Dir('$INSTALL_LIB')
>
> should result in a value such as:
> ["'$$ORIGIN/../lib'"]
>
> This works if I subst() directly at this point. However I am getting a
> stack ( below as it is long) like this which suggests some new behavior?
> This code should be fine and should not have broken. There is no funny
> stuff here in parts.. it a very basic value being set.
>
> Do we know of an issues with Literal() in python 3?
>
> meantime I going to start debugging this "fun" code
>
> - Jason
>
> The stack...
>
> scons: internal stack trace:
>   File
> "/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Job.py",
> line 199, in start
> task.prepare()
>   File
> "/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Script/Main.py",
> line 175, in prepare
> return SCons.Taskmaster.OutOfDateTask.prepare(self)
>   File
> "/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Taskmaster.py",
> line 179, in prepare
> self.exception_raise()
>   File
> "/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Taskmaster.py",
> line 554, in _exception_raise
> exec("raise exc_value.with_traceback(exc_traceback)")
>   File "", line 1, in 
>   File
> "/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Taskmaster.py",
> line 973, in next_task
> task.make_ready()
>   File
> "/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Script/Main.py",
> line 309, in make_ready
> SCons.Taskmaster.OutOfDateTask.make_ready(self)
>   File
> "/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Taskmaster.py",
> line 409, in make_ready_current
> t.disambiguate().make_ready()
>   File
> "/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Node/FS.py",
> line 3055, in make_ready
> self.get_binfo()
>   File
> "/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Node/__init__.py",
> line 1136, in get_binfo
> binfo.bactsig = SCons.Util.MD5signature(executor.get_contents())
>   File
> "/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Executor.py",
> line 467, in get_contents
> for action in action_list])
>   File
> "/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Executor.py",
> line 467, in 
> for action in action_list])
>   File
> "/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Action.py",
> line 535, in get_contents
> result = self.get_presig(target, source, env)
>   File
> "/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Action.py",
> line 1112, in get_presig
> return c.get_presig(self, target, source, env)
>   File
> "/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Action.py",
> line 1049, in get_presig
> return self._generate(target, source, env, 1,
> executor).get_presig(target, source, env)
>   File
> "/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Action.py",
> line 1271, in get_presig
> return b"".join([bytes(x.get_contents(target, source, env)) for x in
> self.list])
>   File
> "/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Action.py",
> line 1271, in 
> return b"".join([bytes(x.get_contents(target, source, env)) for x in
> self.list])
>   File
> "/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Action.py",
> line 535, in get_contents
> result = self.get_presig(target, source, env)
>   File
> "/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Action.py",
> line 964, in get_presig
> return env.subst_target_source(cmd, SUBST_SIG, target, source)
>   File
> 

Re: [Scons-dev] unhashable type: 'Literal'' trying to evaluate

2018-10-25 Thread Jason Kenny
I found the issue...

the problem in the easy to monkey patch view is to add to SCons.subst.Literal 
with a

def __hash__(self):
return hash(self.lstr)


The better fix would be to do this in SCons:

class Literal(collections.UserString):
"""A wrapper for a string.  If you use this object wrapped
around a string, then it will be interpreted as literal.
When passed to the command interpreter, all special
characters will be escaped."""
def __init__(self, lstr):
self.data = lstr # should only need this... might need to add a 
property for the old lstr member

def escape(self, escape_func):
return escape_func(self.data)

def for_signature(self):
return self.data

def is_literal(self):
return 1




The core issue seems to be related in the PathListCache object. I am unclear 
why it works in py2. I would think the hash issue would show up here as well.

Jason

From: Scons-dev  on behalf of Jason Kenny 

Sent: Thursday, October 25, 2018 10:52 AM
To: SCons developer list
Subject: [Scons-dev] unhashable type: 'Literal'' trying to evaluate

Hi,

I working on getting Parts to work on py3. I think I have most of it working at 
this point, however I had an error that concerned me:

scons: *** [_build/build_debug_posix-x86_64/hello/hello] TypeError `unhashable 
type: 'Literal'' trying to evaluate `${_concat(RPATHPREFIX, RPATH, RPATHSUFFIX, 
__env__)}'

This happens as I tweak the RPATH value with some code like this:

rlst.append(self.env.Literal('{0}$$ORIGIN/{1}{0}'.format(quote, 
self.env.Dir('$INSTALL_BIN').rel_path(
self.env.Dir('$INSTALL_LIB')

should result in a value such as:
["'$$ORIGIN/../lib'"]

This works if I subst() directly at this point. However I am getting a stack ( 
below as it is long) like this which suggests some new behavior? This code 
should be fine and should not have broken. There is no funny stuff here in 
parts.. it a very basic value being set.

Do we know of an issues with Literal() in python 3?

meantime I going to start debugging this "fun" code

- Jason

The stack...

scons: internal stack trace:
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Job.py",
 line 199, in start
task.prepare()
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Script/Main.py",
 line 175, in prepare
return SCons.Taskmaster.OutOfDateTask.prepare(self)
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Taskmaster.py",
 line 179, in prepare
self.exception_raise()
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Taskmaster.py",
 line 554, in _exception_raise
exec("raise exc_value.with_traceback(exc_traceback)")
  File "", line 1, in 
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Taskmaster.py",
 line 973, in next_task
task.make_ready()
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Script/Main.py",
 line 309, in make_ready
SCons.Taskmaster.OutOfDateTask.make_ready(self)
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Taskmaster.py",
 line 409, in make_ready_current
t.disambiguate().make_ready()
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Node/FS.py",
 line 3055, in make_ready
self.get_binfo()
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Node/__init__.py",
 line 1136, in get_binfo
binfo.bactsig = SCons.Util.MD5signature(executor.get_contents())
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Executor.py",
 line 467, in get_contents
for action in action_list])
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Executor.py",
 line 467, in 
for action in action_list])
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Action.py",
 line 535, in get_contents
result = self.get_presig(target, source, env)
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Action.py",
 line 1112, in get_presig
return c.get_presig(self, target, source, env)
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Action.py",
 line 1049, in get_presig
return self._generate(target, source, env, 1, executor).get_presig(target, 
source, env)
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Action.py",
 

Re: [Scons-dev] unhashable type: 'Literal'' trying to evaluate

2018-10-25 Thread Mats Wichmann
On 10/25/2018 09:52 AM, Jason Kenny wrote:
> Hi,
> 
> I working on getting Parts to work on py3. I think I have most of it working 
> at this point, however I had an error that concerned me:
> 
> scons: *** [_build/build_debug_posix-x86_64/hello/hello] TypeError 
> `unhashable type: 'Literal'' trying to evaluate `${_concat(RPATHPREFIX, 
> RPATH, RPATHSUFFIX, __env__)}'
> 
> This happens as I tweak the RPATH value with some code like this:
> 
> rlst.append(self.env.Literal('{0}$$ORIGIN/{1}{0}'.format(quote, 
> self.env.Dir('$INSTALL_BIN').rel_path(
> self.env.Dir('$INSTALL_LIB')
> 
> should result in a value such as:
> ["'$$ORIGIN/../lib'"]
> 
> This works if I subst() directly at this point. However I am getting a stack 
> ( below as it is long) like this which suggests some new behavior? This code 
> should be fine and should not have broken. There is no funny stuff here in 
> parts.. it a very basic value being set.
> 
> Do we know of an issues with Literal() in python 3?
> 
> meantime I going to start debugging this "fun" code
> 
> - Jason

A quick experiment leaves me scratching my head... under scons+py3 an
instance of Literal() has a __hash__ but has it set to None. That
despite that the Literal class defines a __hash__ function...

$ cat SConstruct
env = Environment()

x = env.Literal("foo")
print("Type: ", type(x))
if hasattr(x, '__hash__'):
if x.__hash__:
print("Hashable: %d" % x.__hash__())
else:
print("Has __hash__, but it is None")
else:
print("No __hash__ method")
print(x)

$ scons
scons: Reading SConscript files ...
('Type: ', )
Hashable: 8791304380589
foo
scons: done reading SConscript files.
scons: Building targets ...
scons: `.' is up to date.
scons: done building targets.

$ scons-3
scons: Reading SConscript files ...
Type:  
Has __hash__, but it is None
foo
scons: done reading SConscript files.
scons: Building targets ...
scons: `.' is up to date.
scons: done building targets.
___
Scons-dev mailing list
Scons-dev@scons.org
https://pairlist2.pair.net/mailman/listinfo/scons-dev


[Scons-dev] unhashable type: 'Literal'' trying to evaluate

2018-10-25 Thread Jason Kenny
Hi,

I working on getting Parts to work on py3. I think I have most of it working at 
this point, however I had an error that concerned me:

scons: *** [_build/build_debug_posix-x86_64/hello/hello] TypeError `unhashable 
type: 'Literal'' trying to evaluate `${_concat(RPATHPREFIX, RPATH, RPATHSUFFIX, 
__env__)}'

This happens as I tweak the RPATH value with some code like this:

rlst.append(self.env.Literal('{0}$$ORIGIN/{1}{0}'.format(quote, 
self.env.Dir('$INSTALL_BIN').rel_path(
self.env.Dir('$INSTALL_LIB')

should result in a value such as:
["'$$ORIGIN/../lib'"]

This works if I subst() directly at this point. However I am getting a stack ( 
below as it is long) like this which suggests some new behavior? This code 
should be fine and should not have broken. There is no funny stuff here in 
parts.. it a very basic value being set.

Do we know of an issues with Literal() in python 3?

meantime I going to start debugging this "fun" code

- Jason

The stack...

scons: internal stack trace:
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Job.py",
 line 199, in start
task.prepare()
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Script/Main.py",
 line 175, in prepare
return SCons.Taskmaster.OutOfDateTask.prepare(self)
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Taskmaster.py",
 line 179, in prepare
self.exception_raise()
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Taskmaster.py",
 line 554, in _exception_raise
exec("raise exc_value.with_traceback(exc_traceback)")
  File "", line 1, in 
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Taskmaster.py",
 line 973, in next_task
task.make_ready()
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Script/Main.py",
 line 309, in make_ready
SCons.Taskmaster.OutOfDateTask.make_ready(self)
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Taskmaster.py",
 line 409, in make_ready_current
t.disambiguate().make_ready()
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Node/FS.py",
 line 3055, in make_ready
self.get_binfo()
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Node/__init__.py",
 line 1136, in get_binfo
binfo.bactsig = SCons.Util.MD5signature(executor.get_contents())
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Executor.py",
 line 467, in get_contents
for action in action_list])
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Executor.py",
 line 467, in 
for action in action_list])
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Action.py",
 line 535, in get_contents
result = self.get_presig(target, source, env)
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Action.py",
 line 1112, in get_presig
return c.get_presig(self, target, source, env)
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Action.py",
 line 1049, in get_presig
return self._generate(target, source, env, 1, executor).get_presig(target, 
source, env)
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Action.py",
 line 1271, in get_presig
return b"".join([bytes(x.get_contents(target, source, env)) for x in 
self.list])
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Action.py",
 line 1271, in 
return b"".join([bytes(x.get_contents(target, source, env)) for x in 
self.list])
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Action.py",
 line 535, in get_contents
result = self.get_presig(target, source, env)
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Action.py",
 line 964, in get_presig
return env.subst_target_source(cmd, SUBST_SIG, target, source)
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Environment.py",
 line 514, in subst
return SCons.Subst.scons_subst(string, self, raw, target, source, gvars, 
lvars, conv)
  File 
"/home/jkenny/.local/share/virtualenvs/parts-aMB9Fa3Q/lib/python3.6/site-packages/scons-3.0.1/SCons/Subst.py",
 line 569, in scons_subst
result =