Skip to content

v0.3.4

Choose a tag to compare

@github-actions github-actions released this 23 Jul 22:09
· 5 commits to main since this release
c212121

dagger-zig v0.3.4 — Community Update

The headline

dagger call now works. This release fixes the core runtime path that prevented Zig modules from loading in the Dagger engine. If you tried to use dagger-zig before and hit failed to call module to get functions: call constructor: exit code: 1, this is the fix.

What was broken

The Zig SDK library lived at the repository root (src/), one level above the sdk/ directory that the Dagger engine clones when a user references the SDK. When ModuleRuntime tried to build a user's Zig module inside the engine container, @import("dagger_sdk") had nothing to resolve against — the library wasn't there. Codegen compounded the problem by emitting a dagger.gen.zig that imported dagger_sdk without declaring the dependency or generating any build files.

The result: every dagger call and dagger develop against a Zig module failed at the constructor stage.

What we fixed

  1. Vendored the library inside the SDK module. Moved src/ → sdk/lib/src/ so the Zig library ships inside the SDK module that the engine clones. Added a consumer-facing sdk/lib/build.zig + build.zig.zon that exposes dagger_sdk via b.dependency().

  2. Rewrote ModuleRuntime. Now mounts sdk/lib (the Zig library, not the Go bootstrap tree) at /sdk-lib. The build script symlinks /sdk-lib → .dagger-sdk-lib so the generated build.zig.zon's relative .path resolves regardless of the module's source subpath.

  3. Rewrote Codegen. Now emits three files for every user module:

    • build.zig — wires dagger_sdk as a dependency and installs a module executable via the module-runtime step
    • build.zig.zon — declares the dagger_sdk path dependency (with the fingerprint field Zig 0.16 requires)
    • internal/dagger/dagger.gen.zig — re-export shim so @import("dagger") works too
  4. Fixed the CI pipeline module. The ci/pipeline/build.zig referenced ../../sdk/lib/src/root.zig directly, which doesn't exist inside the container. Switched to b.dependency("dagger_sdk", ...) with a proper build.zig.zon.

  5. Forked otel-go to drop vulnerable transitive dependencies from the Go SDK bootstrap.

  6. Applied zig fmt to all unformatted source files.

Verified end-to-end

$ dagger develop
# → generated build.zig + build.zig.zon + internal/dagger/dagger.gen.zig

$ dagger call hello
hello from dagger-zig module runtime

The full runtime path — codegen, ModuleRuntime, Zig build in-container, entrypoint dispatch, function call — works.

Supply chain

Every release artifact is signed and attested:

Attestation How to verify
Cosign signature cosign verify-blob --bundle <file>.bundle --certificate-identity 'https://github.com/MChorfa/dagger-zig/.github/workflows/release.yml@refs/tags/v0.3.4' --certificate-oidc-issuer https://token.actions.githubusercontent.com <file>
GitHub attestation gh attestation verify <file> --repo MChorfa/dagger-zig
SLSA L3 provenance slsa-verifier verify-artifact <tarball> --provenance-path multiple.intoto.jsonl --source-uri github.com/MChorfa/dagger-zig --source-tag v0.3.4
SBOM sbom.spdx.json and sbom.cdx.json included in release assets

Downloads

Target Asset
aarch64 Linux dagger-zig-v0.3.4-aarch64-linux-gnu.tar.gz
x86_64 Linux dagger-zig-v0.3.4-x86_64-linux-gnu.tar.gz
aarch64 macOS dagger-zig-v0.3.4-aarch64-macos.tar.gz
x86_64 macOS dagger-zig-v0.3.4-x86_64-macos.tar.gz

Verify with sha256sum -c checksums.sha256.

Getting started

# In your Dagger module directory:
dagger init --sdk github.com/MChorfa/dagger-zig/sdk@v0.3.4
dagger develop
dagger call hello

What's next

  • More example modules (container builds, parallel pipelines, SBOM generation)
  • SPIFFE workload identity integration for zero-trust CI
  • Improved error messages from the Zig dispatch layer

Thanks

To everyone who reported the runtime failure and helped trace it — this fix is for you.


Full changelog: v0.3.3...v0.3.4