Re: Why are Builders excluded from env.Clone()?

Bill Deegan <bill-cJFiu+DHMVC5azolltMz9laTQe2KTcn/@public.gmane.org>
Newsgroups gmane.comp.programming.tools.scons.devel
Message-ID <CAEyG4CEvbZUyNtHtFwqWcd+PiFezJ7Q6V0VtfvDA7u_sZ2x2nw@mail.gmail.com>
Is your real issue (which caused you to dig into this)
"The big problem here is that c_file, cxx_file are *not* unique to the
passed-in
environment."

Perhaps a solution to just that piece of the puzzle would be simpler?

-Bill

On Fri, Dec 9, 2016 at 9:31 AM, Dirk Bächle <[email protected]> wrote:

> Hi Jonathon,
>
> On 09.12.2016 18:03, Jonathon Reinhart wrote:
>
>>
>> [...]
>>
>> This behavior does appear to be intentional, however:
>>
>>     builders = self._dict.get('BUILDERS', {})
>>
>>     clone = copy.copy(self)
>>     # BUILDERS is not safe to do a simple copy
>>     clone._dict = semi_deepcopy_dict(self._dict, ['BUILDERS'])
>>     clone._dict['BUILDERS'] = BuilderDict(builders, clone)
>>
>>
> please check issue #2821 (http://scons.tigris.org/issue
> s/show_bug.cgi?id=2821) where the latest changes have been made in this
> area.
>
> BUILDERS is explicitly excluded in the semi_deepcopy_dict() call.
>>
>> My questions:
>>  - Why are Builders explicitly excluded from the env.Clone()?
>>
>
> Because it's possible that during the deep-copy, the original is altered
> too (see comment in BuilderDict::__semi_deepcopy__).
>
>  - Would it be reasonable to add an optional argument to Clone()
>>    (e.g. really_deep) which causes Builders to not be excluded?
>>
>>
> As the bug description reveals, no real cure has been found yet. If you
> have a solution that successfully deep-copies the BUILDERs dict, and is
> guaranteed to leave the original environment intact...we'd definitely be
> happy to hear about it.
>
> Best regards,
>
> Dirk
>
>
> _______________________________________________
> Scons-dev mailing list
> [email protected]
> https://pairlist2.pair.net/mailman/listinfo/scons-dev
>

_______________________________________________
Scons-dev mailing list
[email protected]
https://pairlist2.pair.net/mailman/listinfo/scons-dev
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.