[Scons-users] dependencies on directories
Tom Tanner
trtanner at btinternet.com
Tue Dec 29 06:11:45 EST 2015
On 28/12/15 11:37, Dirk Bächle wrote:
> Hi Tom,
>
> On 28.12.2015 11:45, Tom Tanner (BLOOMBERG/ LONDON) wrote:
>> After I persuaded the guy in question to fix *his* dependencies, I
>> discovered that the 'Install' builder appears to do something similar
>> but different. It appears to generate a directory as a target. And
>> the dependencies are strange indeed. Because the directory appears to
>> depend on files that don't exist but *might*.
>> For instance I get the following list of dependencies:
>> bahblah/dirname:
>> source/this.h
>> source/this.hpp
>> source/this.hh
>> source/this.hxx
>
> I think I know where that comes from. Some Tools use the call
> "File.rexists()" to check whether an accompanying file like "foo.hpp"
> exists for a source "foo.c". The problem is, that the File node gets
> added by this function if it doesn't exist...and that's where all the
> extra files come from.
> In one of the last revisions (
> https://bitbucket.org/scons/scons/pull-requests/193/new-method-rentry_exists_on_disk/diff
> ), I added the new method "Dir.rentry_exists_on_disk()" which only
> peeks onto the disk, but doesn't create new nodes.
> However, the Tools haven't all been switched to the new method, yet.
> Can you name the tools that you use, so we might come up with an
> attack plan for this?
> I'm really interested in this topic because I ran into the same
> problems you seem to have now, when trying to combine the Qt4 Tool
> with RPM packaging of the sources automatically...
>
> Best regards,
>
> Dirk
>
>
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
Ah ha. Both the default QT tool and the QT5 tool from
https://bitbucket.org/dirkbaechle/scons_qt5 have this function:
def find_file(filename, paths, node_factory):
for dir in paths:
node = node_factory(filename, dir)
if node.rexists():
return node
return None
which needs to be replaced:
def find_file(filename, paths, node_factory, dir_factory):
for dir in paths:
dir = dir_factory(dir)
if dir.rentry_exists_on_disk(filename):
return node_factory(filename, dir)
return None
and the calls be given env.Dir
that only leaves me with the directory dependency having picked up a
'Pseudo' target - which is easy enough to test for in my patch code, but
I'm trying to find out why the install builder thinks it's a potential
source
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20151229/4aa57a35/attachment.html>
More information about the Scons-users
mailing list