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 GitHub workflow #249

Closed
wants to merge 9 commits into from
Closed

Macos GitHub workflow #249

wants to merge 9 commits into from

Conversation

jnikula
Copy link
Owner

@jnikula jnikula commented Sep 1, 2024

#248 + the actual workflow.

Still fails, but it's a start.

The BSD find requires the path even for current directory. No harm in
providing it on GNU find too.
For some reason there's a /private prefix in the error messages on macOS
that's not present in srcdir, nor on Linux. Just remove everything
before and including the srcdir.
The parser may return None for clang diagnostics filename if there isn't
one. Handle it gracefully by using get_message(basename=True) on the
error.
Change the hyphen to underscore in update_examples.py, and call it as a
module. This makes it easier for testenv.py to import stuff in the test
directory.
Switch to argparse for parsing command-line arguments. Allow passing the
language (compiler -x option) to use for figuring out the header search
path. Translate 'cpp' to 'c++' for ease of use. Add a couple more useful
output options in the CLI.
Add a pytest --cc-path command-line option to pass the compiler path to
use for figuring out the search path. Move the clang args to
conftest.py.

For example: 'pytest -n auto --cc-path /path/to/clang'
Figure out the include paths for each domain (i.e. language, C or C++),
and pass them to libclang. The C header search paths can be insufficient
or plain wrong for C++.

See https://reviews.llvm.org/D131441 for error messages that could be
encountered.
Still hitting some issues.
@jnikula
Copy link
Owner Author

jnikula commented Sep 1, 2024

Any C++ tests that #include something hit this:

E         + ERROR: c++/v1/cstddef:46: <cstddef> tried including <stddef.h> but didn't find libc++'s <stddef.h> header.           This usually means that your header search paths are not configured properly.           The header search paths should contain the C++ Standard Library headers before           any C Standard Library, and you are probably using compiler flags that make that           not be the case.
E         + ERROR: c++/v1/cstddef:59: no member named 'nullptr_t' in the global namespace
E         + ERROR: c++/v1/__type_traits/is_null_pointer.h:26: use of undeclared identifier 'nullptr_t'
E         + ERROR: c++/v1/cstdint:149: <cstdint> tried including <stdint.h> but didn't find libc++'s <stdint.h> header.           This usually means that your header search paths are not configured properly.           The header search paths should contain the C++ Standard Library headers before           any C Standard Library, and you are probably using compiler flags that make that           not be the case.

despite the attempts to figure out the C++ header search path from the right compiler for the right language.

The error messages were added in https://reviews.llvm.org/D131441 and the implication is that the include paths passed on the command-line are wrong... but then libclang does not figure them out itself, you have to pass them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant