From 69dc14517eefbc92326d88f45002a7ae0ca7b3b7 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Fri, 22 Feb 2013 15:05:22 -0800 Subject: Raised deprecated python version to be anything less than 2.7 to prep for moving the required version to 2.7 after the next major release --- src/engine/SCons/Script/Main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/SCons/Script/Main.py b/src/engine/SCons/Script/Main.py index 2524ab0..e379a39 100644 --- a/src/engine/SCons/Script/Main.py +++ b/src/engine/SCons/Script/Main.py @@ -11,7 +11,7 @@ it goes here. """ unsupported_python_version = (2, 3, 0) -deprecated_python_version = (2, 4, 0) +deprecated_python_version = (2, 7, 0) # __COPYRIGHT__ # -- cgit v0.12 From ea3cb031a0cdb496877bb22a65d2d5f6df6fdf14 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Tue, 9 Apr 2013 15:33:15 -0700 Subject: TARGET_OS|ARCH should never be defaulted to HOST_OS|ARCH. This makes it impossible to detect if the user specified a default. Tools should have this information available to do the appropriate thing for the specified target, and if not present use reasonable sequece of defaults to try --- src/engine/SCons/Environment.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/SCons/Environment.py b/src/engine/SCons/Environment.py index 8cc033e..55a8206 100644 --- a/src/engine/SCons/Environment.py +++ b/src/engine/SCons/Environment.py @@ -966,8 +966,8 @@ class Base(SubstitutionEnvironment): self._dict['HOST_ARCH'] = self._dict.get('HOST_ARCH',None) # Now set defaults for TARGET_{OS|ARCH} - self._dict['TARGET_OS'] = self._dict.get('HOST_OS',None) - self._dict['TARGET_ARCH'] = self._dict.get('HOST_ARCH',None) + self._dict['TARGET_OS'] = self._dict.get('TARGET_OS',None) + self._dict['TARGET_ARCH'] = self._dict.get('TARGET_ARCH',None) # Apply the passed-in and customizable variables to the -- cgit v0.12 From 58f7387b4eaf8a206edd765160715f644e10d3ab Mon Sep 17 00:00:00 2001 From: William Deegan Date: Wed, 10 Apr 2013 23:35:53 -0700 Subject: should resolve issues with VS2012 (and probably VS2010) on 64(and probably 32)bit win. Addressing at least bugs 2883 and 2817 --- src/engine/SCons/Tool/MSCommon/common.py | 17 +++++++++++++++-- src/engine/SCons/Tool/MSCommon/vc.py | 24 ++++++++++++++++++++---- 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/src/engine/SCons/Tool/MSCommon/common.py b/src/engine/SCons/Tool/MSCommon/common.py index 4f8ee8c..3d220ae 100644 --- a/src/engine/SCons/Tool/MSCommon/common.py +++ b/src/engine/SCons/Tool/MSCommon/common.py @@ -120,6 +120,13 @@ def normalize_env(env, keys, force=False): if k in os.environ and (force or not k in normenv): normenv[k] = os.environ[k].encode('mbcs') + sys32_dir = os.path.join(os.environ.get("SystemRoot", os.environ.get("windir",r"C:\Windows\system32")),"System32") + + if sys32_dir not in normenv['PATH']: + normenv['PATH'] = normenv['PATH'] + os.pathsep + sys32_dir + + debug("PATH: %s"%normenv['PATH']) + return normenv def get_output(vcbat, args = None, env = None): @@ -136,8 +143,9 @@ def get_output(vcbat, args = None, env = None): # settings in vs.py. vars = [ 'COMSPEC', - 'VS110COMNTOOLS', - 'VS100COMNTOOLS', +# Still set, but setup script will discard these if registry has values. +# 'VS110COMNTOOLS', +# 'VS100COMNTOOLS', 'VS90COMNTOOLS', 'VS80COMNTOOLS', 'VS71COMNTOOLS', @@ -166,6 +174,11 @@ def get_output(vcbat, args = None, env = None): # and won't work under Pythons not built with threading. stdout = popen.stdout.read() stderr = popen.stderr.read() + + # Extra debug logic, uncomment if necessar +# debug('get_output():stdout:%s'%stdout) +# debug('get_output():stderr:%s'%stderr) + if stderr: # TODO: find something better to do with stderr; # this at least prevents errors from getting swallowed. diff --git a/src/engine/SCons/Tool/MSCommon/vc.py b/src/engine/SCons/Tool/MSCommon/vc.py index a3a8952..1266ee8 100644 --- a/src/engine/SCons/Tool/MSCommon/vc.py +++ b/src/engine/SCons/Tool/MSCommon/vc.py @@ -81,6 +81,7 @@ _ARCH_TO_CANONICAL = { "itanium" : "ia64", "x86" : "x86", "x86_64" : "amd64", + "x86_amd64" : "x86_amd64", # Cross compile to 64 bit from 32bits } # Given a (host, target) tuple, return the argument for the bat file. Both host @@ -88,6 +89,7 @@ _ARCH_TO_CANONICAL = { _HOST_TARGET_ARCH_TO_BAT_ARCH = { ("x86", "x86"): "x86", ("x86", "amd64"): "x86_amd64", + ("amd64", "x86_amd64"): "x86_amd64", # This is present in (at least) VS2012 express ("amd64", "amd64"): "amd64", ("amd64", "x86"): "x86", ("x86", "ia64"): "x86_ia64" @@ -357,13 +359,23 @@ def msvc_find_valid_batch_script(env,version): # target platform (host_platform, target_platform,req_target_platform) = get_host_target(env) - # If the user hasn't specifically requested a TARGET_ARCH, and - # The TARGET_ARCH is amd64 then also try 32 bits if there are no viable - # 64 bit tools installed try_target_archs = [target_platform] - if not req_target_platform and target_platform in ('amd64','x86_64'): + debug("msvs_find_valid_batch_script(): req_target_platform %s target_platform:%s"%(req_target_platform,target_platform)) + + # VS2012 has a "cross compile" environment to build 64 bit + # with x86_amd64 as the argument to the batch setup script + if req_target_platform in ('amd64','x86_64'): + try_target_archs.append('x86_amd64') + elif not req_target_platform and target_platform in ['amd64','x86_64']: + # There may not be "native" amd64, but maybe "cross" x86_amd64 tools + try_target_archs.append('x86_amd64') + # If the user hasn't specifically requested a TARGET_ARCH, and + # The TARGET_ARCH is amd64 then also try 32 bits if there are no viable + # 64 bit tools installed try_target_archs.append('x86') + debug("msvs_find_valid_batch_script(): host_platform: %s try_target_archs:%s"%(host_platform, try_target_archs)) + d = None for tp in try_target_archs: # Set to current arch. @@ -399,6 +411,7 @@ def msvc_find_valid_batch_script(env,version): except BatchFileExecutionError, e: debug('vc.py:msvc_find_valid_batch_script() use_script 3: failed running VC script %s: %s: Error:%s'%(repr(vc_script),arg,e)) vc_script=None + continue if not vc_script and sdk_script: debug('vc.py:msvc_find_valid_batch_script() use_script 4: trying sdk script: %s'%(sdk_script)) try: @@ -409,6 +422,9 @@ def msvc_find_valid_batch_script(env,version): elif not vc_script and not sdk_script: debug('vc.py:msvc_find_valid_batch_script() use_script 6: Neither VC script nor SDK script found') continue + + debug("vc.py:msvc_find_valid_batch_script() Found a working script/target: %s %s"%(repr(sdk_script),arg)) + break # We've found a working target_platform, so stop looking # If we cannot find a viable installed compiler, reset the TARGET_ARCH # To it's initial value -- cgit v0.12 From 08f0348e313d03a65e30f16c049c6a70faa0abf8 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Thu, 11 Apr 2013 15:20:24 -0700 Subject: added text to changes.txt for this set of changes resolving some issues with MSVC and TARGET_ARCH/HOST_ARCH for MSVC --- src/CHANGES.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 16cfa3a..e4ca531 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -4,6 +4,17 @@ Change Log +RELEASE 2.3.1.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE + + From William Deegan: + - VS2012 & VS2010 Resolve initialization issues by adding path to reg.exe + in shell used to run batch files. + - MSVC Support fixed defaulting TARGET_ARCH to HOST_ARCH. It should be + None if not explicitly set. + - MSVC Fixed issue where if more than one Architectures compilers are + detected, it would take the last one found, and not the first. + + RELEASE 2.X.X - From Anatoly Techtonik: -- cgit v0.12