-
Notifications
You must be signed in to change notification settings - Fork 5
Add information text to output #1316
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
Conversation
| TraceFrontend (FrontendClang (ClangErrorCode (SimpleEnum x))) | ||
| | Just CXError_ASTReadError <- simpleFromC x -> Debug | ||
| _ -> unCustomLogLevel (tCustomLogLevel tracerConfig) trace actualLevel | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TravisCardwell I've approved this PR and told @bolt12 to go ahead and merge this, but this tracerConfigWithoutASTReadError does feel a bit weird to me. It's only on the CLI, and only for this info command, so not a big deal, but nonetheless - do you have any thoughts on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still do not understand why we are getting the error.
I did not think I got the error before, but I just checked with LLVM/Clang 14 and see it with that version as well. I likely just forgot about the error.
Does this error happen because the header is empty? I tried adding #define HS_BINDGEN_NOP_H to the header, but I still see the error.
Perhaps libclang is trying to parse the printed output? Surely not, but I do not know how to easily check this.
Suppressing the error (in this CLI command only) by changing the level to debug sounds like a suitable mitigation to me.
BTW, when I first tried building with LLVM/Clang 14, it failed because of the cached build for LLVM/Clang 21 in the Cabal store:
Template Haskell error: [Warning] [HsBindgen] [builtin-include-dir] clang version mismatch:
libclang version: clang version 21.1.6
clang version: clang version 14.0.6
This issue (#1244) is annoying, and it is frustrating that there is nothing we can do about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I understood, Clang exits early without fully processing/parsing the input file, i.e. no AST is created and clang_parseTranslationUnit returns CXError_ASTReadError because no AST was built.
So in essence, it prints info and exits without completing the AST construction, regardless of file content
TravisCardwell
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
This PR fixes #1312