Skip to content

Releases: softprops/zig-lambda-runtime

v0.2.0

21 Apr 03:57
f264d4d

Choose a tag to compare

Upgrade to zig 0.12.0, current stable

The main changes were artifacts of the 0.12.0 and build configuration changes. Because these were both breaking changes the new min supported zig version is 0.12.0. See the readme for the latest install notes.

v0.1.0

15 Nov 04:58

Choose a tag to compare

we have lift off

This initial release includes basic "it works" functionality for hosting zig based aws lambdas. See readme for more information

📼 installing

Add the following to your build.zig.zon file to declare a dependency

.{
    .name = "my-first-zig-lambda",
    .version = "0.1.0",
    .dependencies = .{
        // 👇 declare dep properties
        .lambda = .{
            // 👇 uri to download
            .url = "https://github.com/softprops/zig-lambda-runtime/archive/refs/tags/v0.1.0.tar.gz",
            // 👇 hash verification
            .hash = "122084e15b7b04f9023ac9dac6f0a1f341dbf8282aa14f51ff553881be73b624361b",
        }
    }
}

🔧 building

Add the following in your build.zig file

const std = @import("std");

pub fn build(b: *std.Build) void {
    const target = b.standardTargetOptions(.{});

    const optimize = b.standardOptimizeOption(.{});
    // 👇 de-reference lambda dep from build.zig.zon
     const lambda = b.dependency("lambda", .{
        .target = target,
        .optimize = optimize,
    });
    // 👇 create an execuable named `bootstrap`. the name `bootstrap` is important
    var exe = b.addExecutable(.{
        .name = "bootstrap",
        .root_source_file = .{ .path = "src/main.zig" },
        .target = target,
        .optimize = optimize,
    });
    // 👇 add the lambda module to executable
    exe.addModule("lambda", lambda.module("lambda"));

    b.installArtifact(exe);
}