From abbf850d56bad3d08a15741c94e7ca67f4db26fb Mon Sep 17 00:00:00 2001 From: DietmarSchwertberger Date: Sun, 6 Dec 2015 21:34:45 +0100 Subject: [PATCH 1/5] Add support for Visual Studio 2015 and encoding issues Replace 'touch' command with Python implementation to reduce dependency on cygwin. --- buildtools/config.py | 4 +++- wscript | 11 ++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/buildtools/config.py b/buildtools/config.py index 1232afe5..ff947ea8 100644 --- a/buildtools/config.py +++ b/buildtools/config.py @@ -789,7 +789,7 @@ def runcmd(cmd, getOutput=False, echoCmd=True, fatal=True): if getOutput: output = sp.stdout.read() if sys.version_info > (3,): - output = output.decode('utf-8') # TODO: is utf-8 okay here? + output = output.decode('utf-8', 'ignore') # TODO: is utf-8 okay here? output = output.rstrip() rval = sp.wait() @@ -850,6 +850,8 @@ def getVisCVersion(): return '90' if 'Version 16' in text: return '100' + if 'Version 19' in text: + return '140' # TODO: Add more tests to get the other versions... else: return 'FIXME' diff --git a/wscript b/wscript index e242bfee..f80e94e7 100644 --- a/wscript +++ b/wscript @@ -68,12 +68,8 @@ def configure(conf): # version. We have a chicken-egg problem here. The compiler needs to # be selected before the Python stuff can be configured, but we need # Python to know what version of the compiler to use. - # TODO: Fix this - msvc_version = '9.0' #conf.options.msvc_ver - if conf.options.python and ('33' in conf.options.python or - '34' in conf.options.python): - msvc_version = '10.0' - + import distutils.msvc9compiler + msvc_version = str( distutils.msvc9compiler.get_build_version() ) conf.env['MSVC_VERSIONS'] = ['msvc ' + msvc_version] conf.env['MSVC_TARGETS'] = [conf.options.msvc_arch] conf.load('msvc') @@ -616,7 +612,8 @@ def copyFileToPkg(task): from buildtools.config import opj src = task.inputs[0].abspath() tgt = task.outputs[0].abspath() - task.exec_command('touch %s' % tgt) + #task.exec_command('touch %s' % tgt) + open(tgt, "wb").close() # 'touch' tgt = opj(cfg.PKGDIR, os.path.basename(src)) copy_file(src, tgt, verbose=1) return 0 From f679024027e84cafa4ef59da9e67cbdcca2e3f0d Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sun, 28 Feb 2016 00:45:24 -0800 Subject: [PATCH 2/5] Use cp1252 encoding on Windows for cmd output --- buildtools/config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/buildtools/config.py b/buildtools/config.py index ff947ea8..53c60d3c 100644 --- a/buildtools/config.py +++ b/buildtools/config.py @@ -787,9 +787,10 @@ def runcmd(cmd, getOutput=False, echoCmd=True, fatal=True): output = None if getOutput: + outputEncoding = 'cp1252' if sys.platform == 'win32' else 'utf-8' output = sp.stdout.read() if sys.version_info > (3,): - output = output.decode('utf-8', 'ignore') # TODO: is utf-8 okay here? + output = output.decode(outputEncoding) output = output.rstrip() rval = sp.wait() From 40e6a5021917be878d00f2132919cc7b361b1243 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sun, 28 Feb 2016 00:45:54 -0800 Subject: [PATCH 3/5] Drop Py33 build on Windows, add Py35. --- buildbot/master.cfg | 48 ++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/buildbot/master.cfg b/buildbot/master.cfg index fe9bcf9d..a11ec22a 100644 --- a/buildbot/master.cfg +++ b/buildbot/master.cfg @@ -89,11 +89,11 @@ c['schedulers'].append( SingleBranchScheduler( change_filter=ChangeFilter(branch=phoenixGitBranch), treeStableTimer=30, builderNames=["build-win32-py27", - "build-win32-py33", "build-win32-py34", + "build-win32-py35", "build-win64-py27", - "build-win64-py33", "build-win64-py34", + "build-win64-py35", "build-osx-py27", "build-osx-py34", "build-osx-py35", @@ -111,11 +111,11 @@ c['schedulers'].append( Nightly( "dist-osx-py34", "dist-osx-py35", "dist-win32-py27", - "dist-win32-py33", "dist-win32-py34", + "dist-win32-py35", "dist-win64-py27", - "dist-win64-py33", "dist-win64-py34", + "dist-win64-py35", ])) c['schedulers'].append( Nightly( @@ -128,11 +128,11 @@ c['schedulers'].append( Nightly( c['schedulers'].append( ForceScheduler( name='sched-force', builderNames=["build-win32-py27", - "build-win32-py33", "build-win32-py34", + "build-win32-py35", "build-win64-py27", - "build-win64-py33", "build-win64-py34", + "build-win64-py35", "build-osx-py27", "build-osx-py34", "build-osx-py35", @@ -142,11 +142,11 @@ c['schedulers'].append( ForceScheduler( "dist-osx-py34", "dist-osx-py35", "dist-win32-py27", - "dist-win32-py33", "dist-win32-py34", + "dist-win32-py35", "dist-win64-py27", - "dist-win64-py33", "dist-win64-py34", + "dist-win64-py35", "build-docs", ])) @@ -247,26 +247,26 @@ c['builders'] = [ slavenames=["win7-py27"], factory=makeFactory('win32', pyVer='2.7')), - BuilderConfig(name="build-win32-py33", - slavenames=["win7-py27"], - factory=makeFactory('win32', pyVer='3.3')), - BuilderConfig(name="build-win32-py34", slavenames=["win7-py27"], factory=makeFactory('win32', pyVer='3.4')), + BuilderConfig(name="build-win32-py35", + slavenames=["win7-py27"], + factory=makeFactory('win32', pyVer='3.5')), + BuilderConfig(name="build-win64-py27", slavenames=["win7-py27"], factory=makeFactory('win64', pyVer='2.7')), - BuilderConfig(name="build-win64-py33", - slavenames=["win7-py27"], - factory=makeFactory('win64', pyVer='3.3')), - BuilderConfig(name="build-win64-py34", slavenames=["win7-py27"], factory=makeFactory('win64', pyVer='3.4')), + BuilderConfig(name="build-win64-py35", + slavenames=["win7-py27"], + factory=makeFactory('win64', pyVer='3.5')), + BuilderConfig(name="build-gtk-py27", @@ -302,26 +302,26 @@ c['builders'] = [ slavenames=["win7-py27"], factory=makeFactory('win32', 'dist', pyVer='2.7')), - BuilderConfig(name="dist-win32-py33", - slavenames=["win7-py27"], - factory=makeFactory('win32', 'dist', pyVer='3.3')), - BuilderConfig(name="dist-win32-py34", slavenames=["win7-py27"], factory=makeFactory('win32', 'dist', pyVer='3.4')), + BuilderConfig(name="dist-win32-py35", + slavenames=["win7-py27"], + factory=makeFactory('win32', 'dist', pyVer='3.5')), + BuilderConfig(name="dist-win64-py27", slavenames=["win7-py27"], factory=makeFactory('win64', 'dist', pyVer='2.7')), - BuilderConfig(name="dist-win64-py33", - slavenames=["win7-py27"], - factory=makeFactory('win64', 'dist', pyVer='3.3')), - BuilderConfig(name="dist-win64-py34", slavenames=["win7-py27"], factory=makeFactory('win64', 'dist', pyVer='3.4')), + BuilderConfig(name="dist-win64-py35", + slavenames=["win7-py27"], + factory=makeFactory('win64', 'dist', pyVer='3.5')), + ] From 5a2ce07014c357cef8515696525d7957c4ca6632 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sun, 28 Feb 2016 22:37:21 -0800 Subject: [PATCH 4/5] Add compiler version support for VisStudio 2015 --- buildtools/build_wxwidgets.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/buildtools/build_wxwidgets.py b/buildtools/build_wxwidgets.py index 14129303..a991c371 100644 --- a/buildtools/build_wxwidgets.py +++ b/buildtools/build_wxwidgets.py @@ -71,6 +71,8 @@ def getVisCVersion(): return '90' if 'Version 16' in text: return '100' + if 'Version 19' in text: + return '140' # TODO: Add more tests to get the other versions... else: return 'FIXME' From 73e5622e542c99f6f729b55f477ebaa2ae07e8f6 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sun, 28 Feb 2016 22:37:54 -0800 Subject: [PATCH 5/5] Fix loose version check --- demo/Main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo/Main.py b/demo/Main.py index 40f392f3..48eb155b 100644 --- a/demo/Main.py +++ b/demo/Main.py @@ -2927,7 +2927,7 @@ class MyApp(wx.App, wx.lib.mixins.inspection.InspectionMixin): def OnInit(self): # Check runtime version - if LooseVersion(version.VERSION_STRING) >= LooseVersion(wx.VERSION_STRING): + if LooseVersion(version.VERSION_STRING) != LooseVersion(wx.VERSION_STRING): wx.MessageBox(caption="Warning", message="You're using version %s of wxPython, but this copy of the demo was written for version %s.\n" "There may be some version incompatibilities..."