Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
85e102a2
Unverified
Kaydet (Commit)
85e102a2
authored
Şub 05, 2019
tarafından
Steve Dower
Kaydeden (comit)
GitHub
Şub 05, 2019
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-35299: Fixed sysconfig and distutils during PGO profiling (GH-11744)
üst
69091cb4
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
40 additions
and
14 deletions
+40
-14
build_ext.py
Lib/distutils/command/build_ext.py
+3
-2
sysconfig.py
Lib/distutils/sysconfig.py
+19
-6
test_build_ext.py
Lib/distutils/tests/test_build_ext.py
+4
-2
sysconfig.py
Lib/sysconfig.py
+10
-3
2019-02-02-14-47-12.bpo-35299.1rgEzd.rst
...S.d/next/Windows/2019-02-02-14-47-12.bpo-35299.1rgEzd.rst
+2
-0
dev.wixproj
Tools/msi/dev/dev.wixproj
+2
-1
No files found.
Lib/distutils/command/build_ext.py
Dosyayı görüntüle @
85e102a2
...
...
@@ -161,9 +161,10 @@ class build_ext(Command):
# Put the Python "system" include dir at the end, so that
# any local include dirs take precedence.
self
.
include_dirs
.
append
(
py_include
)
self
.
include_dirs
.
extend
(
py_include
.
split
(
os
.
path
.
pathsep
)
)
if
plat_py_include
!=
py_include
:
self
.
include_dirs
.
append
(
plat_py_include
)
self
.
include_dirs
.
extend
(
plat_py_include
.
split
(
os
.
path
.
pathsep
))
self
.
ensure_string_list
(
'libraries'
)
self
.
ensure_string_list
(
'link_objects'
)
...
...
Lib/distutils/sysconfig.py
Dosyayı görüntüle @
85e102a2
...
...
@@ -29,9 +29,7 @@ if "_PYTHON_PROJECT_BASE" in os.environ:
project_base
=
os
.
path
.
abspath
(
os
.
environ
[
"_PYTHON_PROJECT_BASE"
])
else
:
project_base
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
sys
.
executable
))
if
(
os
.
name
==
'nt'
and
project_base
.
lower
()
.
endswith
((
'
\\
pcbuild
\\
win32'
,
'
\\
pcbuild
\\
amd64'
))):
project_base
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
project_base
))
# python_build: (Boolean) if true, we're either building Python or
# building an extension with an un-installed Python, so we use
...
...
@@ -41,16 +39,26 @@ def _is_python_source_dir(d):
if
os
.
path
.
isfile
(
os
.
path
.
join
(
d
,
"Modules"
,
fn
)):
return
True
return
False
_sys_home
=
getattr
(
sys
,
'_home'
,
None
)
if
(
_sys_home
and
os
.
name
==
'nt'
and
_sys_home
.
lower
()
.
endswith
((
'
\\
pcbuild
\\
win32'
,
'
\\
pcbuild
\\
amd64'
))):
_sys_home
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
_sys_home
))
if
os
.
name
==
'nt'
:
def
_fix_pcbuild
(
d
):
if
d
and
os
.
path
.
normcase
(
d
)
.
startswith
(
os
.
path
.
normcase
(
os
.
path
.
join
(
PREFIX
,
"PCbuild"
))):
return
PREFIX
return
d
project_base
=
_fix_pcbuild
(
project_base
)
_sys_home
=
_fix_pcbuild
(
_sys_home
)
def
_python_build
():
if
_sys_home
:
return
_is_python_source_dir
(
_sys_home
)
return
_is_python_source_dir
(
project_base
)
python_build
=
_python_build
()
# Calculate the build qualifier flags if they are defined. Adding the flags
# to the include and lib directories only makes sense for an installation, not
# an in-source build.
...
...
@@ -99,6 +107,11 @@ def get_python_inc(plat_specific=0, prefix=None):
python_dir
=
'python'
+
get_python_version
()
+
build_flags
return
os
.
path
.
join
(
prefix
,
"include"
,
python_dir
)
elif
os
.
name
==
"nt"
:
if
python_build
:
# Include both the include and PC dir to ensure we can find
# pyconfig.h
return
(
os
.
path
.
join
(
prefix
,
"include"
)
+
os
.
path
.
pathsep
+
os
.
path
.
join
(
prefix
,
"PC"
))
return
os
.
path
.
join
(
prefix
,
"include"
)
else
:
raise
DistutilsPlatformError
(
...
...
Lib/distutils/tests/test_build_ext.py
Dosyayı görüntüle @
85e102a2
...
...
@@ -177,10 +177,12 @@ class BuildExtTestCase(TempdirManager,
cmd
.
finalize_options
()
py_include
=
sysconfig
.
get_python_inc
()
self
.
assertIn
(
py_include
,
cmd
.
include_dirs
)
for
p
in
py_include
.
split
(
os
.
path
.
pathsep
):
self
.
assertIn
(
p
,
cmd
.
include_dirs
)
plat_py_include
=
sysconfig
.
get_python_inc
(
plat_specific
=
1
)
self
.
assertIn
(
plat_py_include
,
cmd
.
include_dirs
)
for
p
in
plat_py_include
.
split
(
os
.
path
.
pathsep
):
self
.
assertIn
(
p
,
cmd
.
include_dirs
)
# make sure cmd.libraries is turned into a list
# if it's a string
...
...
Lib/sysconfig.py
Dosyayı görüntüle @
85e102a2
...
...
@@ -125,9 +125,16 @@ def _is_python_source_dir(d):
return
False
_sys_home
=
getattr
(
sys
,
'_home'
,
None
)
if
(
_sys_home
and
os
.
name
==
'nt'
and
_sys_home
.
lower
()
.
endswith
((
'
\\
pcbuild
\\
win32'
,
'
\\
pcbuild
\\
amd64'
))):
_sys_home
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
_sys_home
))
if
os
.
name
==
'nt'
:
def
_fix_pcbuild
(
d
):
if
d
and
os
.
path
.
normcase
(
d
)
.
startswith
(
os
.
path
.
normcase
(
os
.
path
.
join
(
_PREFIX
,
"PCbuild"
))):
return
_PREFIX
return
d
_PROJECT_BASE
=
_fix_pcbuild
(
_PROJECT_BASE
)
_sys_home
=
_fix_pcbuild
(
_sys_home
)
def
is_python_build
(
check_home
=
False
):
if
check_home
and
_sys_home
:
return
_is_python_source_dir
(
_sys_home
)
...
...
Misc/NEWS.d/next/Windows/2019-02-02-14-47-12.bpo-35299.1rgEzd.rst
0 → 100644
Dosyayı görüntüle @
85e102a2
Fix sysconfig detection of the source directory and distutils handling of
pyconfig.h during PGO profiling
Tools/msi/dev/dev.wixproj
Dosyayı görüntüle @
85e102a2
...
...
@@ -21,7 +21,8 @@
<EmbeddedResource
Include=
"*.wxl"
/>
</ItemGroup>
<ItemGroup>
<InstallFiles
Include=
"$(PySourcePath)include\**\*.h"
>
<InstallFiles
Include=
"$(PySourcePath)include\**\*.h"
Exclude=
"$(PySourcePath)include\pyconfig.h"
>
<SourceBase>
$(PySourcePath)
</SourceBase>
<Source>
!(bindpath.src)
</Source>
<TargetBase>
$(PySourcePath)
</TargetBase>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment