This is a very quick and dirty port to Zig 0.17 that serves my purposes. The big changes are:
- Two of the helper programs (replace and makesetup) have been converted into libraries that run during the configure execution
- Intermediate files that are only consumed by the configure stage aren't output
- The ConfigHeader step has been moved into configquery.zig so that it can execute after the configurer has run. This required copying the renderAutoConfUndef() function and related helpers from the zig standard library into configquery.zig so that pyconfig.h could be generated properly. This avoids the performance problems of my earlier approach which kept the ConfigHeader (and configquery) running during the configurer execution, which is caused by the configurer being compiled single-threaded and all of the CI configquery's adding onto the load even when CI isn't being run.
What's really needed is a standard way to execute the zig compiler on an arbitrary string of c code from within the configure phase as a way of testing if platform triple X supports feature Y. A two-phase configure could accomplish this.
Some further changes include compiling the _hacl module as a static library as upstream does, adding the ABIFLAGS compile flag, and generating a placeholder _sysconfigdata__(platform)_.py module, which together closes #17 .
I admit this PR is messy, please give me some feedback and I'll be happy to improve it.