Skip to content

Commit 4734372

Browse files
committed
Close python#24508: Backport the 3.5 MSBuild project files.
The old project files move to PC/VS9.0 and remain supported. VS2008 is still required to build 2.7; VS2010 (or later, plus Windows SDK 7.1) is *also* required to use the new project files.
1 parent 10c997a commit 4734372

124 files changed

Lines changed: 8504 additions & 757 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.hgeol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Lib/test/sndhdrdata/sndhdr.* = BIN
4040

4141
# The Windows readme is likely to be read in Notepad, so make it readable
4242
PCbuild/readme.txt = CRLF
43+
PC/VS9.0/readme.txt = CRLF
4344

4445
# All other files (which presumably are human-editable) are "native".
4546
# This must be the last rule!

.hgignore

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ db_home
1717
platform$
1818
pyconfig.h$
1919
python$
20+
python.bat$
2021
python.exe$
2122
reflog.txt$
2223
tags$
@@ -44,21 +45,38 @@ libpython*.so*
4445
*.pyd
4546
*.cover
4647
*~
48+
Lib/distutils/command/*.pdb
4749
Lib/lib2to3/*.pickle
4850
Lib/test/data/*
4951
Misc/*.wpu
5052
PC/python_nt*.h
5153
PC/pythonnt_rc*.h
52-
PC/*.obj
53-
PCbuild/*.exe
54+
PC/*/*.exe
55+
PC/*/*.exp
56+
PC/*/*.lib
57+
PC/*/*.bsc
58+
PC/*/*.dll
59+
PC/*/*.pdb
60+
PC/*/*.user
61+
PC/*/*.ncb
62+
PC/*/*.suo
63+
PC/*/Win32-temp-*
64+
PC/*/x64-temp-*
65+
PC/*/amd64
66+
PCbuild/*.user
67+
PCbuild/*.suo
68+
PCbuild/*.*sdf
69+
PCbuild/*-pgi
70+
PCbuild/*-pgo
71+
PCbuild/.vs
5472
PCbuild/*.dll
55-
PCbuild/*.pdb
56-
PCbuild/*.lib
5773
PCbuild/*.exp
58-
PCbuild/*.o
59-
PCbuild/*.ncb
60-
PCbuild/*.bsc
61-
PCbuild/Win32-temp-*
74+
PCbuild/*.exe
75+
PCbuild/*.ilk
76+
PCbuild/*.lib
77+
PCbuild/*.pdb
78+
PCbuild/amd64
79+
PCbuild/obj
6280
.coverage
6381
coverage/
6482
externals/

Lib/distutils/command/build_ext.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,12 @@ def finalize_options(self):
199199
else:
200200
# win-amd64 or win-ia64
201201
suffix = self.plat_name[4:]
202-
new_lib = os.path.join(sys.exec_prefix, 'PCbuild')
203-
if suffix:
204-
new_lib = os.path.join(new_lib, suffix)
205-
self.library_dirs.append(new_lib)
202+
# We could have been built in one of two places; add both
203+
for d in ('PCbuild',), ('PC', 'VS9.0'):
204+
new_lib = os.path.join(sys.exec_prefix, *d)
205+
if suffix:
206+
new_lib = os.path.join(new_lib, suffix)
207+
self.library_dirs.append(new_lib)
206208

207209
elif MSVC_VERSION == 8:
208210
self.library_dirs.append(os.path.join(sys.exec_prefix,

Lib/lib-tk/FixTk.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ def convert_path(s):
4949
prefix = os.path.join(sys.prefix,"tcl")
5050
if not os.path.exists(prefix):
5151
# devdir/externals/tcltk/lib
52-
prefix = os.path.join(sys.prefix, "externals", "tcltk", "lib")
52+
tcltk = 'tcltk'
53+
if sys.maxsize > 2**31 - 1:
54+
tcltk = 'tcltk64'
55+
prefix = os.path.join(sys.prefix, "externals", tcltk, "lib")
5356
prefix = os.path.abspath(prefix)
5457
# if this does not exist, no further search is needed
5558
if os.path.exists(prefix):

Lib/test/regrtest.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,15 @@
203203
newsoft = min(hard, max(soft, 1024*2048))
204204
resource.setrlimit(resource.RLIMIT_STACK, (newsoft, hard))
205205

206+
# Windows, Tkinter, and resetting the environment after each test don't
207+
# mix well. To alleviate test failures due to Tcl/Tk not being able to
208+
# find its library, get the necessary environment massage done once early.
209+
if sys.platform == 'win32':
210+
try:
211+
import FixTk
212+
except Exception:
213+
pass
214+
206215
# Test result constants.
207216
PASSED = 1
208217
FAILED = 0

Lib/test/test_tcl.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
# Skip this test if the _tkinter module wasn't built.
99
_tkinter = test_support.import_module('_tkinter')
1010

11-
# Make sure tkinter._fix runs to set up the environment
12-
tkinter = test_support.import_fresh_module('Tkinter')
13-
11+
import Tkinter as tkinter
1412
from Tkinter import Tcl
1513
from _tkinter import TclError
1614

Misc/NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ Library
103103
Build
104104
-----
105105

106+
- Issue #24508: Backported the MSBuild project files from Python 3.5. The
107+
backported files replace the old project files in PCbuild; the old files moved
108+
to PC/VS9.0 and remain supported.
109+
106110
- Issue #24432: Update Windows builds and OS X 10.5 installer to use OpenSSL
107111
1.0.2c.
108112

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,15 +537,15 @@
537537
Name="Header Files"
538538
>
539539
<File
540-
RelativePath="..\Modules\bsddb.h"
540+
RelativePath="..\..\Modules\bsddb.h"
541541
>
542542
</File>
543543
</Filter>
544544
<Filter
545545
Name="Source Files"
546546
>
547547
<File
548-
RelativePath="..\Modules\_bsddb.c"
548+
RelativePath="..\..\Modules\_bsddb.c"
549549
>
550550
</File>
551551
</Filter>
Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
/>
4343
<Tool
4444
Name="VCCLCompilerTool"
45-
AdditionalIncludeDirectories="..\Modules\_ctypes\libffi_msvc"
45+
AdditionalIncludeDirectories="..\..\Modules\_ctypes\libffi_msvc"
4646
/>
4747
<Tool
4848
Name="VCManagedResourceCompilerTool"
@@ -103,7 +103,7 @@
103103
/>
104104
<Tool
105105
Name="VCCLCompilerTool"
106-
AdditionalIncludeDirectories="..\Modules\_ctypes\libffi_msvc"
106+
AdditionalIncludeDirectories="..\..\Modules\_ctypes\libffi_msvc"
107107
/>
108108
<Tool
109109
Name="VCManagedResourceCompilerTool"
@@ -164,7 +164,7 @@
164164
/>
165165
<Tool
166166
Name="VCCLCompilerTool"
167-
AdditionalIncludeDirectories="..\Modules\_ctypes\libffi_msvc"
167+
AdditionalIncludeDirectories="..\..\Modules\_ctypes\libffi_msvc"
168168
/>
169169
<Tool
170170
Name="VCManagedResourceCompilerTool"
@@ -228,7 +228,7 @@
228228
/>
229229
<Tool
230230
Name="VCCLCompilerTool"
231-
AdditionalIncludeDirectories="..\Modules\_ctypes\libffi_msvc"
231+
AdditionalIncludeDirectories="..\..\Modules\_ctypes\libffi_msvc"
232232
/>
233233
<Tool
234234
Name="VCManagedResourceCompilerTool"
@@ -291,7 +291,7 @@
291291
/>
292292
<Tool
293293
Name="VCCLCompilerTool"
294-
AdditionalIncludeDirectories="..\Modules\_ctypes\libffi_msvc"
294+
AdditionalIncludeDirectories="..\..\Modules\_ctypes\libffi_msvc"
295295
/>
296296
<Tool
297297
Name="VCManagedResourceCompilerTool"
@@ -355,7 +355,7 @@
355355
/>
356356
<Tool
357357
Name="VCCLCompilerTool"
358-
AdditionalIncludeDirectories="..\Modules\_ctypes\libffi_msvc"
358+
AdditionalIncludeDirectories="..\..\Modules\_ctypes\libffi_msvc"
359359
/>
360360
<Tool
361361
Name="VCManagedResourceCompilerTool"
@@ -419,7 +419,7 @@
419419
/>
420420
<Tool
421421
Name="VCCLCompilerTool"
422-
AdditionalIncludeDirectories="..\Modules\_ctypes\libffi_msvc"
422+
AdditionalIncludeDirectories="..\..\Modules\_ctypes\libffi_msvc"
423423
/>
424424
<Tool
425425
Name="VCManagedResourceCompilerTool"
@@ -483,7 +483,7 @@
483483
/>
484484
<Tool
485485
Name="VCCLCompilerTool"
486-
AdditionalIncludeDirectories="..\Modules\_ctypes\libffi_msvc"
486+
AdditionalIncludeDirectories="..\..\Modules\_ctypes\libffi_msvc"
487487
/>
488488
<Tool
489489
Name="VCManagedResourceCompilerTool"
@@ -531,67 +531,67 @@
531531
Name="Header Files"
532532
>
533533
<File
534-
RelativePath="..\Modules\_ctypes\ctypes.h"
534+
RelativePath="..\..\Modules\_ctypes\ctypes.h"
535535
>
536536
</File>
537537
<File
538-
RelativePath="..\Modules\_ctypes\ctypes_dlfcn.h"
538+
RelativePath="..\..\Modules\_ctypes\ctypes_dlfcn.h"
539539
>
540540
</File>
541541
<File
542-
RelativePath="..\Modules\_ctypes\libffi_msvc\ffi.h"
542+
RelativePath="..\..\Modules\_ctypes\libffi_msvc\ffi.h"
543543
>
544544
</File>
545545
<File
546-
RelativePath="..\Modules\_ctypes\libffi_msvc\ffi_common.h"
546+
RelativePath="..\..\Modules\_ctypes\libffi_msvc\ffi_common.h"
547547
>
548548
</File>
549549
<File
550-
RelativePath="..\Modules\_ctypes\libffi_msvc\fficonfig.h"
550+
RelativePath="..\..\Modules\_ctypes\libffi_msvc\fficonfig.h"
551551
>
552552
</File>
553553
<File
554-
RelativePath="..\Modules\_ctypes\libffi_msvc\ffitarget.h"
554+
RelativePath="..\..\Modules\_ctypes\libffi_msvc\ffitarget.h"
555555
>
556556
</File>
557557
</Filter>
558558
<Filter
559559
Name="Source Files"
560560
>
561561
<File
562-
RelativePath="..\Modules\_ctypes\_ctypes.c"
562+
RelativePath="..\..\Modules\_ctypes\_ctypes.c"
563563
>
564564
</File>
565565
<File
566-
RelativePath="..\Modules\_ctypes\callbacks.c"
566+
RelativePath="..\..\Modules\_ctypes\callbacks.c"
567567
>
568568
</File>
569569
<File
570-
RelativePath="..\Modules\_ctypes\callproc.c"
570+
RelativePath="..\..\Modules\_ctypes\callproc.c"
571571
>
572572
</File>
573573
<File
574-
RelativePath="..\Modules\_ctypes\cfield.c"
574+
RelativePath="..\..\Modules\_ctypes\cfield.c"
575575
>
576576
</File>
577577
<File
578-
RelativePath="..\Modules\_ctypes\libffi_msvc\ffi.c"
578+
RelativePath="..\..\Modules\_ctypes\libffi_msvc\ffi.c"
579579
>
580580
</File>
581581
<File
582-
RelativePath="..\Modules\_ctypes\malloc_closure.c"
582+
RelativePath="..\..\Modules\_ctypes\malloc_closure.c"
583583
>
584584
</File>
585585
<File
586-
RelativePath="..\Modules\_ctypes\libffi_msvc\prep_cif.c"
586+
RelativePath="..\..\Modules\_ctypes\libffi_msvc\prep_cif.c"
587587
>
588588
</File>
589589
<File
590-
RelativePath="..\Modules\_ctypes\stgdict.c"
590+
RelativePath="..\..\Modules\_ctypes\stgdict.c"
591591
>
592592
</File>
593593
<File
594-
RelativePath="..\Modules\_ctypes\libffi_msvc\win32.c"
594+
RelativePath="..\..\Modules\_ctypes\libffi_msvc\win32.c"
595595
>
596596
<FileConfiguration
597597
Name="Debug|x64"
@@ -627,7 +627,7 @@
627627
</FileConfiguration>
628628
</File>
629629
<File
630-
RelativePath="..\Modules\_ctypes\libffi_msvc\win64.asm"
630+
RelativePath="..\..\Modules\_ctypes\libffi_msvc\win64.asm"
631631
>
632632
<FileConfiguration
633633
Name="Debug|Win32"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,15 +503,15 @@
503503
Name="Header Files"
504504
>
505505
<File
506-
RelativePath="..\Modules\_ctypes\_ctypes_test.h"
506+
RelativePath="..\..\Modules\_ctypes\_ctypes_test.h"
507507
>
508508
</File>
509509
</Filter>
510510
<Filter
511511
Name="Source Files"
512512
>
513513
<File
514-
RelativePath="..\Modules\_ctypes\_ctypes_test.c"
514+
RelativePath="..\..\Modules\_ctypes\_ctypes_test.c"
515515
>
516516
</File>
517517
</Filter>

0 commit comments

Comments
 (0)