Issue #21643: Updated test and fixed logic bug in lib64 symlink creation.
This commit is contained in:
parent
2f78b84c47
commit
b9b965f6dd
|
@ -203,13 +203,18 @@ class BasicTest(BaseTest):
|
||||||
"""
|
"""
|
||||||
Test upgrading an existing environment directory.
|
Test upgrading an existing environment directory.
|
||||||
"""
|
"""
|
||||||
builder = venv.EnvBuilder(upgrade=True)
|
# See Issue #21643: the loop needs to run twice to ensure
|
||||||
|
# that everything works on the upgrade (the first run just creates
|
||||||
|
# the venv).
|
||||||
|
for upgrade in (False, True):
|
||||||
|
builder = venv.EnvBuilder(upgrade=upgrade)
|
||||||
self.run_with_capture(builder.create, self.env_dir)
|
self.run_with_capture(builder.create, self.env_dir)
|
||||||
self.isdir(self.bindir)
|
self.isdir(self.bindir)
|
||||||
self.isdir(self.include)
|
self.isdir(self.include)
|
||||||
self.isdir(*self.lib)
|
self.isdir(*self.lib)
|
||||||
fn = self.get_env_file(self.bindir, self.exe)
|
fn = self.get_env_file(self.bindir, self.exe)
|
||||||
if not os.path.exists(fn): # diagnostics for Windows buildbot failures
|
if not os.path.exists(fn):
|
||||||
|
# diagnostics for Windows buildbot failures
|
||||||
bd = self.get_env_file(self.bindir)
|
bd = self.get_env_file(self.bindir)
|
||||||
print('Contents of %r:' % bd)
|
print('Contents of %r:' % bd)
|
||||||
print(' %r' % os.listdir(bd))
|
print(' %r' % os.listdir(bd))
|
||||||
|
|
|
@ -30,7 +30,6 @@ optional arguments:
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import struct
|
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import types
|
import types
|
||||||
|
@ -140,10 +139,11 @@ class EnvBuilder:
|
||||||
create_if_needed(path)
|
create_if_needed(path)
|
||||||
create_if_needed(libpath)
|
create_if_needed(libpath)
|
||||||
# Issue 21197: create lib64 as a symlink to lib on 64-bit non-OS X POSIX
|
# Issue 21197: create lib64 as a symlink to lib on 64-bit non-OS X POSIX
|
||||||
if ((struct.calcsize('P') == 8) and (os.name == 'posix') and
|
if ((sys.maxsize > 2**32) and (os.name == 'posix') and
|
||||||
(sys.platform != 'darwin')):
|
(sys.platform != 'darwin')):
|
||||||
p = os.path.join(env_dir, 'lib')
|
p = os.path.join(env_dir, 'lib')
|
||||||
link_path = os.path.join(env_dir, 'lib64')
|
link_path = os.path.join(env_dir, 'lib64')
|
||||||
|
if not os.path.exists(link_path): # Issue #21643
|
||||||
os.symlink(p, link_path)
|
os.symlink(p, link_path)
|
||||||
context.bin_path = binpath = os.path.join(env_dir, binname)
|
context.bin_path = binpath = os.path.join(env_dir, binname)
|
||||||
context.bin_name = binname
|
context.bin_name = binname
|
||||||
|
|
Loading…
Reference in New Issue