Commit 334b4a34 authored by Larry Hastings's avatar Larry Hastings

Merge from 3.5.

parents 1030c10c 52e40cd9
...@@ -155,3 +155,4 @@ c0d64105463581f85d0e368e8d6e59b7fd8f12b1 v3.5.0b4 ...@@ -155,3 +155,4 @@ c0d64105463581f85d0e368e8d6e59b7fd8f12b1 v3.5.0b4
1a58b1227501e046eee13d90f113417b60843301 v3.5.0rc1 1a58b1227501e046eee13d90f113417b60843301 v3.5.0rc1
cc15d736d860303b9da90d43cd32db39bab048df v3.5.0rc2 cc15d736d860303b9da90d43cd32db39bab048df v3.5.0rc2
66ed52375df802f9d0a34480daaa8ce79fc41313 v3.5.0rc3 66ed52375df802f9d0a34480daaa8ce79fc41313 v3.5.0rc3
2d033fedfa7f1e325fd14ccdaa9cb42155da206f v3.5.0rc4
...@@ -14,6 +14,8 @@ for older versions in distutils.msvc9compiler and distutils.msvccompiler. ...@@ -14,6 +14,8 @@ for older versions in distutils.msvc9compiler and distutils.msvccompiler.
# ported to VS 2015 by Steve Dower # ported to VS 2015 by Steve Dower
import os import os
import shutil
import stat
import subprocess import subprocess
from distutils.errors import DistutilsExecError, DistutilsPlatformError, \ from distutils.errors import DistutilsExecError, DistutilsPlatformError, \
...@@ -25,7 +27,7 @@ from distutils.util import get_platform ...@@ -25,7 +27,7 @@ from distutils.util import get_platform
import winreg import winreg
from itertools import count from itertools import count
def _find_vcvarsall(): def _find_vcvarsall(plat_spec):
with winreg.OpenKeyEx( with winreg.OpenKeyEx(
winreg.HKEY_LOCAL_MACHINE, winreg.HKEY_LOCAL_MACHINE,
r"Software\Microsoft\VisualStudio\SxS\VC7", r"Software\Microsoft\VisualStudio\SxS\VC7",
...@@ -33,7 +35,7 @@ def _find_vcvarsall(): ...@@ -33,7 +35,7 @@ def _find_vcvarsall():
) as key: ) as key:
if not key: if not key:
log.debug("Visual C++ is not registered") log.debug("Visual C++ is not registered")
return None return None, None
best_version = 0 best_version = 0
best_dir = None best_dir = None
...@@ -51,14 +53,23 @@ def _find_vcvarsall(): ...@@ -51,14 +53,23 @@ def _find_vcvarsall():
best_version, best_dir = version, vc_dir best_version, best_dir = version, vc_dir
if not best_version: if not best_version:
log.debug("No suitable Visual C++ version found") log.debug("No suitable Visual C++ version found")
return None return None, None
vcvarsall = os.path.join(best_dir, "vcvarsall.bat") vcvarsall = os.path.join(best_dir, "vcvarsall.bat")
if not os.path.isfile(vcvarsall): if not os.path.isfile(vcvarsall):
log.debug("%s cannot be found", vcvarsall) log.debug("%s cannot be found", vcvarsall)
return None return None, None
vcruntime = None
vcruntime_spec = _VCVARS_PLAT_TO_VCRUNTIME_REDIST.get(plat_spec)
if vcruntime_spec:
vcruntime = os.path.join(best_dir,
vcruntime_spec.format(best_version))
if not os.path.isfile(vcruntime):
log.debug("%s cannot be found", vcruntime)
vcruntime = None
return vcvarsall return vcvarsall, vcruntime
def _get_vc_env(plat_spec): def _get_vc_env(plat_spec):
if os.getenv("DISTUTILS_USE_SDK"): if os.getenv("DISTUTILS_USE_SDK"):
...@@ -67,7 +78,7 @@ def _get_vc_env(plat_spec): ...@@ -67,7 +78,7 @@ def _get_vc_env(plat_spec):
for key, value in os.environ.items() for key, value in os.environ.items()
} }
vcvarsall = _find_vcvarsall() vcvarsall, vcruntime = _find_vcvarsall(plat_spec)
if not vcvarsall: if not vcvarsall:
raise DistutilsPlatformError("Unable to find vcvarsall.bat") raise DistutilsPlatformError("Unable to find vcvarsall.bat")
...@@ -83,13 +94,17 @@ def _get_vc_env(plat_spec): ...@@ -83,13 +94,17 @@ def _get_vc_env(plat_spec):
raise DistutilsPlatformError("Error executing {}" raise DistutilsPlatformError("Error executing {}"
.format(exc.cmd)) .format(exc.cmd))
return { env = {
key.lower(): value key.lower(): value
for key, _, value in for key, _, value in
(line.partition('=') for line in out.splitlines()) (line.partition('=') for line in out.splitlines())
if key and value if key and value
} }
if vcruntime:
env['py_vcruntime_redist'] = vcruntime
return env
def _find_exe(exe, paths=None): def _find_exe(exe, paths=None):
"""Return path to an MSVC executable program. """Return path to an MSVC executable program.
...@@ -115,6 +130,20 @@ PLAT_TO_VCVARS = { ...@@ -115,6 +130,20 @@ PLAT_TO_VCVARS = {
'win-amd64' : 'amd64', 'win-amd64' : 'amd64',
} }
# A map keyed by get_platform() return values to the file under
# the VC install directory containing the vcruntime redistributable.
_VCVARS_PLAT_TO_VCRUNTIME_REDIST = {
'x86' : 'redist\\x86\\Microsoft.VC{0}0.CRT\\vcruntime{0}0.dll',
'amd64' : 'redist\\x64\\Microsoft.VC{0}0.CRT\\vcruntime{0}0.dll',
'x86_amd64' : 'redist\\x64\\Microsoft.VC{0}0.CRT\\vcruntime{0}0.dll',
}
# A set containing the DLLs that are guaranteed to be available for
# all micro versions of this Python version. Known extension
# dependencies that are not in this set will be copied to the output
# path.
_BUNDLED_DLLS = frozenset(['vcruntime140.dll'])
class MSVCCompiler(CCompiler) : class MSVCCompiler(CCompiler) :
"""Concrete class that implements an interface to Microsoft Visual C++, """Concrete class that implements an interface to Microsoft Visual C++,
as defined by the CCompiler abstract class.""" as defined by the CCompiler abstract class."""
...@@ -189,6 +218,7 @@ class MSVCCompiler(CCompiler) : ...@@ -189,6 +218,7 @@ class MSVCCompiler(CCompiler) :
self.rc = _find_exe("rc.exe", paths) # resource compiler self.rc = _find_exe("rc.exe", paths) # resource compiler
self.mc = _find_exe("mc.exe", paths) # message compiler self.mc = _find_exe("mc.exe", paths) # message compiler
self.mt = _find_exe("mt.exe", paths) # message compiler self.mt = _find_exe("mt.exe", paths) # message compiler
self._vcruntime_redist = vc_env.get('py_vcruntime_redist', '')
for dir in vc_env.get('include', '').split(os.pathsep): for dir in vc_env.get('include', '').split(os.pathsep):
if dir: if dir:
...@@ -199,20 +229,26 @@ class MSVCCompiler(CCompiler) : ...@@ -199,20 +229,26 @@ class MSVCCompiler(CCompiler) :
self.add_library_dir(dir) self.add_library_dir(dir)
self.preprocess_options = None self.preprocess_options = None
# Use /MT[d] to build statically, then switch from libucrt[d].lib to ucrt[d].lib # If vcruntime_redist is available, link against it dynamically. Otherwise,
# use /MT[d] to build statically, then switch from libucrt[d].lib to ucrt[d].lib
# later to dynamically link to ucrtbase but not vcruntime. # later to dynamically link to ucrtbase but not vcruntime.
self.compile_options = [ self.compile_options = [
'/nologo', '/Ox', '/MT', '/W3', '/GL', '/DNDEBUG' '/nologo', '/Ox', '/W3', '/GL', '/DNDEBUG'
] ]
self.compile_options.append('/MD' if self._vcruntime_redist else '/MT')
self.compile_options_debug = [ self.compile_options_debug = [
'/nologo', '/Od', '/MTd', '/Zi', '/W3', '/D_DEBUG' '/nologo', '/Od', '/MDd', '/Zi', '/W3', '/D_DEBUG'
] ]
ldflags = [ ldflags = [
'/nologo', '/INCREMENTAL:NO', '/LTCG', '/nodefaultlib:libucrt.lib', 'ucrt.lib', '/nologo', '/INCREMENTAL:NO', '/LTCG'
] ]
if not self._vcruntime_redist:
ldflags.extend(('/nodefaultlib:libucrt.lib', 'ucrt.lib'))
ldflags_debug = [ ldflags_debug = [
'/nologo', '/INCREMENTAL:NO', '/LTCG', '/DEBUG:FULL', '/nodefaultlib:libucrtd.lib', 'ucrtd.lib', '/nologo', '/INCREMENTAL:NO', '/LTCG', '/DEBUG:FULL'
] ]
self.ldflags_exe = [*ldflags, '/MANIFEST:EMBED,ID=1'] self.ldflags_exe = [*ldflags, '/MANIFEST:EMBED,ID=1']
...@@ -446,15 +482,29 @@ class MSVCCompiler(CCompiler) : ...@@ -446,15 +482,29 @@ class MSVCCompiler(CCompiler) :
if extra_postargs: if extra_postargs:
ld_args.extend(extra_postargs) ld_args.extend(extra_postargs)
self.mkpath(os.path.dirname(output_filename)) output_dir = os.path.dirname(os.path.abspath(output_filename))
self.mkpath(output_dir)
try: try:
log.debug('Executing "%s" %s', self.linker, ' '.join(ld_args)) log.debug('Executing "%s" %s', self.linker, ' '.join(ld_args))
self.spawn([self.linker] + ld_args) self.spawn([self.linker] + ld_args)
self._copy_vcruntime(output_dir)
except DistutilsExecError as msg: except DistutilsExecError as msg:
raise LinkError(msg) raise LinkError(msg)
else: else:
log.debug("skipping %s (up-to-date)", output_filename) log.debug("skipping %s (up-to-date)", output_filename)
def _copy_vcruntime(self, output_dir):
vcruntime = self._vcruntime_redist
if not vcruntime or not os.path.isfile(vcruntime):
return
if os.path.basename(vcruntime).lower() in _BUNDLED_DLLS:
return
log.debug('Copying "%s"', vcruntime)
vcruntime = shutil.copy(vcruntime, output_dir)
os.chmod(vcruntime, stat.S_IWRITE)
def spawn(self, cmd): def spawn(self, cmd):
old_path = os.getenv('path') old_path = os.getenv('path')
try: try:
......
...@@ -16,22 +16,73 @@ class msvccompilerTestCase(support.TempdirManager, ...@@ -16,22 +16,73 @@ class msvccompilerTestCase(support.TempdirManager,
unittest.TestCase): unittest.TestCase):
def test_no_compiler(self): def test_no_compiler(self):
import distutils._msvccompiler as _msvccompiler
# makes sure query_vcvarsall raises # makes sure query_vcvarsall raises
# a DistutilsPlatformError if the compiler # a DistutilsPlatformError if the compiler
# is not found # is not found
from distutils._msvccompiler import _get_vc_env def _find_vcvarsall(plat_spec):
def _find_vcvarsall(): return None, None
return None
import distutils._msvccompiler as _msvccompiler
old_find_vcvarsall = _msvccompiler._find_vcvarsall old_find_vcvarsall = _msvccompiler._find_vcvarsall
_msvccompiler._find_vcvarsall = _find_vcvarsall _msvccompiler._find_vcvarsall = _find_vcvarsall
try: try:
self.assertRaises(DistutilsPlatformError, _get_vc_env, self.assertRaises(DistutilsPlatformError,
_msvccompiler._get_vc_env,
'wont find this version') 'wont find this version')
finally: finally:
_msvccompiler._find_vcvarsall = old_find_vcvarsall _msvccompiler._find_vcvarsall = old_find_vcvarsall
def test_compiler_options(self):
import distutils._msvccompiler as _msvccompiler
# suppress path to vcruntime from _find_vcvarsall to
# check that /MT is added to compile options
old_find_vcvarsall = _msvccompiler._find_vcvarsall
def _find_vcvarsall(plat_spec):
return old_find_vcvarsall(plat_spec)[0], None
_msvccompiler._find_vcvarsall = _find_vcvarsall
try:
compiler = _msvccompiler.MSVCCompiler()
compiler.initialize()
self.assertIn('/MT', compiler.compile_options)
self.assertNotIn('/MD', compiler.compile_options)
finally:
_msvccompiler._find_vcvarsall = old_find_vcvarsall
def test_vcruntime_copy(self):
import distutils._msvccompiler as _msvccompiler
# force path to a known file - it doesn't matter
# what we copy as long as its name is not in
# _msvccompiler._BUNDLED_DLLS
old_find_vcvarsall = _msvccompiler._find_vcvarsall
def _find_vcvarsall(plat_spec):
return old_find_vcvarsall(plat_spec)[0], __file__
_msvccompiler._find_vcvarsall = _find_vcvarsall
try:
tempdir = self.mkdtemp()
compiler = _msvccompiler.MSVCCompiler()
compiler.initialize()
compiler._copy_vcruntime(tempdir)
self.assertTrue(os.path.isfile(os.path.join(
tempdir, os.path.basename(__file__))))
finally:
_msvccompiler._find_vcvarsall = old_find_vcvarsall
def test_vcruntime_skip_copy(self):
import distutils._msvccompiler as _msvccompiler
tempdir = self.mkdtemp()
compiler = _msvccompiler.MSVCCompiler()
compiler.initialize()
dll = compiler._vcruntime_redist
self.assertTrue(os.path.isfile(dll))
compiler._copy_vcruntime(tempdir)
self.assertFalse(os.path.isfile(os.path.join(
tempdir, os.path.basename(dll))))
def test_suite(): def test_suite():
return unittest.makeSuite(msvccompilerTestCase) return unittest.makeSuite(msvccompilerTestCase)
......
...@@ -98,6 +98,9 @@ Core and Builtins ...@@ -98,6 +98,9 @@ Core and Builtins
Library Library
------- -------
- Issue #23144: Make sure that HTMLParser.feed() returns all the data, even
when convert_charrefs is True.
- Issue #24982: shutil.make_archive() with the "zip" format now adds entries - Issue #24982: shutil.make_archive() with the "zip" format now adds entries
for directories (including empty directories) in ZIP file. for directories (including empty directories) in ZIP file.
...@@ -143,6 +146,9 @@ Library ...@@ -143,6 +146,9 @@ Library
Documentation Documentation
------------- -------------
- Issue #24952: Clarify the default size argument of stack_size() in
the "threading" and "_thread" modules. Patch from Mattip.
- Issue #23725: Overhaul tempfile docs. Note deprecated status of mktemp. - Issue #23725: Overhaul tempfile docs. Note deprecated status of mktemp.
Patch from Zbigniew Jędrzejewski-Szmek. Patch from Zbigniew Jędrzejewski-Szmek.
...@@ -167,6 +173,23 @@ Build ...@@ -167,6 +173,23 @@ Build
when external libraries are not available. when external libraries are not available.
What's New in Python 3.5.0 release candidate 4?
===============================================
Release date: 2015-09-09
Library
-------
- Issue #25029: Fixes MemoryError in test_strptime.
Build
-----
- Issue #25027: Reverts partial-static build options and adds
vcruntime140.dll to Windows installation.
What's New in Python 3.5.0 release candidate 3? What's New in Python 3.5.0 release candidate 3?
=============================================== ===============================================
...@@ -186,8 +209,6 @@ Library ...@@ -186,8 +209,6 @@ Library
------- -------
- Issue #24917: time_strftime() buffer over-read. - Issue #24917: time_strftime() buffer over-read.
- Issue #23144: Make sure that HTMLParser.feed() returns all the data, even
when convert_charrefs is True.
- Issue #24748: To resolve a compatibility problem found with py2exe and - Issue #24748: To resolve a compatibility problem found with py2exe and
pywin32, imp.load_dynamic() once again ignores previously loaded modules pywin32, imp.load_dynamic() once again ignores previously loaded modules
...@@ -197,7 +218,6 @@ Library ...@@ -197,7 +218,6 @@ Library
- Issue #24635: Fixed a bug in typing.py where isinstance([], typing.Iterable) - Issue #24635: Fixed a bug in typing.py where isinstance([], typing.Iterable)
would return True once, then False on subsequent calls. would return True once, then False on subsequent calls.
- Issue #24989: Fixed buffer overread in BytesIO.readline() if a position is - Issue #24989: Fixed buffer overread in BytesIO.readline() if a position is
set beyond size. Based on patch by John Leitch. set beyond size. Based on patch by John Leitch.
......
...@@ -648,9 +648,6 @@ time_strftime(PyObject *self, PyObject *args) ...@@ -648,9 +648,6 @@ time_strftime(PyObject *self, PyObject *args)
* will be ahead of time... * will be ahead of time...
*/ */
for (i = 1024; ; i += i) { for (i = 1024; ; i += i) {
#if defined _MSC_VER && _MSC_VER >= 1400 && defined(__STDC_SECURE_LIB__)
int err;
#endif
outbuf = (time_char *)PyMem_Malloc(i*sizeof(time_char)); outbuf = (time_char *)PyMem_Malloc(i*sizeof(time_char));
if (outbuf == NULL) { if (outbuf == NULL) {
PyErr_NoMemory(); PyErr_NoMemory();
...@@ -660,10 +657,14 @@ time_strftime(PyObject *self, PyObject *args) ...@@ -660,10 +657,14 @@ time_strftime(PyObject *self, PyObject *args)
buflen = format_time(outbuf, i, fmt, &buf); buflen = format_time(outbuf, i, fmt, &buf);
_Py_END_SUPPRESS_IPH _Py_END_SUPPRESS_IPH
#if defined _MSC_VER && _MSC_VER >= 1400 && defined(__STDC_SECURE_LIB__) #if defined _MSC_VER && _MSC_VER >= 1400 && defined(__STDC_SECURE_LIB__)
err = errno; /* VisualStudio .NET 2005 does this properly */
if (buflen == 0 && errno == EINVAL) {
PyErr_SetString(PyExc_ValueError, "Invalid format string");
PyMem_Free(outbuf);
break;
}
#endif #endif
if (buflen > 0 || fmtlen == 0 || if (buflen > 0 || i >= 256 * fmtlen) {
(fmtlen > 4 && i >= 256 * fmtlen)) {
/* If the buffer is 256 times as long as the format, /* If the buffer is 256 times as long as the format,
it's probably not failing for lack of room! it's probably not failing for lack of room!
More likely, the format yields an empty result, More likely, the format yields an empty result,
...@@ -679,13 +680,6 @@ time_strftime(PyObject *self, PyObject *args) ...@@ -679,13 +680,6 @@ time_strftime(PyObject *self, PyObject *args)
break; break;
} }
PyMem_Free(outbuf); PyMem_Free(outbuf);
#if defined _MSC_VER && _MSC_VER >= 1400 && defined(__STDC_SECURE_LIB__)
/* VisualStudio .NET 2005 does this properly */
if (buflen == 0 && err == EINVAL) {
PyErr_SetString(PyExc_ValueError, "Invalid format string");
break;
}
#endif
} }
#ifdef HAVE_WCSFTIME #ifdef HAVE_WCSFTIME
PyMem_Free(format); PyMem_Free(format);
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions> <IntrinsicFunctions>true</IntrinsicFunctions>
<StringPooling>true</StringPooling> <StringPooling>true</StringPooling>
<ExceptionHandling></ExceptionHandling> <ExceptionHandling></ExceptionHandling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
<ClCompile Condition="$(Configuration) == 'Debug'"> <ClCompile Condition="$(Configuration) == 'Debug'">
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<WholeProgramOptimization>false</WholeProgramOptimization> <WholeProgramOptimization>false</WholeProgramOptimization>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
</ClCompile> </ClCompile>
<Link> <Link>
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
...@@ -57,9 +57,7 @@ ...@@ -57,9 +57,7 @@
<RandomizedBaseAddress>true</RandomizedBaseAddress> <RandomizedBaseAddress>true</RandomizedBaseAddress>
<DataExecutionPrevention>true</DataExecutionPrevention> <DataExecutionPrevention>true</DataExecutionPrevention>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalDependencies Condition="$(Configuration) == 'Debug'">ucrtd.lib;%(AdditionalDependencies)</AdditionalDependencies> <IgnoreSpecificDefaultLibraries>LIBC;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<AdditionalDependencies Condition="$(Configuration) != 'Debug'">ucrt.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreSpecificDefaultLibraries>LIBC;libucrt.lib;libucrtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<TargetMachine>MachineX86</TargetMachine> <TargetMachine>MachineX86</TargetMachine>
<TargetMachine Condition="'$(Platform)' == 'x64'">MachineX64</TargetMachine> <TargetMachine Condition="'$(Platform)' == 'x64'">MachineX64</TargetMachine>
<ProfileGuidedDatabase Condition="$(SupportPGO)">$(OutDir)$(TargetName).pgd</ProfileGuidedDatabase> <ProfileGuidedDatabase Condition="$(SupportPGO)">$(OutDir)$(TargetName).pgd</ProfileGuidedDatabase>
......
...@@ -61,8 +61,8 @@ ...@@ -61,8 +61,8 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<PropertyGroup> <PropertyGroup>
<TclOpts>ucrt</TclOpts> <TclOpts>msvcrt</TclOpts>
<TclOpts Condition="$(Configuration) == 'Debug'">symbols,ucrt</TclOpts> <TclOpts Condition="$(Configuration) == 'Debug'">symbols,msvcrt</TclOpts>
<TclDirs>INSTALLDIR="$(OutDir.TrimEnd(`\`))" INSTALL_DIR="$(OutDir.TrimEnd(`\`))"</TclDirs> <TclDirs>INSTALLDIR="$(OutDir.TrimEnd(`\`))" INSTALL_DIR="$(OutDir.TrimEnd(`\`))"</TclDirs>
<DebugFlags Condition="'$(Configuration)' == 'Debug'">DEBUGFLAGS="-wd4456 -wd4457 -wd4458 -wd4459 -wd4996"</DebugFlags> <DebugFlags Condition="'$(Configuration)' == 'Debug'">DEBUGFLAGS="-wd4456 -wd4457 -wd4458 -wd4459 -wd4996"</DebugFlags>
<NMakeBuildCommandLine>setlocal <NMakeBuildCommandLine>setlocal
......
...@@ -57,8 +57,8 @@ ...@@ -57,8 +57,8 @@
<PropertyGroup> <PropertyGroup>
<TixDirs>BUILDDIRTOP="$(BuildDirTop)" TCL_DIR="$(tclDir.TrimEnd(`\`))" TK_DIR="$(tkDir.TrimEnd(`\`))" INSTALL_DIR="$(OutDir.TrimEnd(`\`))"</TixDirs> <TixDirs>BUILDDIRTOP="$(BuildDirTop)" TCL_DIR="$(tclDir.TrimEnd(`\`))" TK_DIR="$(tkDir.TrimEnd(`\`))" INSTALL_DIR="$(OutDir.TrimEnd(`\`))"</TixDirs>
<DebugFlags Condition="'$(Configuration)' == 'Debug'">DEBUG=1 NODEBUG=0 UCRT=1 TCL_DBGX=g TK_DBGX=g</DebugFlags> <DebugFlags Condition="'$(Configuration)' == 'Debug'">DEBUG=1 NODEBUG=0 TCL_DBGX=g TK_DBGX=g</DebugFlags>
<DebugFlags Condition="'$(Configuration)' != 'Debug'">DEBUG=0 NODEBUG=1 UCRT=1</DebugFlags> <DebugFlags Condition="'$(Configuration)' != 'Debug'">DEBUG=0 NODEBUG=1</DebugFlags>
<NMakeBuildCommandLine>setlocal <NMakeBuildCommandLine>setlocal
@(ExpectedOutputs->'if not exist "%(FullPath)" goto build',' @(ExpectedOutputs->'if not exist "%(FullPath)" goto build','
') ')
......
...@@ -60,8 +60,8 @@ ...@@ -60,8 +60,8 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<PropertyGroup> <PropertyGroup>
<TkOpts>ucrt</TkOpts> <TkOpts>msvcrt</TkOpts>
<TkOpts Condition="$(Configuration) == 'Debug'">symbols,ucrt</TkOpts> <TkOpts Condition="$(Configuration) == 'Debug'">symbols,msvcrt</TkOpts>
<TkDirs>TCLDIR="$(tclDir.TrimEnd(`\`))" INSTALLDIR="$(OutDir.TrimEnd(`\`))"</TkDirs> <TkDirs>TCLDIR="$(tclDir.TrimEnd(`\`))" INSTALLDIR="$(OutDir.TrimEnd(`\`))"</TkDirs>
<DebugFlags Condition="'$(Configuration)' == 'Debug'">DEBUGFLAGS="-wd4456 -wd4457 -wd4458 -wd4459 -wd4996"</DebugFlags> <DebugFlags Condition="'$(Configuration)' == 'Debug'">DEBUGFLAGS="-wd4456 -wd4457 -wd4458 -wd4459 -wd4996"</DebugFlags>
<NMakeBuildCommandLine>setlocal <NMakeBuildCommandLine>setlocal
......
...@@ -22,15 +22,15 @@ if not defined BUILDX86 if not defined BUILDX64 (set BUILDX86=1) && (set BUILDX6 ...@@ -22,15 +22,15 @@ if not defined BUILDX86 if not defined BUILDX64 (set BUILDX86=1) && (set BUILDX6
call "%PCBUILD%env.bat" x86 call "%PCBUILD%env.bat" x86
if defined BUILDX86 ( if defined BUILDX86 (
call "%PCBUILD%build.bat" -d call "%PCBUILD%build.bat" -d -e
if errorlevel 1 goto :eof if errorlevel 1 goto :eof
call "%PCBUILD%build.bat" call "%PCBUILD%build.bat" -e
if errorlevel 1 goto :eof if errorlevel 1 goto :eof
) )
if defined BUILDX64 ( if defined BUILDX64 (
call "%PCBUILD%build.bat" -p x64 -d call "%PCBUILD%build.bat" -p x64 -d -e
if errorlevel 1 goto :eof if errorlevel 1 goto :eof
call "%PCBUILD%build.bat" -p x64 call "%PCBUILD%build.bat" -p x64 -e
if errorlevel 1 goto :eof if errorlevel 1 goto :eof
) )
......
...@@ -121,7 +121,7 @@ if not "%CERTNAME%" EQU "" ( ...@@ -121,7 +121,7 @@ if not "%CERTNAME%" EQU "" (
if not "%SKIPBUILD%" EQU "1" ( if not "%SKIPBUILD%" EQU "1" (
call "%PCBUILD%build.bat" -e -p %BUILD_PLAT% -d -t %TARGET% %CERTOPTS% call "%PCBUILD%build.bat" -e -p %BUILD_PLAT% -d -t %TARGET% %CERTOPTS%
if errorlevel 1 exit /B if errorlevel 1 exit /B
call "%PCBUILD%build.bat" -p %BUILD_PLAT% -t %TARGET% %CERTOPTS% call "%PCBUILD%build.bat" -e -p %BUILD_PLAT% -t %TARGET% %CERTOPTS%
if errorlevel 1 exit /B if errorlevel 1 exit /B
@rem build.bat turns echo back on, so we disable it again @rem build.bat turns echo back on, so we disable it again
@echo off @echo off
......
...@@ -29,6 +29,9 @@ ...@@ -29,6 +29,9 @@
<Component Id="pythonw.exe" Directory="InstallDirectory" Guid="$(var.PythonwExeComponentGuid)"> <Component Id="pythonw.exe" Directory="InstallDirectory" Guid="$(var.PythonwExeComponentGuid)">
<File Name="pythonw.exe" KeyPath="yes" /> <File Name="pythonw.exe" KeyPath="yes" />
</Component> </Component>
<Component Id="vcruntime140.dll" Directory="InstallDirectory" Guid="*">
<File Name="vcruntime140.dll" Source="!(bindpath.redist)vcruntime140.dll" KeyPath="yes" />
</Component>
</ComponentGroup> </ComponentGroup>
</Fragment> </Fragment>
......
...@@ -16,7 +16,8 @@ ...@@ -16,7 +16,8 @@
<TargetPath>$(OutputPath)\en-us\$(TargetName)$(TargetExt)</TargetPath> <TargetPath>$(OutputPath)\en-us\$(TargetName)$(TargetExt)</TargetPath>
<Arguments>"$(PythonExe)" "$(MSBuildThisFileDirectory)\make_zip.py"</Arguments> <Arguments>"$(PythonExe)" "$(MSBuildThisFileDirectory)\make_zip.py"</Arguments>
<Arguments>$(Arguments) -e -o "$(TargetPath)" -t "$(IntermediateOutputPath)\zip_$(ArchName)" -a $(ArchName)</Arguments> <Arguments>$(Arguments) -e -o "$(TargetPath)" -t "$(IntermediateOutputPath)\zip_$(ArchName)" -a $(ArchName)</Arguments>
<Environment>set DOC_FILENAME=python$(PythonVersion).chm</Environment> <Environment>set DOC_FILENAME=python$(PythonVersion).chm
set VCREDIST_PATH=$(VS140COMNTOOLS)\..\..\VC\redist\$(Platform)\Microsoft.VC140.CRT</Environment>
</PropertyGroup> </PropertyGroup>
<Target Name="_Build"> <Target Name="_Build">
......
...@@ -64,9 +64,6 @@ FULL_LAYOUT = [ ...@@ -64,9 +64,6 @@ FULL_LAYOUT = [
('Tools/', 'Tools', '**/*', include_in_tools), ('Tools/', 'Tools', '**/*', include_in_tools),
] ]
if os.getenv('DOC_FILENAME'):
FULL_LAYOUT.append(('Doc/', 'Doc/build/htmlhelp', os.getenv('DOC_FILENAME'), None))
EMBED_LAYOUT = [ EMBED_LAYOUT = [
('/', 'PCBuild/$arch', 'python*.exe', is_not_debug), ('/', 'PCBuild/$arch', 'python*.exe', is_not_debug),
('/', 'PCBuild/$arch', '*.pyd', is_not_debug), ('/', 'PCBuild/$arch', '*.pyd', is_not_debug),
...@@ -74,6 +71,12 @@ EMBED_LAYOUT = [ ...@@ -74,6 +71,12 @@ EMBED_LAYOUT = [
('python35.zip', 'Lib', '**/*', include_in_lib), ('python35.zip', 'Lib', '**/*', include_in_lib),
] ]
if os.getenv('DOC_FILENAME'):
FULL_LAYOUT.append(('Doc/', 'Doc/build/htmlhelp', os.getenv('DOC_FILENAME'), None))
if os.getenv('VCREDIST_PATH'):
FULL_LAYOUT.append(('/', os.getenv('VCREDIST_PATH'), 'vcruntime*.dll', None))
EMBED_LAYOUT.append(('/', os.getenv('VCREDIST_PATH'), 'vcruntime*.dll', None))
def copy_to_layout(target, rel_sources): def copy_to_layout(target, rel_sources):
count = 0 count = 0
......
...@@ -118,6 +118,9 @@ ...@@ -118,6 +118,9 @@
<LinkerBindInputPaths Include="$(CRTRedist)" Condition="'$(CRTRedist)' != ''"> <LinkerBindInputPaths Include="$(CRTRedist)" Condition="'$(CRTRedist)' != ''">
<BindName>redist</BindName> <BindName>redist</BindName>
</LinkerBindInputPaths> </LinkerBindInputPaths>
<LinkerBindInputPaths Include="$(VS140COMNTOOLS)\..\..\VC\redist\$(Platform)\Microsoft.VC140.CRT">
<BindName>redist</BindName>
</LinkerBindInputPaths>
</ItemGroup> </ItemGroup>
<Target Name="_ValidateMsiProps" BeforeTargets="PrepareForBuild"> <Target Name="_ValidateMsiProps" BeforeTargets="PrepareForBuild">
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment