memory/gctransform/test/test_boehm.py::TestLLInterpedBoehm::()::test_str
self = <rpython.memory.gctransform.test.test_boehm.TestLLInterpedBoehm instance at 0x0000000118de07a0>
def test_str(self):
from rpython.annotator.model import SomeBool
def f(flag):
if flag:
x = 'a'
else:
x = 'brrrrrrr'
return len(x + 'a')
> llinterp, graph = self.llinterpreter_for_transformed_graph(f, [SomeBool()])
memory/gctransform/test/test_transform.py:84:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
memory/gctransform/test/test_transform.py:21: in llinterpreter_for_transformed_graph
cbuild.build_database()
translator/c/genc.py:137: in build_database
self.collect_compilation_info(db)
translator/c/genc.py:147: in collect_compilation_info
self.merge_eci(db.gcpolicy.compilation_info())
translator/c/gc.py:198: in compilation_info
eci = eci.merge(configure_boehm())
rtyper/tool/rffi_platform.py:884: in configure_boehm
symbol='GC_init')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
name = 'gc'
eci = <ExternalCompilationInfo (pre_include_bits=(), includes=('gc/gc.h',), include_...testonly_libraries=(), use_cpp_linker=False, platform=<Darwin_arm64 cc=clang>)>
configurations = [{}], symbol = 'GC_init', _cache = {}
def configure_external_library(name, eci, configurations,
symbol=None, _cache={}):
"""try to find the external library.
On Unix, this simply tests and returns the given eci.
On Windows, various configurations may be tried to compile the
given eci object. These configurations are a list of dicts,
containing:
- prefix: if an absolute path, will prefix each include and
library directories. If a relative path, the external
directory is searched for directories which names start
with the prefix. The last one in alphabetical order
chosen, and becomes the prefix.
- include_dir: prefix + include_dir is added to the include directories
- library_dir: prefix + library_dir is added to the library directories
"""
if sys.platform != 'win32':
configurations = []
key = (name, eci)
try:
return _cache[key]
except KeyError:
last_error = None
# Always try the default configuration
if {} not in configurations:
configurations.append({})
for configuration in configurations:
prefix = configuration.get('prefix', '')
include_dir = configuration.get('include_dir', '')
library_dir = configuration.get('library_dir', '')
if prefix and not os.path.isabs(prefix):
import glob
entries = glob.glob(str(PYPY_EXTERNAL_DIR.join(prefix + '*')))
if entries:
# Get last version
prefix = sorted(entries)[-1]
else:
continue
include_dir = os.path.join(prefix, include_dir)
library_dir = os.path.join(prefix, library_dir)
eci_lib = ExternalCompilationInfo(
include_dirs=include_dir and [include_dir] or [],
library_dirs=library_dir and [library_dir] or [],
)
eci_lib = eci_lib.merge(eci)
# verify that this eci can be compiled
try:
verify_eci(eci_lib)
except CompilationError as e:
last_error = e
else:
_cache[key] = eci_lib
return eci_lib
# Nothing found
if last_error:
> raise last_error
E CompilationError: CompilationError(out="""
E /tmp/buildbot-arm64/usession-main-5146/platcheck_68.c:92:10: fatal error: 'gc/gc.h' file not found
E 92 | #include <gc/gc.h>
E | ^~~~~~~~~
E 1 error generated.
E """)
rtyper/tool/rffi_platform.py:846: CompilationError
---------- Captured stderr call ----------
[rtyper] -=- specialized 4 blocks -=-
[rtyper] -=- specialized 4 more blocks -=-
[rtyper] -=- specialized 25 more blocks -=-
[rtyper] -=- specialized 64 more blocks -=-
[backendopt:inlining] phase with threshold factor: 32.4
[backendopt:inlining] heuristic: rpython.translator.backendopt.inline.inlining_heuristic
[backendopt:inlining] inlined 8 callsites.
[backendopt:malloc] starting malloc removal
[backendopt:malloc] removed 0 simple mallocs in total
[backendopt:mergeifblocks] starting to merge if blocks
[rtyper] -=- specialized 0 more blocks -=-
[rtyper] -=- specialized 0 more blocks -=-
[backendopt:inlining] phase with threshold factor: 32.4
[backendopt:inlining] heuristic: rpython.translator.backendopt.inline.inlining_heuristic
[backendopt:inlining] inlined 0 callsites.
[backendopt:malloc] starting malloc removal
[backendopt:malloc] removed 0 simple mallocs in total
[backendopt:mergeifblocks] starting to merge if blocks
[c:database] GC transformer: finished helpers
[c:database] GC transformer: finished tables
[c:database] Inlining GC helpers and postprocessing
[c] 209 nodes [ array: 16 boehm rtti: 16 func: 8 struct: 169 ]
[c:database] Completed
builder: rpython-macos-arm64 build #294+
test: memory/gctransform/test/test_boehm.py::TestLLInterpedBoehm::()::test_str