Skip to content

Quick Port to Zig 0.17 - #18

Open
kbogert wants to merge 29 commits into
allyourcodebase:mainfrom
kbogert:main
Open

kbogert wants to merge 29 commits into
allyourcodebase:mainfrom
kbogert:main

Conversation

@kbogert

@kbogert kbogert commented Oct 24, 2026 •

Copy link
Copy Markdown

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.

…o other builds (and avoid the need to compile hacl for both the host and target archs)
… move the current ConfigHeader code out of build.zig and into this program. This requires duplicating the functionality offered by the ConfigHeader build step. However, keeping the execution of the compiler out of the configurer greatly speeds up the build process.
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

Successfully merging this pull request may close these issues.

sha2 module still referenced even if not built (3.12.11)

1 participant