Skip to content

Diagnostics: Parsed headers are printed as a whole #1743

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

Closed
deadlocklogic opened this issue Jul 11, 2023 · 7 comments
Closed

Diagnostics: Parsed headers are printed as a whole #1743

deadlocklogic opened this issue Jul 11, 2023 · 7 comments

Comments

@deadlocklogic
Copy link
Contributor

In the parsing phase, all parsed header paths are printed at the end.
Is there a way to make it print each one by one so we can visualize the progress in the console?

@tritao
Copy link
Collaborator

tritao commented Jul 11, 2023

I think the parser output is already output one-by-one, see https://github.com/mono/CppSharp/blob/main/src/Generator/Driver.cs#L110C14-L110C26.

Or maybe I am not understanding which output you mean.

@deadlocklogic
Copy link
Contributor Author

Suppose parsing 2 files: test1.h, test2.h.
The output on the console is like:

Parsing libraries...
Parsing code...
Parsed 'Test1.h, Test2.h'

And Parsed 'Test1.h, Test2.h' is printed only after both files are parsed, my question: is there a way to print when each file is parsed?
Imagine parsing a module with multiple files which can take much time to complete, can we show when each file is parsed?

@tritao
Copy link
Collaborator

tritao commented Jul 11, 2023

I see, I think that is because its using the unity build mode, which parses all files together at once. Try changing the UnityBuild setting in the parser options and see if it does what you want.

@deadlocklogic
Copy link
Contributor Author

I tried setting driver.ParserOptions.UnityBuild = false; with no luck.
BTW maybe this feature isn't super critical but it would be nice to see progress gradually.

@tritao
Copy link
Collaborator

tritao commented Jul 11, 2023

That's how it was designed from the start though. Only then did we add the unity build mode because it can be significantly faster, with the only drawback getting the diagnostics for everything at once.

Based on the output you shown earlier, unity build mode is getting activated, else you would get each parsed file output one at a time. Cannot say why that is the case, but that's the reason.

@deadlocklogic
Copy link
Contributor Author

Need to investigate more, but maybe when I get the project built from source because for now I am having difficulty running build.sh. For now I am relying on the nuget package.
Thanks.

@tritao
Copy link
Collaborator

tritao commented Jul 11, 2023

Ok please open an issue about issue with build.sh, it should work.

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

No branches or pull requests

2 participants