cffi_tests.embedding.test_basic.TestBasic:test_empty
self = <distutils._msvccompiler.MSVCCompiler object at 0x000002287aeca950>
target_desc = 'executable'
objects = ['empty-test.obj', 'Release\\_empty_cffi.lib']
output_filename = 'empty-test.exe'
output_dir = 'D:\\SystemTemp\\ffi-695\\embedding\\test_empty', libraries = []
library_dirs = ['d:\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.41.34120\\ATLMFC\\lib\\x64', 'd:\\Microsoft Visual...s Kits\\10\\lib\\10.0.20348.0\\ucrt\\x64', 'C:\\Program Files (x86)\\Windows Kits\\10\\\\lib\\10.0.20348.0\\\\um\\x64']
runtime_library_dirs = [], export_symbols = None, debug = 0
extra_preargs = ['/MANIFEST'], extra_postargs = None, build_temp = ''
target_lang = None
def link(
self,
target_desc,
objects,
output_filename,
output_dir=None,
libraries=None,
library_dirs=None,
runtime_library_dirs=None,
export_symbols=None,
debug=0,
extra_preargs=None,
extra_postargs=None,
build_temp=None,
target_lang=None,
):
if not self.initialized:
self.initialize()
objects, output_dir = self._fix_object_args(objects, output_dir)
fixed_args = self._fix_lib_args(libraries, library_dirs, runtime_library_dirs)
libraries, library_dirs, runtime_library_dirs = fixed_args
if runtime_library_dirs:
self.warn(
"I don't know what to do with 'runtime_library_dirs': "
+ str(runtime_library_dirs)
)
lib_opts = gen_lib_options(self, library_dirs, runtime_library_dirs, libraries)
if output_dir is not None:
output_filename = os.path.join(output_dir, output_filename)
if self._need_link(objects, output_filename):
ldflags = self._ldflags[target_desc, debug]
export_opts = ["/EXPORT:" + sym for sym in (export_symbols or [])]
ld_args = (
ldflags + lib_opts + export_opts + objects + ['/OUT:' + output_filename]
)
# The MSVC linker generates .lib and .exp files, which cannot be
# suppressed by any linker switches. The .lib files may even be
# needed! Make sure they are generated in the temporary build
# directory. Since they have different names for debug and release
# builds, they can go into the same directory.
build_temp = os.path.dirname(objects[0])
if export_symbols is not None:
(dll_name, dll_ext) = os.path.splitext(
os.path.basename(output_filename)
)
implib_file = os.path.join(build_temp, self.library_filename(dll_name))
ld_args.append('/IMPLIB:' + implib_file)
if extra_preargs:
ld_args[:0] = extra_preargs
if extra_postargs:
ld_args.extend(extra_postargs)
output_dir = os.path.dirname(os.path.abspath(output_filename))
self.mkpath(output_dir)
try:
log.debug('Executing "%s" %s', self.linker, ' '.join(ld_args))
> self.spawn([self.linker] + ld_args)
pypy-venv\Lib\site-packages\setuptools\_distutils\_msvccompiler.py:508:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <distutils._msvccompiler.MSVCCompiler object at 0x000002287aeca950>
cmd = ['d:\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.41.34120\\bin\\HostX86\\x64\\link.exe', '/MANIFEST', '/nologo', '/INCREMENTAL:NO', '/LTCG', '/MANIFEST:EMBED,ID=1', ...]
def spawn(self, cmd):
env = dict(os.environ, PATH=self._paths)
with self._fallback_spawn(cmd, env) as fallback:
> return super().spawn(cmd, env=env)
pypy-venv\Lib\site-packages\setuptools\_distutils\_msvccompiler.py:517:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <distutils._msvccompiler.MSVCCompiler object at 0x000002287aeca950>
cmd = ['d:\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.41.34120\\bin\\HostX86\\x64\\link.exe', '/MANIFEST', '/nologo', '/INCREMENTAL:NO', '/LTCG', '/MANIFEST:EMBED,ID=1', ...]
kwargs = {'env': {'ALLUSERSPROFILE': 'C:\\ProgramData', 'APPDATA': 'C:\\Users\\matti\\AppData\\Roaming', 'ASL.LOG': 'Destination=file', 'CHOCOLATEYINSTALL': 'C:\\ProgramData\\chocolatey', ...}}
def spawn(self, cmd, **kwargs):
> spawn(cmd, dry_run=self.dry_run, **kwargs)
pypy-venv\Lib\site-packages\setuptools\_distutils\ccompiler.py:1041:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cmd = 'd:\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.41.34120\\bin\\HostX86\\x64\\link.exe'
search_path = 1, verbose = 0, dry_run = 0
env = {'ALLUSERSPROFILE': 'C:\\ProgramData', 'APPDATA': 'C:\\Users\\matti\\AppData\\Roaming', 'ASL.LOG': 'Destination=file', 'CHOCOLATEYINSTALL': 'C:\\ProgramData\\chocolatey', ...}
def spawn(cmd, search_path=1, verbose=0, dry_run=0, env=None): # noqa: C901
"""Run another program, specified as a command list 'cmd', in a new process.
'cmd' is just the argument list for the new process, ie.
cmd[0] is the program to run and cmd[1:] are the rest of its arguments.
There is no way to run a program with a name different from that of its
executable.
If 'search_path' is true (the default), the system's executable
search path will be used to find the program; otherwise, cmd[0]
must be the exact path to the executable. If 'dry_run' is true,
the command will not actually be run.
Raise DistutilsExecError if running the program fails in any way; just
return on success.
"""
# cmd is documented as a list, but just in case some code passes a tuple
# in, protect our %-formatting code against horrible death
cmd = list(cmd)
log.info(subprocess.list2cmdline(cmd))
if dry_run:
return
if search_path:
executable = find_executable(cmd[0])
if executable is not None:
cmd[0] = executable
env = env if env is not None else dict(os.environ)
if sys.platform == 'darwin':
from distutils.util import MACOSX_VERSION_VAR, get_macosx_target_ver
macosx_target_ver = get_macosx_target_ver()
if macosx_target_ver:
env[MACOSX_VERSION_VAR] = macosx_target_ver
try:
proc = subprocess.Popen(cmd, env=env)
proc.wait()
exitcode = proc.returncode
except OSError as exc:
if not DEBUG:
cmd = cmd[0]
raise DistutilsExecError(f"command {cmd!r} failed: {exc.args[-1]}") from exc
if exitcode:
if not DEBUG:
cmd = cmd[0]
> raise DistutilsExecError(f"command {cmd!r} failed with exit code {exitcode}")
E distutils.errors.DistutilsExecError: command 'd:\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.41.34120\\bin\\HostX86\\x64\\link.exe' failed with exit code 1120
pypy-venv\Lib\site-packages\setuptools\_distutils\spawn.py:68: DistutilsExecError
During handling of the above exception, another exception occurred:
self = <extra_tests.cffi_tests.embedding.test_basic.TestBasic object at 0x000002287c972bf0>
def test_empty(self):
empty_cffi = self.prepare_module('empty')
> self.compile('empty-test', [empty_cffi])
..\build\extra_tests\cffi_tests\embedding\test_basic.py:186:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
..\build\extra_tests\cffi_tests\embedding\test_basic.py:139: in compile
c.link_executable(objects + modules, name, extra_preargs=extra_preargs)
pypy-venv\Lib\site-packages\setuptools\_distutils\ccompiler.py:781: in link_executable
self.link(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <distutils._msvccompiler.MSVCCompiler object at 0x000002287aeca950>
target_desc = 'executable'
objects = ['empty-test.obj', 'Release\\_empty_cffi.lib']
output_filename = 'empty-test.exe'
output_dir = 'D:\\SystemTemp\\ffi-695\\embedding\\test_empty', libraries = []
library_dirs = ['d:\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.41.34120\\ATLMFC\\lib\\x64', 'd:\\Microsoft Visual...s Kits\\10\\lib\\10.0.20348.0\\ucrt\\x64', 'C:\\Program Files (x86)\\Windows Kits\\10\\\\lib\\10.0.20348.0\\\\um\\x64']
runtime_library_dirs = [], export_symbols = None, debug = 0
extra_preargs = ['/MANIFEST'], extra_postargs = None, build_temp = ''
target_lang = None
def link(
self,
target_desc,
objects,
output_filename,
output_dir=None,
libraries=None,
library_dirs=None,
runtime_library_dirs=None,
export_symbols=None,
debug=0,
extra_preargs=None,
extra_postargs=None,
build_temp=None,
target_lang=None,
):
if not self.initialized:
self.initialize()
objects, output_dir = self._fix_object_args(objects, output_dir)
fixed_args = self._fix_lib_args(libraries, library_dirs, runtime_library_dirs)
libraries, library_dirs, runtime_library_dirs = fixed_args
if runtime_library_dirs:
self.warn(
"I don't know what to do with 'runtime_library_dirs': "
+ str(runtime_library_dirs)
)
lib_opts = gen_lib_options(self, library_dirs, runtime_library_dirs, libraries)
if output_dir is not None:
output_filename = os.path.join(output_dir, output_filename)
if self._need_link(objects, output_filename):
ldflags = self._ldflags[target_desc, debug]
export_opts = ["/EXPORT:" + sym for sym in (export_symbols or [])]
ld_args = (
ldflags + lib_opts + export_opts + objects + ['/OUT:' + output_filename]
)
# The MSVC linker generates .lib and .exp files, which cannot be
# suppressed by any linker switches. The .lib files may even be
# needed! Make sure they are generated in the temporary build
# directory. Since they have different names for debug and release
# builds, they can go into the same directory.
build_temp = os.path.dirname(objects[0])
if export_symbols is not None:
(dll_name, dll_ext) = os.path.splitext(
os.path.basename(output_filename)
)
implib_file = os.path.join(build_temp, self.library_filename(dll_name))
ld_args.append('/IMPLIB:' + implib_file)
if extra_preargs:
ld_args[:0] = extra_preargs
if extra_postargs:
ld_args.extend(extra_postargs)
output_dir = os.path.dirname(os.path.abspath(output_filename))
self.mkpath(output_dir)
try:
log.debug('Executing "%s" %s', self.linker, ' '.join(ld_args))
self.spawn([self.linker] + ld_args)
except DistutilsExecError as msg:
> raise LinkError(msg)
E distutils.errors.LinkError: command 'd:\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.41.34120\\bin\\HostX86\\x64\\link.exe' failed with exit code 1120
pypy-venv\Lib\site-packages\setuptools\_distutils\_msvccompiler.py:510: LinkError
builder: pypy-c-jit-win-x86-64 build #2497+
test: cffi_tests.embedding.test_basic.TestBasic:test_empty