From 4a2a5fd3b51f9b0c5fb0bb31f838bba3aac1f1b1 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sun, 20 Aug 2017 15:37:46 -0700 Subject: Fix Bug #2622 - AlwaysBuild()+MSVC regression. Due to AlwaysBuild'd target not being added to changed_sources. This has been fixed for a while via some changes for other issue/development. I added a unit test to cover this to src/engine/SCons/ExecutorTests.py --- src/CHANGES.txt | 2 ++ src/engine/SCons/ExecutorTests.py | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 47f7431..fa42726 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -38,6 +38,8 @@ may cause rebuilds. In no case should rebuilds not happen. - Fixed Bug #3027 - "Cross Compiling issue: cannot override ranlib" - Fixed Bug #3020 - "Download link in user guide wrong. python setup.py install --version-lib broken" - Fixed Bug #2486 - Added SetOption('silent',True) - Previously this value was not allowed to be set. + - Fixed Bug #3040 - Non-unicode character in CHANGES.txt + - Fixed Bug #2622 - AlwaysBuild + MSVC regression. From Ibrahim Esmat: - Added the capability to build Windows Store Compatible libraries that can be used diff --git a/src/engine/SCons/ExecutorTests.py b/src/engine/SCons/ExecutorTests.py index dbfb7d1..eeab3ad 100644 --- a/src/engine/SCons/ExecutorTests.py +++ b/src/engine/SCons/ExecutorTests.py @@ -74,8 +74,12 @@ class MyNode(object): self.pre_actions = pre self.post_actions = post self.missing_val = None + self.always_build = False + self.up_to_date = False + def __str__(self): return self.name + def build(self): executor = SCons.Executor.Executor(MyAction(self.pre_actions + [self.builder.action] + @@ -100,6 +104,9 @@ class MyNode(object): def disambiguate(self): return self + def is_up_to_date(self): + return self.up_to_date + class MyScanner(object): def __init__(self, prefix): self.prefix = prefix @@ -455,6 +462,24 @@ class ExecutorTestCase(unittest.TestCase): r = x.get_unignored_sources(None, [s1, s3]) assert r == [s2], list(map(str, r)) + def test_changed_sources_for_alwaysBuild(self): + """ + Ensure if a target is marked always build that the sources are always marked changed sources + :return: + """ + env = MyEnvironment() + s1 = MyNode('s1') + s2 = MyNode('s2') + t1 = MyNode('t1') + t1.up_to_date = True + t1.always_build = True + + x = SCons.Executor.Executor('b', env, [{}], [t1], [s1, s2]) + + changed_sources = x._get_changed_sources() + assert changed_sources == [s1, s2], "If target marked AlwaysBuild sources should always be marked changed" + + if __name__ == "__main__": -- cgit v0.12