diff --git a/.gitignore b/.gitignore index 5f85011..4c91142 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ libs/ src/git_version.zig zig-out core +.zig-cache diff --git a/build.zig b/build.zig index c12fc76..af529fa 100644 --- a/build.zig +++ b/build.zig @@ -72,7 +72,7 @@ pub fn build(b: *Builder) !void { // It relies on code gen and is all fouled up when getting imported const exe = b.addExecutable(.{ .name = "demo", - .root_source_file = .{ .path = "src/main.zig" }, + .root_source_file = b.path("src/main.zig"), .target = target, .optimize = optimize, }); @@ -86,13 +86,13 @@ pub fn build(b: *Builder) !void { // Expose module to others _ = b.addModule("aws", .{ - .root_source_file = .{ .path = "src/aws.zig" }, + .root_source_file = b.path("src/aws.zig"), .imports = &.{.{ .name = "smithy", .module = smithy_module }}, }); // Expose module to others _ = b.addModule("aws-signing", .{ - .root_source_file = .{ .path = "src/aws_signing.zig" }, + .root_source_file = b.path("src/aws_signing.zig"), .imports = &.{.{ .name = "smithy", .module = smithy_module }}, }); // TODO: This does not work correctly due to https://github.com/ziglang/zig/issues/16354 @@ -122,7 +122,7 @@ pub fn build(b: *Builder) !void { const cg_exe = b.addExecutable(.{ .name = "codegen", - .root_source_file = .{ .path = "codegen/src/main.zig" }, + .root_source_file = b.path("codegen/src/main.zig"), // We need this generated for the host, not the real target .target = b.host, .optimize = if (b.verbose) .Debug else .ReleaseSafe, @@ -197,7 +197,7 @@ pub fn build(b: *Builder) !void { // Creates a step for unit testing. This only builds the test executable // but does not run it. const unit_tests = b.addTest(.{ - .root_source_file = .{ .path = "src/aws.zig" }, + .root_source_file = b.path("src/aws.zig"), .target = b.resolveTargetQuery(t), .optimize = optimize, }); diff --git a/build.zig.zon b/build.zig.zon index c37a209..33e0a5e 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -2,15 +2,17 @@ .name = "aws", .version = "0.0.1", .paths = .{ - "build.zig", - "build.zig.zon", - "src", + "build.zig", + "build.zig.zon", + "src", + "README.md", + "LICENSE.md", }, .dependencies = .{ .smithy = .{ - .url = "https://git.lerch.org/lobo/smithy/archive/1e534201c4df5ea4f615faeedc69d414adbec0b1.tar.gz", - .hash = "1220af63ae0498010004af79936cedf3fe6702f516daab77ebbd97a274eba1b42aad", + .url = "https://git.lerch.org/lobo/smithy/archive/6083ceefe262bb016033a7dfbd995968c86b48b2.tar.gz", + .hash = "122036fbf9a1aae606de5e1a622d7dbbc37338d0fad7a4a018920c1365a1c49ba497", }, .models = .{ .url = "https://github.com/aws/aws-sdk-go-v2/archive/58cf6509525a12d64fd826da883bfdbacbd2f00e.tar.gz", diff --git a/codegen/src/main.zig b/codegen/src/main.zig index 75a0852..1556204 100644 --- a/codegen/src/main.zig +++ b/codegen/src/main.zig @@ -34,7 +34,7 @@ pub fn main() anyerror!void { models_dir = try std.fs.cwd().openDir(args[i + 1], .{ .iterate = true }); } // TODO: Seems like we should remove this in favor of a package - try output_dir.writeFile("json.zig", json_zig); + try output_dir.writeFile(.{ .sub_path = "json.zig", .data = json_zig }); // TODO: We need a different way to handle this file... const manifest_file_started = false; @@ -123,11 +123,11 @@ fn processDirectories(models_dir: std.fs.Dir, output_dir: std.fs.Dir) !void { // re-calculate so we can store the manifest model_digest = calculated_manifest.model_dir_hash_digest; calculated_manifest = try calculateDigests(models_dir, output_dir, &thread_pool); - try output_dir.writeFile("output_manifest.json", try std.json.stringifyAlloc( + try output_dir.writeFile(.{ .sub_path = "output_manifest.json", .data = try std.json.stringifyAlloc( allocator, calculated_manifest, .{ .whitespace = .indent_2 }, - )); + ) }); } var model_digest: ?[Hasher.hex_multihash_len]u8 = null; diff --git a/src/main.zig b/src/main.zig index 755d771..811dca9 100644 --- a/src/main.zig +++ b/src/main.zig @@ -32,8 +32,8 @@ pub fn log( const prefix = "[" ++ @tagName(level) ++ "] " ++ scope_prefix; // Print the message to stderr, silently ignoring any errors - std.debug.getStderrMutex().lock(); - defer std.debug.getStderrMutex().unlock(); + std.debug.lockStdErr(); + defer std.debug.unlockStdErr(); const stderr = std.io.getStdErr().writer(); nosuspend stderr.print(prefix ++ format ++ "\n", args) catch return; }