Skip to content

Migrate build.zig to the root_module API - #3

Merged
godofecht merged 1 commit into
mainfrom
zig-0.15
Jul 21, 2026
Merged

Migrate build.zig to the root_module API#3
godofecht merged 1 commit into
mainfrom
zig-0.15

Conversation

@godofecht

Copy link
Copy Markdown
Owner

Zig 0.15 removed the option shape build.zig was using:

error: no field named 'root_source_file' in struct 'Build.ExecutableOptions'

Target and optimize now live on a module created with b.createModule, passed as .root_module. addStaticLibrary and addSharedLibrary fold into addLibrary with an explicit .linkage.

This is forward-compatible, not a cutover

Worth stating clearly, because it changes how the rest of the migration should be approached: 0.14.1 already accepts the newer API. Only 0.15 removed the older one. So build.zig now works on both.

Zig Build Tests
0.14.1 13/13 steps 56/56
0.15.2 13/13 steps 56/56

CI runs a matrix over both so that compatibility stays verified rather than assumed.

No source changes needed

0.15's std.Io rework ("writergate") does not reach azazel. Its suites are pure computation with no IO surface. danzig and zaza may differ, and will be handled separately.

🤖 Generated with Claude Code

Zig 0.15 removed the option shape build.zig was using:

    error: no field named 'root_source_file' in struct
           'Build.ExecutableOptions'

Target and optimize now live on a module created with b.createModule,
which is passed as .root_module. addStaticLibrary and addSharedLibrary
are folded into addLibrary with an explicit .linkage.

This turned out to be forward-compatible rather than a cutover: 0.14.1
already accepts the newer API, and only 0.15 removed the older one. So
build.zig now works on both, verified at 13/13 build steps and 56/56
tests on each. CI runs a matrix over both versions so that stays true
rather than being assumed.

No source changes were needed. 0.15's std.Io rework does not reach
azazel, whose suites are pure computation.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@godofecht
godofecht merged commit 140684b into main Jul 21, 2026
2 checks passed
@godofecht
godofecht deleted the zig-0.15 branch July 24, 2026 23:24
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.

1 participant