[Scons-users] Default() and Ignore() - seem a little awkward

Mats Wichmann mats at wichmann.us
Sun Jan 6 13:21:36 EST 2019


On 1/5/19 3:16 PM, Gary Oberbrunner wrote:
> On Sat, Jan 5, 2019 at 5:09 PM Mats Wichmann <mats at wichmann.us> wrote:
> 
>> ...
>>> As for your note that a Default list of None is "not legal" well, not
>>> exactly -- but it does mean nothing will be built by default (without
>> some
>>> target specified on the cmd line), which is odd at best. Default() is
>>> global - it just replaces '.' as what gets built if the user doesn't
>>> specify any command line targets.
>>
>> there's an env.Default too.. is that in fact not environment-specific
>> and actually global?  If so, that would explain what I was seeing.
>>
> 
> Yes, I can see how that would be confusing. It's the same global Default(),
> just callable from an Environment. A doc note would be a good idea there.
> 

Okay, it finally dawns on me that specifying targets via Default is just
like specifying targets on the command line - "ignore the list of
targets SCons would have figured out, and just build these (and their
requirements), and that the command line "wins" (thus the choice of the
name Default() - applies only if no targets on command line - which name
perhaps was part of what helped confuse me).  I don't know why that took
so long to sink in. I'll see if there are any doc changes to propose,
but now that I think I finally understand how these pieces play together
(cmdline targets, Default() calls, the various variables which contain
listed targets), the documentation seems to me to be fine, and
sufficiently descriptive.  That's frustrating: I should learn from the
docs instead of after doing sufficient experiments I go back and confirm
the docs do say what I discovered, but that doesn't mean I know how to
"say it better" :)


Oh, and... turns out the structure of our project is sufficiently grotty
as to elude easy retrofit to Gary's otherwise appealing approach of
setting up an alias used for Default() and building that up as we go.
I'll check if people want me to invest the time it would take to
rejigger some things, I'm guessing probably not.


Thanks for the help, guys.



More information about the Scons-users mailing list