From c433d7afb044370f2e5362028e637a1e4bb8839c Mon Sep 17 00:00:00 2001 From: Joseph Wright Date: Sat, 9 May 2026 01:06:49 -0400 Subject: [PATCH] Update README.md and example for Zig 0.16 --- README.md | 10 ++++------ examples/s3-list-buckets/build.zig.zon | 4 ++-- examples/s3-list-buckets/src/main.zig | 8 +++----- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 57d8a99904..2224a8839d 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ An AWS SDK for Zig, providing AWS service clients from [Smithy models](https://aws.amazon.com/blogs/aws/introducing-aws-api-models-and-publicly-available-resources-for-aws-api-definitions/), built using a Kotlin code generator. -Requires Zig 0.15.0 or later. +The latest changes require Zig 0.16.0 or later. The `zig-0.15` branch exists for Zig 0.15.x. ## Available Services @@ -33,13 +33,11 @@ const std = @import("std"); const aws = @import("aws"); const s3 = @import("s3"); -pub fn main() !void { - var gpa: std.heap.GeneralPurposeAllocator(.{}) = .init; - defer _ = gpa.deinit(); - const allocator = gpa.allocator(); +pub fn main(init: std.process.Init) !void { + const allocator = init.gpa; // Load configuration from the environment and/or ~/.aws directory. - var config = try aws.Config.load(allocator, .{}); + var config = try aws.Config.load(allocator, init.io, init.environ_map, .{}); defer config.deinit(); // Create the S3 client. diff --git a/examples/s3-list-buckets/build.zig.zon b/examples/s3-list-buckets/build.zig.zon index cdc54a35fc..799c6b4cd1 100644 --- a/examples/s3-list-buckets/build.zig.zon +++ b/examples/s3-list-buckets/build.zig.zon @@ -5,8 +5,8 @@ .minimum_zig_version = "0.15.2", .dependencies = .{ .aws_sdk = .{ - .url = "git+https://github.com/cloudboss/aws-sdk-zig.git#4be9ffd8e4e081f68504c31d0a8cb742c1b811a4", - .hash = "aws_sdk-0.0.1-ApQSL4OTMhDFbTJtcTNhB2oXNQ9J2ROPTvfV-Hvljt6x", + .url = "git+https://github.com/cloudboss/aws-sdk-zig.git#4b8e0646cbe1622f8fd07daf7e22df3bfee7c1e0", + .hash = "aws_sdk-0.0.1-ApQSL-HdixBVxS0U-xc2jrtlR4oL90TbPgVBl9BoLpJi", }, }, .paths = .{ diff --git a/examples/s3-list-buckets/src/main.zig b/examples/s3-list-buckets/src/main.zig index b23b615f5c..25e673380a 100644 --- a/examples/s3-list-buckets/src/main.zig +++ b/examples/s3-list-buckets/src/main.zig @@ -3,13 +3,11 @@ const std = @import("std"); const aws = @import("aws"); const s3 = @import("s3"); -pub fn main() !void { - var gpa: std.heap.DebugAllocator(.{}) = .init; - defer _ = gpa.deinit(); - const allocator = gpa.allocator(); +pub fn main(init: std.process.Init) !void { + const allocator = init.gpa; // Load configuration from the environment and/or ~/.aws directory. - var config = try aws.Config.load(allocator, .{}); + var config = try aws.Config.load(allocator, init.io, init.environ_map, .{}); defer config.deinit(); // Create an S3 client.