Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS CI fails with C #442

Open
ahmedihabb2 opened this issue Jun 9, 2023 · 2 comments
Open

macOS CI fails with C #442

ahmedihabb2 opened this issue Jun 9, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@ahmedihabb2
Copy link
Contributor

After fixing this issue in build step

A new issue raised in tests

CI Logs

6_Configure.txt
7_Build.txt

@ahmedihabb2 ahmedihabb2 added the bug Something isn't working label Jun 9, 2023
@viferga
Copy link
Member

viferga commented Jun 12, 2023

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.

@ahmedihabb2
Copy link
Contributor Author

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

6_Configure.txt
7_Build.txt

@viferga viferga mentioned this issue Jul 13, 2023
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants