translator/c/test/test_rtagged.py::test_tagged_boehm
def test_tagged_boehm():
t = Translation(entry_point, gc='boehm', taggedpointers=True)
try:
> exename = str(t.compile_c())
translator/c/test/test_rtagged.py:72:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
translator/interactive.py:123: in compile_c
self.driver.compile_c()
translator/driver.py:108: in proc
return self.proceed(backend_goal)
translator/driver.py:568: in proceed
result = self._execute(goals, task_skip = self._maybe_skip())
translator/tool/taskengine.py:114: in _execute
res = self._do(goal, taskcallable, *args, **kwds)
translator/driver.py:278: in _do
res = func()
translator/driver.py:435: in task_database_c
database = cbuilder.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-7449/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 ----------
[flowgraph] (rpython.translator.c.test.test_rtagged:39)entry_point
[translation:info] Annotating&simplifying...
[c58675ba3539c00] {translation-task
starting annotate
[translation:info] with policy: rpython.annotator.policy.AnnotatorPolicy
[flowgraph] (rpython.rlib.objectmodel:766)C.__init__
[flowgraph] (rpython.rlib.objectmodel:780)C.get_untagged_value
[flowgraph] (rpython.translator.c.test.test_rtagged:21)makeint
[flowgraph] (rpython.translator.c.test.test_rtagged:11)B.__init__
[flowgraph] (rpython.translator.c.test.test_rtagged:27)makeint2
[flowgraph] (rpython.translator.c.test.test_rtagged:18)C.meth
[flowgraph] (rpython.rlib.rposix:500)write
[flowgraph] (rpython.rtyper.lltypesystem.rffi:1427)scoped_nonmovingbuffer.__init__
[flowgraph] (rpython.rtyper.lltypesystem.rffi:1431)scoped_nonmovingbuffer.__enter__
[flowgraph] (rpython.rtyper.lltypesystem.rffi:873)get_nonmovingbuffer_ll
[flowgraph] (rpython.rlib.objectmodel:315)we_are_translated_to_c
[flowgraph] (rpython.translator.c.test.test_rtagged:13)B.meth
[flowgraph] (rpython.translator.c.test.test_rtagged:7)A.meth
[flowgraph] (rpython.rtyper.lltypesystem.rstr:116)copy_string_to_raw
[flowgraph] (rpython.rtyper.lltypesystem.rstr:63)_get_raw_buf
[flowgraph] (rpython.rtyper.lltypesystem.rstr:57)_str_ofs
[flowgraph] (rpython.rtyper.lltypesystem.llmemory:411)sizeof
[flowgraph] (rpython.rtyper.lltypesystem.rffi:278)write
[flowgraph] (rpython.rtyper.lltypesystem.rffi:1433)scoped_nonmovingbuffer.__exit__
[flowgraph] (rpython.rtyper.lltypesystem.rffi:937)free_nonmovingbuffer_ll
[flowgraph] (rpython.rtyper.lltypesystem.rffi:3)ccall_write
[flowgraph] (rpython.rlib.rgil:160)release
[flowgraph] (rpython.rlib.rposix:151)_errno_before
[flowgraph] (rpython.rlib.rthread:349)getraw
[flowgraph] (rpython.rlib.rthread:349)getraw
[flowgraph] (rpython.rlib.rposix:170)_errno_after
[flowgraph] (rpython.rlib.rthread:364)setraw
[flowgraph] (rpython.rlib.rthread:364)setraw
[flowgraph] (rpython.rlib.rgil:171)acquire
[flowgraph] (rpython.rlib.rthread:282)gc_thread_run
[flowgraph] (rpython.rlib.rposix:430)handle_posix_error
[flowgraph] (rpython.rlib.rarithmetic:139)widen
[flowgraph] (rpython.rlib.rposix:113)get_saved_errno
[flowgraph] (?:1)memo_offsetof_0
[flowgraph] (?:1)memo_itemoffsetof_0
[flowgraph] (?:1)memo__sizeof_none_0
[flowgraph] (?:1)memo_itemoffsetof_0
[flowgraph] (?:1)memo__isfunctype_0
[flowgraph] (?:1)memo__isfunctype_0
[flowgraph] (?:1)memo__should_widen_type_0
[c58675bb637ca80] translation-task}
[translation:info] RTyping...
[c58675bb638cc80] {translation-task
starting rtype_lltype
[flowgraph] (rpython.rtyper.rclass:1170)ll_runtime_type_info
[flowgraph] (rpython.rtyper.rlist:572)ll_len
[flowgraph] (rpython.rtyper.lltypesystem.rlist:365)ll_length
[flowgraph] (rpython.rtyper.lltypesystem.rtagged:160)ll_unboxed_isinstance_const
[flowgraph] (rpython.rtyper.rclass:1139)ll_issubclass_const
[flowgraph] (rpython.rtyper.lltypesystem.rtagged:155)ll_unboxed_getclass
[flowgraph] (rpython.rtyper.lltypesystem.rstr:350)ll_strlen
[rtyper] specializing: 100 / 179 blocks (55%)
[flowgraph] (rpython.rtyper.rstr:425)ll_str
[flowgraph] (?:1)memo_ll_constant_0
[flowgraph] (?:11)ll_join_strs_look_inside_iff
[flowgraph] (rpython.rtyper.lltypesystem.rstr:785)<lambda>
[flowgraph] (rpython.rlib.jit:294)loop_unrolling_heuristic
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (rpython.rtyper.lltypesystem.rstr:783)ll_join_strs
[flowgraph] (rpython.rtyper.lltypesystem.llmemory:1037)cast_any_ptr
[flowgraph] (?:2)mallocstr
[flowgraph] (rpython.rtyper.lltypesystem.rstr:36)mallocstr
[flowgraph] (rpython.rlib.jit:281)isvirtual
[flowgraph] (rpython.rtyper.lltypesystem.rstr:78)copy_string_contents
[flowgraph] (?:2)ll_join_strs_trampoline
[flowgraph] (rpython.rtyper.lltypesystem.rstr:783)ll_join_strs
[rtyper] specializing: 200 / 243 blocks (82%)
[rtyper] -=- specialized 243 blocks -=-
[flowgraph] (rpython.rtyper.rclass:1133)ll_issubclass
[flowgraph] (rpython.rtyper.rclass:1130)ll_type
[rtyper] -=- specialized 4 more blocks -=-
[c58675bbd04dd80] translation-task}
[translation:info] lltype back-end optimisations...
[c58675bbd05c600] {translation-task
starting backendopt_lltype
[backendopt:removecasts] removed 8 cast_pointers in entry_point
[backendopt:removecasts] removed 1 cast_pointers in C.__init__
[backendopt:removecasts] removed 1 cast_pointers in A.meth
[backendopt:removecasts] removed 1 cast_pointers in _get_raw_buf__rpy_string
[backendopt:removecasts] removed 3 cast_pointers in handle_posix_error__write
[backendopt:removecasts] removed 1 cast_pointers in ll_join_strs__v5___simple_call__function_ll_
[backendopt:removecasts] removed 1 cast_pointers in copy_string_contents__rpy_stringPtr_rpy_stringPtr_Signed_Signed_Signed
[backendopt:removecasts] removed 1 cast_pointers in ll_join_strs__v8___simple_call__function_ll_
[backendopt:inlining] phase with threshold factor: 32.4
[backendopt:inlining] heuristic: rpython.translator.backendopt.inline.inlining_heuristic
[backendopt:inlining] 0.00 scoped_nonmovingbuffer.__enter__
[backendopt:inlining] 0.00 cast_any_ptr__Ptr_GcStruct_rpy_stringLlT_rpy_stringPtr
[backendopt:inlining] 0.00 copy_string_contents__rpy_stringPtr_rpy_stringPtr_Signed_Signed_Signed
[backendopt:inlining] 0.00 get_nonmovingbuffer_ll
[backendopt:inlining] 0.00 isvirtual__v6___simple_call__function_isv
[backendopt:inlining] 0.00 write__Signed_arrayPtr_Signed_star_3
[backendopt:inlining] 0.00 _get_raw_buf__rpy_string
[backendopt:inlining] 0.00 scoped_nonmovingbuffer.__init__
[backendopt:inlining] 0.00 copy_string_to_raw
[backendopt:inlining] 0.00 memo__sizeof_none_0
[backendopt:inlining] 0.00 __exit____star_3
[backendopt:inlining] 0.00 gc_thread_run
[backendopt:inlining] 0.00 widen__int
[backendopt:inlining] 0.00 memo_ll_constant_0
[backendopt:inlining] 0.00 isconstant__v4___simple_call__function_isc
[backendopt:inlining] 2.00 ll_strlen__rpy_stringPtr
[backendopt:inlining] 2.00 getraw
[backendopt:inlining] 2.00 B.__init__
[backendopt:inlining] 2.00 getraw
[backendopt:inlining] 2.00 setraw
[backendopt:inlining] 2.00 setraw
[backendopt:inlining] 2.00 ll_length__listPtr
[backendopt:inlining] 4.00 C.get_untagged_value
[backendopt:inlining] 4.00 ll_issubclass_const__object_vtablePtr_Signed_Signed
[backendopt:inlining] 5.00 release
[backendopt:inlining] 6.00 _str_ofs__rpy_string
[backendopt:inlining] 7.00 mallocstr__Signed
[backendopt:inlining] 7.00 acquire
[backendopt:inlining] 4.00 get_saved_errno
[backendopt:inlining] 2.00 ll_len__listPtr
[backendopt:inlining] 7.50 mallocstr__Signed
[backendopt:inlining] 9.00 ll_join_strs_look_inside_iff__Signed_arrayPtr_Ptr_GcStruct_rpy_stringLlT
[backendopt:inlining] 4.00 ll_str__StringR_Ptr_GcStruct_rpy_strin_rpy_stringPtr
[backendopt:inlining] 9.50 ll_unboxed_getclass__objectPtr_object_vtablePtr
[backendopt:inlining] 10.75 makeint2
[backendopt:inlining] 13.00 free_nonmovingbuffer_ll
[backendopt:inlining] 6.75 loop_unrolling_heuristic__v3___simple_call__function_loo
[backendopt:inlining] 12.00 makeint
[backendopt:inlining] 13.75 ll_unboxed_isinstance_const__objectPtr_Signed_Signed_Bool
[backendopt:inlining] 19.25 _errno_after__v1___simple_call__function__er
[backendopt:inlining] 31.87 _errno_before__v0___simple_call__function__er
[backendopt:inlining] 31.75 handle_posix_error__write
[backendopt:inlining] inlined 79 callsites.
[backendopt:malloc] starting malloc removal
[backendopt:malloc] 3 simple mallocs removed in 'write'
[backendopt:malloc] 2 simple mallocs removed in 'scoped_nonmovingbuffer.__init__'
[backendopt:malloc] 7 simple mallocs removed in 'write__Signed_arrayPtr_Signed_star_3'
[backendopt:malloc] removed 12 simple mallocs in total
[backendopt:removecasts] removed 1 cast_pointers in entry_point
[backendopt:mergeifblocks] starting to merge if blocks
[c58675bc4310400] translation-task}
[translation:info] inserting stack checks...
[c58675bc4321b80] {translation-task
starting stackcheckinsertion_lltype
[flowgraph] (rpython.rlib.rstack:42)stack_check
[flowgraph] (rpython.rlib.rstack:67)stack_check_slowpath
[rtyper] -=- specialized 8 more blocks -=-
[translation:info] inserted 0 stack checks.
[c58675bc4d52200] translation-task}
[translation:info] Creating database for generating c source...
[c58675bc4d5cf80] {translation-task
starting database_c
[flowgraph] (rpython.translator.exceptiontransform:100)rpyexc_occurred
[flowgraph] (rpython.translator.exceptiontransform:104)rpyexc_fetch_type
[flowgraph] (rpython.translator.exceptiontransform:107)rpyexc_fetch_value
[flowgraph] (rpython.translator.exceptiontransform:110)rpyexc_clear
[flowgraph] (rpython.translator.exceptiontransform:114)rpyexc_raise
[flowgraph] (rpython.translator.exceptiontransform:128)rpyexc_reraise
[flowgraph] (rpython.translator.exceptiontransform:133)rpyexc_fetch_exception
[flowgraph] (rpython.translator.exceptiontransform:138)rpyexc_restore_exception
[flowgraph] (rpython.translator.exceptiontransform:539)rpyexc_get_exception_addr
[flowgraph] (rpython.translator.exceptiontransform:543)rpyexc_get_exc_value_addr
[flowgraph] (rpython.rtyper.rclass:1173)ll_inst_type
[rtyper] -=- specialized 25 more blocks -=-
[flowgraph] (rpython.memory.gctransform.transform:447)_ll_malloc_fixedsize
[flowgraph] (rpython.memory.gctransform.transform:454)_ll_malloc_fixedsize_zero
[flowgraph] (rpython.memory.gctransform.transform:470)_ll_malloc_varsize_no_length
[flowgraph] (rpython.memory.gctransform.transform:487)ll_malloc_varsize
[flowgraph] (rpython.memory.gctransform.transform:493)_ll_malloc_varsize_no_length_zero
[flowgraph] (rpython.memory.gctransform.transform:447)_ll_malloc_fixedsize
[flowgraph] (rpython.memory.gctransform.transform:447)_ll_malloc_fixedsize
[flowgraph] (rpython.memory.gctransform.transform:470)_ll_malloc_varsize_no_length
[flowgraph] (rpython.memory.gctransform.transform:487)ll_malloc_varsize
[flowgraph] (rpython.memory.gctransform.boehm:249)ll_weakref_create
[flowgraph] (rpython.memory.gctransform.boehm:263)ll_weakref_deref
[flowgraph] (rpython.memory.gctransform.boehm:58)ll_identityhash
[flowgraph] (rpython.memory.gctransform.transform:461)_ll_compute_size
[flowgraph] (rpython.memory.gctransform.boehm:20)<lambda>
[flowgraph] (rpython.memory.gctransform.boehm:24)<lambda>
[flowgraph] (rpython.memory.gctransform.transform:461)_ll_compute_size
[rtyper] specializing: 300 / 344 blocks (87%)
[rtyper] -=- specialized 64 more blocks -=-
[backendopt:removecasts] removed 1 cast_pointers in _ll_malloc_fixedsize__Signed
[backendopt:removecasts] removed 1 cast_pointers in _ll_malloc_fixedsize_zero__Signed
[backendopt:removecasts] removed 1 cast_pointers in _ll_malloc_varsize_no_length__Signed_Signed_Signed
[backendopt:removecasts] removed 1 cast_pointers in _ll_malloc_varsize_no_length_zero__Signed_Signed_Signed
[backendopt:removecasts] removed 1 cast_pointers in _ll_malloc_fixedsize__Signed
[backendopt:removecasts] removed 1 cast_pointers in _ll_malloc_fixedsize__Signed
[backendopt:removecasts] removed 1 cast_pointers in _ll_malloc_varsize_no_length__Signed_Signed_Signed
[backendopt:removecasts] removed 1 cast_pointers in ll_weakref_create__GCREFPtr
[backendopt:removecasts] removed 1 cast_pointers in _ll_compute_size__Signed_Signed_Signed
[backendopt:removecasts] removed 1 cast_pointers in _ll_compute_size__Signed_Signed_Signed
[backendopt:inlining] phase with threshold factor: 32.4
[backendopt:inlining] heuristic: rpython.translator.backendopt.inline.inlining_heuristic
[backendopt:inlining] 0.00 _ll_compute_size__Signed_Signed_Signed
[backendopt:inlining] 0.00 _ll_compute_size__Signed_Signed_Signed
[backendopt:inlining] 2.00 _lambda_
[backendopt:inlining] 2.00 _lambda_
[backendopt:inlining] 16.50 _ll_malloc_varsize_no_length__Signed_Signed_Signed
[backendopt:inlining] 16.50 _ll_malloc_varsize_no_length__Signed_Signed_Signed
[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
[flowgraph] (rpython.translator.c.genc:261)entrypoint_wrapper
[flowgraph] (rpython.rtyper.lltypesystem.rffi:854)charp2str
[flowgraph] (rpython.rtyper.lltypesystem.rffi:1030)charpsize2str
[flowgraph] (rpython.rtyper.lltypesystem.rstr:145)copy_raw_to_string
[flowgraph] (rpython.rtyper.rlist:487)ll_alloc_and_set
[flowgraph] (rpython.rlib.rarithmetic:741)int_force_ge_zero
[flowgraph] (rpython.rtyper.rlist:504)_ll_alloc_and_set_jit
[flowgraph] (rpython.rtyper.rlist:472)_ll_zero_or_null
[flowgraph] (rpython.rtyper.rlist:494)_ll_alloc_and_set_nojit
[flowgraph] (rpython.rtyper.lltypesystem.rlist:324)ll_newlist
[flowgraph] (rpython.rtyper.rlist:516)_ll_alloc_and_clear
[flowgraph] (rpython.rtyper.lltypesystem.rlist:377)ll_setitem_fast
[flowgraph] (rpython.rtyper.lltypesystem.rlist:369)ll_items
[flowgraph] (?:11)_ll_alloc_and_set_nonnull_look_inside_iff
[flowgraph] (rpython.rtyper.rlist:528)<lambda>
[flowgraph] (rpython.rlib.jit:269)isconstant
[flowgraph] (rpython.rtyper.rlist:528)_ll_alloc_and_set_nonnull
[flowgraph] (?:2)_ll_alloc_and_set_nonnull_trampoline
[flowgraph] (rpython.rtyper.rlist:528)_ll_alloc_and_set_nonnull
[flowgraph] (?:1)memo__null_of_type_0
[flowgraph] (rpython.rtyper.rlist:726)ll_setitem_nonneg
[rtyper] specializing: 400 / 422 blocks (94%)
[rtyper] -=- specialized 78 more 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] 269 nodes [ array: 22 boehm rtti: 17 func: 49 struct: 181 ]
[c:database] Completed
[c58675bd1923c00] translation-task}
builder: rpython-macos-arm64 build #261
test: translator/c/test/test_rtagged/py/test_tagged_boehm