Re: when to use depends and when to use requires

daggs <[email protected]>
Newsgroups gmane.comp.programming.tools.scons.user
Message-ID <trinity-e0b62be3-5da7-4d0f-818b-6cee886ad6de-1668105811332@3c-app-mailcom-bs02>
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" <[email protected]>

To: "SCons users mailing list" <[email protected]>

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 <[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

_______________________________________________
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.