core
core copied to clipboard
macOS CI fails with C
This is what is failing:
2023-06-09T12:25:29.2864800Z [Fri Jun 9 12:25:20] #118477 [ 750 | c_loader_impl_discover_signature | /Users/runner/work/core/core/source/loaders/c_loader/source/c_loader_impl.cpp ] @Error : Symbol 'compiled_print' not found, skipping the function 2023-06-09T12:25:29.2865620Z [Fri Jun 9 12:25:20] #118477 [ 817 | c_loader_impl_discover_visitor | /Users/runner/work/core/core/source/loaders/c_loader/source/c_loader_impl.cpp ] @Error : Failed to discover C function declaration 'compiled_print' 2023-06-09T12:25:29.2866180Z [Fri Jun 9 12:25:20] #118477 [ 891 | loader_impl_load_from_file | /Users/runner/work/core/core/source/loader/source/loader_impl.c ] @Error : Error when loading handle: compiled.c 2023-06-09T12:25:29.2866620Z /Users/runner/work/core/core/source/tests/metacall_test/source/metacall_test.cpp:502: Failure 2023-06-09T12:25:29.2866910Z Expected equality of these values: 2023-06-09T12:25:29.2867110Z (int)0 2023-06-09T12:25:29.2867280Z Which is: 0 2023-06-09T12:25:29.2867560Z (int)metacall_load_from_file("c", c_scripts, sizeof(c_scripts) / sizeof(c_scripts[0]), __null) 2023-06-09T12:25:29.2867830Z Which is: 1
It fails exactly here:
static int c_loader_impl_discover_signature(loader_impl impl, loader_impl_c_handle c_handle, scope sp, CXCursor cursor)
{
auto cursor_type = clang_getCursorType(cursor);
auto func_name = c_loader_impl_cxstring_to_str(clang_getCursorSpelling(cursor));
if (c_handle->symbols.count(func_name) == 0)
{
log_write("metacall", LOG_LEVEL_ERROR, "Symbol '%s' not found, skipping the function", func_name.c_str());
return 1;
}
....
This map is filled in this function: https://github.com/metacall/core/blob/022a7704e88e679884e67c3e2296873252e58ccd/source/loaders/c_loader/source/c_loader_impl.cpp#L1033
I think something may be broken in TCC. This is why we used a forked version of TCC with latest updates. Can you remove the installation of tcc in the script and re-run the CI? It should fail to find tcc and the build system will clone + build TCC from our fork.