[Scons-users] Possible Bug in cleaning Aliases

William Deegan bill at baddogconsulting.com
Mon Nov 12 13:26:13 EST 2012


Mark,
On Nov 10, 2012, at 2:27 PM, Mark Ribau <mribau at realtaentertainment.com> wrote:


> I don't have a separate test case other than our production set up. We have hundreds (possibly over a thousand) sources. Our P4 depot for this project is around 30 GB or so.


A small repeatable test case is needed to get these changes into the core.
if you can't create one that would mean one of the core team members would have to dig into this and create one.
(Which will take longer than if you were able to create one yourself)


>

> We are using Stand Alone Python 2.7.1. We are using SCons stand alone version 2.1.0, but it appeared that 2.2.0 has the same code for this part.

>

> We are set up possibly in an unusual way in that each target is assigned to multiple hierarchical aliases -- this allows our designers to build using "logical" names and groupings, which don't always correspond to folder structure.

>

> We also made a modification to allow aliases to be case insensitive.

Did you make that the default behavior or is it controlled by a command line flag?



>

> These things don't seem to be related to the bug, however SCons is a big complex beast.

>

> I wasn't fully clear on how to use Tigris and bitbucket, but I can try again. IIRC it had looked like bitbucket wanted me to pay for something, so that had stopped my research into it before I had had real need for it.


Go here:
http://scons.tigris.org/bug-submission.html

To file a bug, you'll need to create a tigris account (free)

Bitbucket is also free. (They do have pay options, but you shouldn't need any of those to clone and make fixes etc.)
You can take a look at: http://scons.org/wiki/SconsMercurialWorkflows to see how to checkout and submit patches.

Hope that helps!
-Bill

>

> Sent from my iPhone

>

> On Nov 10, 2012, at 12:52 PM, William Deegan <bill at baddogconsulting.com> wrote:

>

>> Mark,

>>

>> Firstly thanks for tracking down and fixing the issue!

>>

>> The best thing to do to ensure this doesn't get dropped is to file a bug, and do a bitbucket pull request with the fix.

>> Do you have a simple test case to reproduce the bug?

>> (New code changes require new tests to get checked into SCons)

>>

>> Thanks,

>> Bill

>> On Nov 9, 2012, at 7:19 PM, Mark Ribau <mribau at realtaentertainment.com> wrote:

>>

>>> Joined the mailing list just to get help with this possible bug. Hopefully this list is the correct one to post in for this.

>>>

>>> Steps to Reproduce:

>>> Have Aliases that each have multiple targets attached to it.

>>> Some of these individual targets are marked Precious and NoClean.

>>> Build the Aliases

>>> Clean the Aliases

>>>

>>> Result:

>>> Cleaning the Alias deletes all the targets, including the targets that are marked NoClean.

>>> Additionally, some Aliases' targets would NEVER be cleaned AT ALL, even though they were NOT marked Precious NOR NoClean.

>>>

>>> Expected Result:

>>> Cleaning the Alias correctly deletes the targets NOT marked as NoClean.

>>>

>>> I changed some code in SCons/Script/Main.py that appears to fix it though:

>>>

>>> Diff:

>>> 346,348c346,347

>>> < target = self.targets[0]

>>> < if (target.has_builder() or target.side_effect) and not target.noclean:

>>> < for t in self.targets:

>>> ---

>>> > for t in self.targets:

>>> > if (t.has_builder() or t.side_effect) and not t.noclean:

>>> 361,364c360,363

>>> < if target in SCons.Environment.CleanTargets:

>>> < files = SCons.Environment.CleanTargets[target]

>>> < for f in files:

>>> < self.fs_delete(f.abspath, str(f))

>>> ---

>>> > if t in SCons.Environment.CleanTargets:

>>> > files = SCons.Environment.CleanTargets[t]

>>> > for f in files:

>>> > self.fs_delete(f.abspath, str(f))

>>>

>>>

>>> Including all the code to make it easier:

>>>

>>> Old Version:

>>> def remove(self):

>>> target = self.targets[0]

>>> if (target.has_builder() or target.side_effect) and not target.noclean:

>>> for t in self.targets:

>>> try:

>>> removed = t.remove()

>>> except OSError, e:

>>> # An OSError may indicate something like a permissions

>>> # issue, an IOError would indicate something like

>>> # the file not existing. In either case, print a

>>> # message and keep going to try to remove as many

>>> # targets aa possible.

>>> print "scons: Could not remove '%s':" % str(t), e.strerror

>>> else:

>>> if removed:

>>> display("Removed " + str(t))

>>> if target in SCons.Environment.CleanTargets:

>>> files = SCons.Environment.CleanTargets[target]

>>> for f in files:

>>> self.fs_delete(f.abspath, str(f))

>>>

>>> New Version:

>>> def remove(self):

>>> for t in self.targets:

>>> if (t.has_builder() or t.side_effect) and not t.noclean:

>>> try:

>>> removed = t.remove()

>>> except OSError, e:

>>> # An OSError may indicate something like a permissions

>>> # issue, an IOError would indicate something like

>>> # the file not existing. In either case, print a

>>> # message and keep going to try to remove as many

>>> # targets aa possible.

>>> print "scons: Could not remove '%s':" % str(t), e.strerror

>>> else:

>>> if removed:

>>> display("Removed " + str(t))

>>> if t in SCons.Environment.CleanTargets:

>>> files = SCons.Environment.CleanTargets[t]

>>> for f in files:

>>> self.fs_delete(f.abspath, str(f))

>>>

>>>

>>>

>>> ----

>>> mark ribau

>>> software engineer

>>> _______________________________________________

>>> Scons-users mailing list

>>> Scons-users at scons.org

>>> http://four.pairlist.net/mailman/listinfo/scons-users

>>

>> _______________________________________________

>> Scons-users mailing list

>> Scons-users at scons.org

>> http://four.pairlist.net/mailman/listinfo/scons-users

> _______________________________________________

> Scons-users mailing list

> Scons-users at scons.org

> http://four.pairlist.net/mailman/listinfo/scons-users


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://four.pairlist.net/pipermail/scons-users/attachments/20121112/fd4aa146/attachment.htm>


More information about the Scons-users mailing list