[Scons-dev] Why are Builders excluded from env.Clone()?
Bill Deegan
bill at baddogconsulting.com
Fri Dec 9 12:46:38 EST 2016
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 <tshortik at gmx.de> 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
> Scons-dev at scons.org
> https://pairlist2.pair.net/mailman/listinfo/scons-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist2.pair.net/pipermail/scons-dev/attachments/20161209/59051564/attachment.html>
More information about the Scons-dev
mailing list