refactor(zig): migrate codebase from 0.15.2 to 0.16.0#49
Merged
Conversation
- `.github/workflows/ci.yaml`: Update Zig version to 0.16.0 in lint, test, sanitize, build jobs - `.github/workflows/release.yaml`: Update ZIG_VERSION env var to 0.16.0 - `.gitignore`: Add new ignore patterns for Zig 0.16 build artifacts - `build.zig`: Adopt 0.16 linking API and new build system idioms - `build.zig.zon`: Set minimum_zig_version to 0.16.0, update dependencies - `src/main.zig`: Migrate to Juicy Main pattern with std.process.Init - `src/interfaces/cli.zig`: Adopt std.Io namespace and new arg routing - `src/interfaces/config.zig`: Update to std.Io.File and 0.16 fs idioms - `src/interfaces/dump.zig`: Migrate streaming dump to 0.16 Reader/Writer - `src/infrastructure/clock.zig`: Rewrite with futex-based wake and std.Io.Clock - `src/infrastructure/channel.zig`: Update Channel to 0.16 concurrency primitives - `src/infrastructure/http.zig`: Adopt std.http.Server Reader/Writer interface pattern - `src/infrastructure/http/json.zig`: Update JSON serialization to 0.16 API - `src/infrastructure/tcp_server.zig`: Migrate TCP server to 0.16 std.Io - `src/infrastructure/telemetry.zig`: Fix random ID generator lifetime for std.Io - `src/infrastructure/tls_context.zig`: Update TLS bindings to 0.16 C interop - `src/infrastructure/auth.zig`: Migrate to 0.16 string/buffer primitives - `src/infrastructure/persistence/backend.zig`: Update persistence backend to 0.16 API - `src/infrastructure/persistence/background.zig`: Migrate background worker to 0.16 - `src/infrastructure/persistence/logfile.zig`: Minor 0.16 API updates - `src/infrastructure/protocol/parser.zig`: Update parser to std.mem.splitScalar - `src/infrastructure/redis/resp.zig`: Migrate RESP protocol to fixed Reader/Writer - `src/infrastructure/runner.zig`: Update runner dispatch to 0.16 idioms - `src/infrastructure/runner/amqp.zig`: Migrate AMQP runner to 0.16 std.Io - `src/infrastructure/runner/awf.zig`: Update AWF runner to 0.16 API - `src/infrastructure/runner/direct.zig`: Migrate direct runner to 0.16 - `src/infrastructure/runner/http.zig`: Update HTTP runner to 0.16 client API - `src/infrastructure/runner/redis.zig`: Migrate Redis runner to 0.16 std.Io - `src/infrastructure/runner/shell.zig`: Update shell runner to 0.16 process API - `src/infrastructure/runner/subprocess.zig`: Migrate subprocess runner to 0.16 - `src/application/execution_client.zig`: Update execution client to 0.16 API - `src/application/job_storage.zig`: Migrate job storage to 0.16 hash map idioms - `src/application/query_handler.zig`: Update query handler to 0.16 patterns - `src/application/scheduler.zig`: Migrate scheduler to 0.16 concurrency primitives - `src/functional_tests.zig`: Fix all functional tests for 0.16 std.Io changes - `CLAUDE.md`: Document Zig 0.16 idioms and updated conventions - `CHANGELOG.md`: Add 0.16 migration entry - `CONTRIBUTING.md`: Update Zig version requirement - `Makefile`: Update build targets for 0.16 - `README.md`: Update Zig version badge and requirements - `docs/ADR/0002-zig-language-choice.md`: Update Zig version reference - `docs/ADR/0003-openssl-tls-dependency.md`: Update for 0.16 linking API - `docs/ADR/0004-opentelemetry-sdk-dependency.md`: Update SDK compatibility notes - `docs/ADR/0005-amqp-runner-design.md`: Update Zig version reference - `docs/ADR/0006-redis-runner-design.md`: Update Zig version reference - `docs/development/building.md`: Update build instructions for 0.16 - `docs/tutorials/getting-started.md`: Update getting started for 0.16 - `.zpm/kb/default/knowledge.pl`: Initialize ZPM default knowledge segment - `.zpm/kb/feedback/knowledge.pl`: Initialize ZPM feedback rules segment - `.zpm/kb/migration_zig016/knowledge.pl`: Add ZPM migration tracking segment - `.zpm/kb/pr_feature_f024_zig_0152_0160_migration/knowledge.pl`: Add PR tracking segment - `.zpm/mounts.json`: Configure ZPM memory segment mounts Closes #48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
zig-o11y/opentelemetry-sdkto v0.2.0 andsam701/zig-clito themainbranch (v0.11.0), both required for 0.16 compatibilityCLAUDE.mdto delegate queryable rules (architecture, pitfalls, tests, review) to a new ZPM knowledge base, replacing inline markdown listsChanges
Build system & CI
build.zig: Switch toroot_module.link_libc,root_module.linkSystemLibrarywith options struct, passb.graph.iotohandle.access, drop explicittarget/optimizeforwarding to dependencies (0.16 propagates them automatically)build.zig.zon: Bumpminimum_zig_versionto0.16.0; update OTel hash to v0.2.0 and zig-cli hash tomainbranch (v0.11.0)Makefile: Add--test-timeout 30sto integration test invocations.github/workflows/ci.yaml: Update all four jobs (lint, test, sanitize, build) from Zig 0.15.2 → 0.16.0.github/workflows/release.yaml: BumpZIG_VERSIONenv var to0.16.0Application layer
src/application/scheduler.zig: Migratestd.time/ threading primitives to 0.16 equivalents; threadio: std.Iothrough scheduler contextsrc/application/execution_client.zig: Update I/O and process APIssrc/application/job_storage.zig: Namespace and API fixessrc/application/query_handler.zig: I/O namespace migrationInfrastructure — I/O and concurrency
src/infrastructure/clock.zig: Replacestd.time.Instantwithstd.Io.Clock.Timestamp; cacheioon struct to preserve allocation-free tick semanticssrc/infrastructure/channel.zig: Replacestd.Thread.Mutex/Conditionwithstd.Io.Mutex/Condition; fixtimedWaitsignaturesrc/infrastructure/tcp_server.zig: Migratestd.net→std.Io.net, update stream reader/writer pattern, fix graceful shutdown signalingsrc/infrastructure/http.zig: Migratestd.http.Serverto 0.16 reader/writer interface; wire HTTP shutdown to signal handler; update Reader/Writer typessrc/infrastructure/http/json.zig: Namespace updatesrc/infrastructure/telemetry.zig: Adopt OTel SDK v0.2.0 init signature; fixio_rnglifetime for telemetry setupsrc/infrastructure/auth.zig: Update socket/poll APIs (removestd.posix, usestd.os.linuxsyscalls)src/infrastructure/tls_context.zig: Fix@cImportand pointer-cast idioms for 0.16Infrastructure — persistence
src/infrastructure/persistence/backend.zig: Migrate I/O file APIssrc/infrastructure/persistence/background.zig: Threadioparameter; update threading primitivessrc/infrastructure/persistence/logfile.zig: Namespace updateInfrastructure — protocol & runners
src/infrastructure/protocol/parser.zig: Namespace updatesrc/infrastructure/redis/resp.zig: Migratestd.io.fixedBufferStream→std.Io.Reader.fixed/std.Io.Writer.fixedsrc/infrastructure/runner.zig,runner/amqp.zig,runner/awf.zig,runner/direct.zig,runner/http.zig,runner/redis.zig,runner/shell.zig,runner/subprocess.zig: Update I/O, process spawn, and stream APIs throughoutEntry point & interfaces
src/main.zig: Adopt Juicy Main (pub fn main(init: std.process.Init) !void); source GPA, args, andiofrominit; replace@Type(.enum_literal)with@EnumLiteral; update signal handler type tofn(std.os.linux.SIG) callconv(.c) void; threadiothrough all subsystemssrc/interfaces/cli.zig: Routeinit.minimal.argsviaArgs.Iterator.initAllocator; removestd.process.argsAlloc/argsFreesrc/interfaces/config.zig: Update TOML parsing I/Osrc/interfaces/dump.zig: Migrate file I/O APIsTests
src/functional_tests.zig: Overhaul 1874-line test file — fixTestServer.start/stopto usestd.Iochild process APIs, add atomic shutdown signaling, fixTestServermemory leak (freeconfig_pathviaallocator.freedirectly), fix telemetryio_rnglifetime, add defer-based cleanupDocumentation & project metadata
CHANGELOG.md: Add F024 migration entry under[Unreleased]CLAUDE.md: Replace inline rule lists with ZPM query references; add ZPM project memory section with segment definitions and query patternsCONTRIBUTING.md,README.md: Bump Zig prerequisite to 0.16.0+docs/ADR/0002-zig-language-choice.md,0003-openssl-tls-dependency.md,0004-opentelemetry-sdk-dependency.md,0005-amqp-runner-design.md,0006-redis-runner-design.md: Update version references to 0.16.0docs/development/building.md,docs/tutorials/getting-started.md: Update Zig version prerequisites.gitignore: Addzig-pkg/,*.o, and AWF/web project artifact patternsZPM knowledge base
.zpm/kb/default/knowledge.pl,journal.wal: Base schema for task graphs, components, ADRs, and project memory.zpm/kb/feedback/knowledge.pl,journal.wal: 40+ queryable architecture, pitfall, test, and review rules migrated from CLAUDE.md.zpm/kb/migration_zig016/knowledge.pl,journal.wal: Migration scope, breaking changes, verified APIs, and corrections recorded during F024.zpm/kb/pr_feature_f024_zig_0152_0160_migration/knowledge.pl,journal.wal: PR task completion tracking.zpm/mounts.json: Mount configuration for all four segments.zpm/kb/before_commit_20260427_160139.pl: Deleted obsolete snapshot fileTest plan
make buildcompiles with Zig 0.16.0 (no deprecation errors or API failures)zig build test-allpasses all unit tests across all layers (domain, application, infrastructure, interfaces)zig build test-functionalpasses with no memory leaks reported by DebugAllocatormlugg/setup-zig@v2installing version 0.16.0Closes #48
Generated with awf commit workflow