[Scons-users] when to use depends and when to use requires

Bill Deegan bill at baddogconsulting.com
Thu Nov 10 14:06:37 EST 2022


No attached examples.


On Thu, Nov 10, 2022 at 1:43 PM daggs <daggs at gmx.com> wrote:

> the project is composed of scripts, makefiles and code files.(which are
> built with scons env)
>
> I've created builders fpr the make and sripts.
> some of the scripts generates code files which are needed in the scons
> envs.
> this is one example
>
> *Sent:* Thursday, November 10, 2022 at 8:35 PM
> *From:* "Bill Deegan" <bill at baddogconsulting.com>
> *To:* "SCons users mailing list" <scons-users at scons.org>
> *Subject:* Re: [Scons-users] when to use depends and when to use requires
> If you need either.. you're probably doing something wrong.. (TM - Me...;)
>
> The fact that you're using either means that the relevant files weren't
> listed as a source or a target to the correct builders and/or the extra
> sources/dependencies weren't found by a scanner.
>
> Can you be a little more specific about the builder's in question?
>
> -Bill
>
> On Thu, Nov 10, 2022 at 11:50 AM daggs <daggs at gmx.com> wrote:
>
>> > On 11/10/22 05:35, daggs wrote:
>> > > Greetings,
>> > >
>> > > I still don't know what are the proper guidelines to use Depends or
>> Requires.
>> > > I had an example of a target a and target b, target a depends on b, b
>> creates a few files, one of them is needed for target a. I used Depends
>> here.
>> > > depending target a on target b didn't enforced the proper order,
>> adding the relevant file to the dep list didn't worked, however, when I
>> changed it into Requires,
>> > > the order was enforced.
>> > > from that I deduce that for code files which I need to use as part of
>> another target I should use Requires while for the rest, I should use
>> Depends.
>> > >
>> > > am I right?
>> >
>> > I don't know if we explain it well enough - not sure I fully understand
>> > either.
>> >
>> > At the surface level (someone please jump in and correct me here):
>> >
>> > Requires() is for specifying order. It does not establish dependencies.
>> > If something else already decides A and B will be built, then having A
>> > Require B means SCons will decide to build B before A.  Since it's not a
>> > dependency, rebuilding B doesn't automatically trigger rebuilding A.
>> >
>> > Depends() is for declaring a dependency to SCons that it won't otherwise
>> > decect by itself. It says nothing about order, because that's something
>> > SCons gets to decide, based on its evaluation of the dependency graph.
>> > In many cases, of course, a dependency *does* end up acting as a kind of
>> > ordering - but it's not certain.
>> >
>> > Looking at the manpage I don't think I'm actually saying anything
>> > different that it does.
>>
>> so I need both Depends and both Require?
>> _______________________________________________
>> 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
> _______________________________________________
> 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/20221110/ac621197/attachment.htm>


More information about the Scons-users mailing list