Here's a patch to allow building (and using) pgen on Windows. All changes outside of PCbuild are solely to avoid compiler warnings, namely 4 instances of C4005 for PGEN being redefined and 2 instances of C4018, "'<' : signed/unsigned mismatch". pgen.vcxproj is in large part copied directly from _freeze_importlib.vcxproj (and modified appropriately). pgen is not set to build on any solution configuration, but it happily builds from a clean checkout so pythoncore.vcxproj could be made to depend on it.
The patch is way out of date, pgen.vcxproj needs to be updated to match the rest of our projects. If nobody else takes this over (and it is low priority for a reason!), I'll get back to it eventually.
I don't even know what pgen is or why I'd want to build it... If running it updates a file that would trigger a rebuild, then I'd really like it to copy what _freeze_importlib currently does as far as writing to a temporary file and conditionally overwriting the actual one. That is the most reliable way to avoid unnecessary rebuilds.
> I don't even know what pgen is or why I'd want to build it... pgen is the parser generator, taking Grammar/Grammar as input and generating Include/graminit.h and Python/graminit.c. Only useful when you're changing Python's grammar, but without the ability to build pgen, it's hard for Windows developers to play with the grammar at all. > If running it updates a file that would trigger a rebuild, then I'd > really like it to copy what _freeze_importlib currently does as far as > writing to a temporary file and conditionally overwriting the actual > one. That is the most reliable way to avoid unnecessary rebuilds. _freeze_importlib was what I used for a guide initially, and will be again when I get around to redoing the patch :)