[Scons-users] Environment clones linked?

Daniel Moody dmoody256 at gmail.com
Thu May 24 23:33:58 EDT 2018


I am trying to clone an environment and then make changes to the clone so
that it is different than the original.

But somehow changing the clone also changes my original env? Is that
expected behavior?

Below is an example SConstruct which reproduces the issue (SCons 3.01
installed from pip on windows 10):

env1 = Environment()
env2 = env1.Clone()

print("env2 before = " + env1['SHLINKCOM'].list[0].cmd_list)
env2['SHLINKCOM'].list[0].cmd_list = "echo link command env2"
print("env2 after = " + env1['SHLINKCOM'].list[0].cmd_list)

print("env1 = " + env2['SHLINKCOM'].list[0].cmd_list)

Which produces this output:

C:\Users\Daniel\workspace>scons  -f SConstruct.py
scons: Reading SConscript files ...
env2 before = ${TEMPFILE("$SHLINK $SHLINKFLAGS $_SHLINK_TARGETS
$_LIBDIRFLAGS $_LIBFLAGS $_PDB $_SHLINK_SOURCES", "$SHLINKCOMSTR")}
env2 after = echo link command env2
env1 = echo link command env2
scons: done reading SConscript files.
scons: Building targets ...
scons: `.' is up to date.
scons: done building targets.

Can someone shed some light on if this is a bug or how do I uniquely modify
the SHLINKCOM?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20180524/3c129884/attachment.html>


More information about the Scons-users mailing list