mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
bpo-45582: Fix test_embed failure during a PGO build on Windows (GH-30014)
This defines VPATH differently in PGO instrumentation builds, to account for a different default output directory. It also adds sys._vpath on Windows to make the value available to sysconfig so that it can be used in tests.
This commit is contained in:
parent
036bbb1d1b
commit
3f398a77d3
7 changed files with 23 additions and 7 deletions
|
@ -1300,11 +1300,16 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase):
|
|||
def test_init_pybuilddir_win32(self):
|
||||
# Test path configuration with pybuilddir.txt configuration file
|
||||
|
||||
with self.tmpdir_with_python(r'PCbuild\arch') as tmpdir:
|
||||
vpath = sysconfig.get_config_var("VPATH")
|
||||
subdir = r'PCbuild\arch'
|
||||
if os.path.normpath(vpath).count(os.sep) == 2:
|
||||
subdir = os.path.join(subdir, 'instrumented')
|
||||
|
||||
with self.tmpdir_with_python(subdir) as tmpdir:
|
||||
# The prefix is dirname(executable) + VPATH
|
||||
prefix = os.path.normpath(os.path.join(tmpdir, r'..\..'))
|
||||
prefix = os.path.normpath(os.path.join(tmpdir, vpath))
|
||||
# The stdlib dir is dirname(executable) + VPATH + 'Lib'
|
||||
stdlibdir = os.path.normpath(os.path.join(tmpdir, r'..\..\Lib'))
|
||||
stdlibdir = os.path.normpath(os.path.join(tmpdir, vpath, 'Lib'))
|
||||
|
||||
filename = os.path.join(tmpdir, 'pybuilddir.txt')
|
||||
with open(filename, "w", encoding="utf8") as fp:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue