Re: Default() and Ignore() - seem a little awkward

Gary Oberbrunner <[email protected]>
Newsgroups gmane.comp.programming.tools.scons.user
Message-ID <CAFChFyj6_KNmu7nhtfW3iqz_7GFHJ+YD--HSfYb5JjYuFqVocQ@mail.gmail.com>
I think it's good practice to only ever call Default () once, in the top
level Sconstruct or Sconscript. Everything else just adds to the alias set
up there. Default(None) is definitely asking for trouble. :-)

--Gary

On Fri, Jan 4, 2019, 8:13 PM Mats Wichmann <[email protected] wrote:

> On 1/4/19 4:54 PM, Bill Deegan wrote:
> > Not really.
> > All the nodes are added.
> > Ignore says, don't build this one to satisfy this other one.
> > Default says, always build this even it it's not under the invocation
> > directory.
>
> I must be an idiot, because this is completely non-intuitive to me. In
> the absence of instructions to the contrary, default means build
> everything (which may not be a great idea). If you use Default, it means
> build that stuff. "always build this even it it's not under the
> invocation directory" means what?
>
> > What do you mean that an empty SConscript isn't benign?
>
> If you say nothing, all targets from a given environment are built.  I
> did note that I get that sconscript = construction env = targets is not
> a relationship enshrined in SCons canon, but I'm sure many people do
> assume that. So if in an SConscript, you undefine targets for a certain
> env - by way of using Default(None) - the build will not complete
> because there are no targets. Even if there are other targets in the
> overall build that are available to build. That was the idea behind
> claiming not benign.
>
> > On Fri, Jan 4, 2019 at 6:12 PM Mats Wichmann <[email protected]> wrote:
> >
> >> On 1/4/19 3:55 PM, Bill Deegan wrote:
> >>> Could what you want to do be better achieved by not adding the examples
> >> in
> >>> your relevant SConscript if such target(s) aren't asked for?
> >>
> >> In theory. That's kind of what the use of Default implies - don't add
> >> them if they're not asked for, no?
> _______________________________________________
> 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.