xoofx / xoofx/CppAst.NET

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

Open
#59 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
620
Forks
79
Avg merge
14h 27m
Merged PRs (30d)
1

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at CppParser.ParseFiles() and compare its behavior when launched from the debugger or a local published application versus the Visual Studio 19 pre-build event. Inspect the pre-build process environment and output, especially the differing parse times and class counts. Done means the pre-build invocation parses the same 19 classes, identifies the 4 reflectable classes, and generates all 16 files.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, csharp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.