Re: when to use depends and when to use requires

Bill Deegan <[email protected]>
Newsgroups gmane.comp.programming.tools.scons.user
Message-ID <CAEyG4CGD_u2qjJzYa11MM-dNNvHJ4eAE2fr9W2GD41n4hXeaTw@mail.gmail.com>
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 <[email protected]> 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
> [email protected]
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>

_______________________________________________
Scons-users mailing list
[email protected]
https://pairlist4.pair.net/mailman/listinfo/scons-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.