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

CppParser.ParseFiles() functions differently when run during a pre-build event in VS19, but works normally elsewhere #59

Open
Ragingram2 opened this issue Mar 24, 2022 · 4 comments

Comments

@Ragingram2
Copy link

I am developing a small preprocessor for a game engine that I am working on with some friends, and we are using CppAST.Net in the preprocessor to autogenerate some files for runtime reflection.

The development of the preprocessor was going well, until I tried to run it during a pre-build event in visual studio where it wouldn't parse all of the files that I gave it. When run from the debugger or from a local published version of the application the program generates the AST in 30-40 seconds, finds 19 classes, 4 of which have the reflectable attribute, and generates 4 files for each of those classes (16 in total). But when the application is run during a pre-build event it only takes 5-6 seconds, finds 8 classes (non of which are reflectable) and generates no files.

I have been testing and debugging for the last week and I am completely at a loss. If anyone has any ideas on what this could be any help would be appreciated.

Some of my suspicions that I have yet to be able to prove/disprove is that the VS19 build output cmd prompt may have some different env variables that prevent certain functions from being called or are blocking certain .Net libraries. I have also checked my output, and there are no errors to be found.

@Ragingram2
Copy link
Author

I will be posting logs, and screenshots a little later

@Ragingram2
Copy link
Author

Successful Run from this .bat file
image
Log:
Output.txt

Failed run from the pre-build event
image
using these arguments
image
Log
Output.txt

@xoofx
Copy link
Owner

xoofx commented Mar 24, 2022

Are you checking/outputing that the result of parsing doesn't have any error or messages? (e.g compilation.Diagnostics.HasErrors and compilation.Diagnostics.Messages)

@Ragingram2
Copy link
Author

yep, my program outputs errors to the log, and prints that the ast generation failed in the console

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