Home - Summaries: (main) : (py3.11) : Everything - Nightly builds - Benchmarks - RPython - Builders - About

rlib/test/test_rthread.py::TestUsingBoehm::()::test_start_new_thread

self = <rpython.rlib.test.test_rthread.TestUsingBoehm object at 0x0000000130b23018>

    def test_start_new_thread(self):
        import time
    
        class State:
            pass
        state = State()
    
        def bootstrap1():
            state.my_thread_ident1 = get_ident()
        def bootstrap2():
            state.my_thread_ident2 = get_ident()
    
        def f():
            state.my_thread_ident1 = get_ident()
            state.my_thread_ident2 = get_ident()
            start_new_thread(bootstrap1, ())
            start_new_thread(bootstrap2, ())
            willing_to_wait_more = 1000
            while (state.my_thread_ident1 == get_ident() or
                   state.my_thread_ident2 == get_ident()):
                willing_to_wait_more -= 1
                if not willing_to_wait_more:
                    raise Exception("thread didn't start?")
                time.sleep(0.01)
            return 42
    
>       fn = self.getcompiled(f, [])

rlib/test/test_rthread.py:100: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
translator/c/test/test_boehm.py:40: in getcompiled
    thread=self.use_threads, **extra_options)
translator/c/test/test_genc.py:124: in compile
    t.compile_c()
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(err="""
E               	/tmp/buildbot-arm64/usession-pytest3.10-1185/platcheck_69.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
builder: rpython-macos-arm64 build #265+
test: rlib/test/test_rthread.py::TestUsingBoehm::()::test_start_new_thread