[Scons-users] Ignore and Requires
William Blevins
wblevins001 at gmail.com
Wed Oct 15 21:10:45 EDT 2014
Ah, Depends. Right.
Let us know if that works?
V/R,
William
On Wed, Oct 15, 2014 at 9:07 PM, William Blevins <wblevins001 at gmail.com>
wrote:
> So I just checked the documentation. Gary is right like always ;)
>
> Even more curiously, do you even need to do the Ignore before a Requires
> (assuming Ignores + Requires works as desired)?
>
> Seriously though, is there a "Requires" that causes the item to be a
> "normal" node?
>
> V/R,
> William
>
> On Wed, Oct 15, 2014 at 8:49 PM, William Blevins <wblevins001 at gmail.com>
> wrote:
>
>> Requires() re-adds it, but in the special
>>> Requires way, so the file has to exist but changes to it don't trigger
>>> a rebuild.
>>
>>
>> Then what is the way to "Require" and rebuild if it changes? I hope
>> require does check. If it doesn't, then the dependency tree is essentially
>> neutered.
>>
>> V/R,
>> William
>>
>> On Wed, Oct 15, 2014 at 8:44 PM, Gary Oberbrunner <garyo at oberbrunner.com>
>> wrote:
>>
>>> Actually, I think it might work, if I understand what you're doing.
>>> The revision.cpp file starts as a dependency of the target. Ignore()
>>> removes that dependency. Requires() re-adds it, but in the special
>>> Requires way, so the file has to exist but changes to it don't trigger
>>> a rebuild. I'm not positive about this, haven't tried it myself.
>>>
>>> Arvid, the ugly workaround you mention is the accepted method for
>>> this, because it prevents the revision.cpp file from being in the
>>> dependency tree in the first place. But your idea to use Ignore is
>>> clever; if it does actually work, let's put a testcase into SCons so
>>> we can make sure it keeps working.
>>>
>>> -- Gary
>>>
>>> On Wed, Oct 15, 2014 at 8:31 PM, William Blevins <wblevins001 at gmail.com>
>>> wrote:
>>> > Arvid,
>>> >
>>> > I'm not sure you can achieve this the way you desire. Your approach
>>> > fundamentally contradicts the results. Using Requires makes the
>>> generated
>>> > CPP-file an explicit dependency. You are manually injecting the new
>>> > CPP-file into the dependency graph. Since the file new has a different
>>> > name, methods like checking the md5sum cannot detect the lack of
>>> changes;
>>> > thus, the library will always be linked.
>>> >
>>> > Is this a situation where you can use a soft-link to trick SCons into
>>> > keeping a consistent file name?
>>> >
>>> > V/R,
>>> > William
>>> >
>>> > On Wed, Oct 15, 2014 at 5:38 PM, Arvid Rosén <arvid at softube.com>
>>> wrote:
>>> >>
>>> >> Hi!
>>> >>
>>> >> I generate a .cpp file with a revision number. It is compiled and
>>> linked
>>> >> with a lot of other object files. However, I don’t want to re-link if
>>> only
>>> >> the revision number has changed.
>>> >>
>>> >> I thought order-only dependencies using ”Requires” function would
>>> solve
>>> >> this, but if I state that the final binary ”Requires” the
>>> revision-object,
>>> >> the binary is still always re-linked. I guess this is because the
>>> revision
>>> >> object file is in the source list of the link command, so it gets
>>> added as
>>> >> an implicit dependency. There is a ugly workaround (passing the
>>> revision
>>> >> object as a link flag) in the user guide:
>>> >> http://www.scons.org/doc/2.3.1/HTML/scons-user.html#idp2498640
>>> >>
>>> >> But, can I achieve the same thing by using the Ignore function
>>> followed by
>>> >> Requires? It seems to work, but I don’t know if I am guarantied that
>>> the
>>> >> files are built in the right order.
>>> >>
>>> >> Cheers,
>>> >> Arvid
>>> >> _______________________________________________
>>> >> Scons-users mailing list
>>> >> Scons-users at scons.org
>>> >> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>> >
>>> >
>>> >
>>> > _______________________________________________
>>> > Scons-users mailing list
>>> > Scons-users at scons.org
>>> > https://pairlist4.pair.net/mailman/listinfo/scons-users
>>> >
>>>
>>>
>>>
>>> --
>>> Gary
>>> _______________________________________________
>>> Scons-users mailing list
>>> Scons-users at scons.org
>>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20141015/a5854655/attachment-0001.html>
More information about the Scons-users
mailing list