Re: [Scons-dev] Bug in env.Glob() - how do I report?

2014-12-17 Thread Dirk Bächle

Vasily,

On 15.12.2014 20:35, Vasily wrote:

Hi Dirk,

Thanks for the reply!

I get this running the SConstruct I attached:

$> scons .
scons: Reading SConscript files ...
TypeError: Tried to lookup Dir 'some_entry' as a File.:
   File "C:\Vass\Work\Temp\scons_glob_bug\SConstruct", line 22:
 d2[0].srcnode()
   File "C:\Python27\scons-2.1.0\SCons\Node\FS.py", line 743:
 srcnode.must_be_same(self.__class__)
   File "C:\Python27\scons-2.1.0\SCons\Node\FS.py", line 626:
 (self.__class__.__name__, self.path, klass.__name__))

Note: I've checked it agains SCons 2.1.0 (pretty old, but that's what we use 
internally right now, maybe it's already fixed?..)



I had another look and I tested your example with the latest SCons 2.3.4 and 2.1.0 as well. Both times I get the cyclic dependency 
error...

This seems to be logical to me, because of the following line:

  d1 = variant_exec(env1, 'var1', env1.Command, 'some_entry', 'some_entry', 
Mkdir("$TARGET"))

, where you specify "some_entry" as target *and* source for the Mkdir().
You don't need to do this, setting the source to [] (empty list) should work 
fine.

After this change I was finally able to reproduce your error output: the problem is not so much in the Glob itself, but in the fact 
that you're trying to handle directories but aren't telling SCons so. As a default, SCons assumes that simple strings (like the ones 
returned from the Glob call) refer to file type entries. So, if a folder "some_entry" exists, but the Glob() returns a "some_entry" 
these two collide. For resolving this you have to explicitly convert the list of globbed strings to Dir nodes...find an example 
SConstruct attached.


I hope this explains things and helps you further.

Regards,

Dirk

def variant_exec(env, variant_dir, func, *args, **kw):
oldwd = env.fs.getcwd()
env.VariantDir(variant_dir, '.', duplicate=0)
env.fs.chdir(env1.Dir(variant_dir))
try:
return func(*args, **kw)
finally:
env.fs.chdir(oldwd)

env1 = DefaultEnvironment()
env2 = env1.Clone()

d1 = variant_exec(env1, 'var1', env1.Command, env1.Dir('some_entry'), [], 
Mkdir("$TARGET"))
d1[0].srcnode()

def DirGlob(env, pattern):
return env.Dir(env.Glob(pattern))

d2 = variant_exec(env2, 'var2', DirGlob, env2, '*_entry')

d1[0].disambiguate()
d1[0].srcnode()

d2[0].disambiguate()
d2[0].srcnode()
___
Scons-dev mailing list
Scons-dev@scons.org
https://pairlist2.pair.net/mailman/listinfo/scons-dev


Re: [Scons-dev] Bug in env.Glob() - how do I report?

2014-12-17 Thread Bill Deegan
Vasily,

Also a minor issue please send such to the scons users mailing list in the
future.
The dev mailing list is meant to discuss the internal development of scons
and not  user facing issues.

Thanks,
Bill
p.s. I've cc'd that mailing list

On Wed, Dec 17, 2014 at 8:06 AM, Dirk Bächle  wrote:
>
> Vasily,
>
> On 15.12.2014 20:35, Vasily wrote:
>
>> Hi Dirk,
>>
>> Thanks for the reply!
>>
>> I get this running the SConstruct I attached:
>>
>> $> scons .
>> scons: Reading SConscript files ...
>> TypeError: Tried to lookup Dir 'some_entry' as a File.:
>>File "C:\Vass\Work\Temp\scons_glob_bug\SConstruct", line 22:
>>  d2[0].srcnode()
>>File "C:\Python27\scons-2.1.0\SCons\Node\FS.py", line 743:
>>  srcnode.must_be_same(self.__class__)
>>File "C:\Python27\scons-2.1.0\SCons\Node\FS.py", line 626:
>>  (self.__class__.__name__, self.path, klass.__name__))
>>
>> Note: I've checked it agains SCons 2.1.0 (pretty old, but that's what we
>> use internally right now, maybe it's already fixed?..)
>>
>>
> I had another look and I tested your example with the latest SCons 2.3.4
> and 2.1.0 as well. Both times I get the cyclic dependency error...
> This seems to be logical to me, because of the following line:
>
>   d1 = variant_exec(env1, 'var1', env1.Command, 'some_entry',
> 'some_entry', Mkdir("$TARGET"))
>
> , where you specify "some_entry" as target *and* source for the Mkdir().
> You don't need to do this, setting the source to [] (empty list) should
> work fine.
>
> After this change I was finally able to reproduce your error output: the
> problem is not so much in the Glob itself, but in the fact that you're
> trying to handle directories but aren't telling SCons so. As a default,
> SCons assumes that simple strings (like the ones returned from the Glob
> call) refer to file type entries. So, if a folder "some_entry" exists, but
> the Glob() returns a "some_entry" these two collide. For resolving this you
> have to explicitly convert the list of globbed strings to Dir nodes...find
> an example SConstruct attached.
>
> I hope this explains things and helps you further.
>
> Regards,
>
> Dirk
>
>
> ___
> Scons-dev mailing list
> Scons-dev@scons.org
> https://pairlist2.pair.net/mailman/listinfo/scons-dev
>
>
___
Scons-dev mailing list
Scons-dev@scons.org
https://pairlist2.pair.net/mailman/listinfo/scons-dev


Re: [Scons-dev] Notice about your recent message to us...@scons.tigris.org

2014-12-17 Thread anatoly techtonik
Awesome MIT licensed game engine using SCons
Can't resist to share the awesomeness:
https://github.com/okamstudio/godot/wiki/compiling_intro


P.S. Could not post to Users list, so posting here. got this:

On Thu, Dec 18, 2014 at 6:46 AM,   wrote:
> We are sorry, but email posting to this discussion is not allowed.

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