metacall / core

MetaCall: The ultimate polyglot programming experience.

Home Page:https://metacall.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

macOS CI fails with C

ahmedihabb2 opened this issue · comments

After fixing this issue in build step

A new issue raised in tests

CI Logs

6_Configure.txt
7_Build.txt

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:

tcc_list_symbols(c_handle->state, static_cast<void *>(c_handle), &c_loader_impl_discover_symbols);

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.

Done and here are the new logs metcall-test timed out

6_Configure.txt
7_Build.txt