[Scons-users] 2.5.0 scanner fidelity regression since 2.3.4

Dave Vitek dvitek at grammatech.com
Fri Mar 17 13:24:26 EDT 2017


On 3/16/2017 10:20 PM, William Blevins wrote:
> Dave,
>
> I'm not sure I understand how you came to your conclusion. The SCons 
> Command Builder takes 3 parameters: a source, a target, and a command 
> string 
> (http://scons.org/doc/HTML/scons-user.html#chap-builders-commands) 
> Even if the command string is empty, the Command Builder creates an 
> explicit dependency as "target" depends on "source". SCons cannot be 
> scanning "test2.h" in your example because "test2.h" never exists; 
> therefore, it has no contents to be scanned nor an implicit 
> dependencies to be created. In your example, that means "test2.h" 
> depends on "test.h":
>
>     Command('test2.h', 'test.h', 'echo "" > test2.h')
>
>
> File "test.h" depends on "test2.h" implicitly via the contents of 
> "test.h" via dependency scanning (as it should):
>
>     // test.h
>     #include "test2.h"
>
>

I disagree with the phrase "as it should."  Let's simplify the example 
even further to just this, and absolutely *nothing* else in the SConstruct:

Command('test2.h', 'test.h', 'cp $SOURCE $TARGET')

I think you would be hard pressed to say that there is anything wrong 
with this rule.  I am trying to make a copy of a file.  I should not get 
a different dependence tree just because of the file's extension.  The 
"cp" command itself certainly does not behave differently with different 
file extensions.  The "cp" command definitely does not need the 
destination file to exist to succeed, which is what SCons seems to think.

- Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20170317/ab3c3857/attachment.html>


More information about the Scons-users mailing list