Re: Wacky crash in Clone()
Bill Deegan <[email protected]>
| Newsgroups | gmane.comp.programming.tools.scons.user |
|---|---|
| Message-ID | <CAEyG4CGuOyqbGg8aYM=SB=g8a58x28AfUV8_c6PZD6a8ynnWqQ@mail.gmail.com> |
Can you be more specific about what info an action would want to change with the builder? More details = possible expert help on how to implement it in a "safe" way.. On Tue, Jan 25, 2022 at 6:42 AM Marc Branchaud <[email protected]> wrote: > On 2022-01-24 17:06, Bill Deegan wrote: > > So you just want CCFLAGS to be overwritten in the action? (or is this > > just an example?) > > Not CCFLAGS, but variables that affect the behaviour of the BaseBuilder. > These should not retain their values after the invocation of the > Builder, so stuffing them into a cloned Environment was convenient. (My > example showed the Clone() call in message(), but it was also happening > in the builder() function.) > > This code is over 10 years old, and I think it would be implemented very > differently today -- not just to avoid Cloning inside an Action. But a > major refactoring is beyond the scope at this time. > > > If you can be specific about what you want to override with your > > Clone(), I'd be there's another way to accomplish that than the Clone().. > > > > It may just be more advanced SCons-Fu.. :) > I rewrote things to avoid cloning Environments, and now all is joy -- > thanks for the pointer! > > For future spelunkers, my solution is a bit hacky: I taught the > BaseBuilder to drive its behaviour from a combination of the Environment > and a module-level "overrides" dict. The MyBuilder sets what it needs > in BaseBuilder.overrides, and BaseBuilder.builder() clears the overrides > when it's done. > > Thanks again! > > M. > _______________________________________________ Scons-users mailing list [email protected] https://pairlist4.pair.net/mailman/listinfo/scons-users