Compare commits
7 commits
abd422edb7
...
0623e9749e
| Author | SHA1 | Date | |
|---|---|---|---|
| 0623e9749e | |||
| 0171cfc1f1 | |||
| 7e6b360610 | |||
| 242d4b5f44 | |||
| d697df6fd6 | |||
| 9ac1052e01 | |||
| 2fddf4f122 |
8 changed files with 48 additions and 59 deletions
|
|
@ -3,7 +3,7 @@ on:
|
|||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- 'zig-0.14.x'
|
||||
- 'zig-0.15.x'
|
||||
env:
|
||||
ACTIONS_RUNTIME_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
ACTIONS_RUNTIME_URL: ${{ env.GITHUB_SERVER_URL }}/api/actions_pipeline/
|
||||
|
|
@ -18,11 +18,9 @@ jobs:
|
|||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: zig-0.14.x
|
||||
ref: zig-0.15.x
|
||||
- name: Setup Zig
|
||||
uses: https://codeberg.org/mlugg/setup-zig@v2.2.1
|
||||
with:
|
||||
version: 0.14.0
|
||||
- name: Run smoke test
|
||||
run: zig build smoke-test --verbose
|
||||
- name: Run full tests
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
[tools]
|
||||
prek = "0.3.1"
|
||||
"ubi:DonIsaac/zlint" = "0.7.9"
|
||||
zig = "0.16.0"
|
||||
zls = "0.15.1"
|
||||
zig = "master"
|
||||
zls = "0.16.0"
|
||||
|
|
|
|||
15
Makefile
15
Makefile
|
|
@ -1,15 +0,0 @@
|
|||
start-hand-test: src/main.zig src/aws.zig src/xml.zig
|
||||
@zig build-exe -static -I/usr/local/include -Isrc/ -lc --strip \
|
||||
--name start-hand-test src/main.zig src/bitfield-workaround.c \
|
||||
/usr/local/lib64/libaws-c-*.a \
|
||||
/usr/local/lib64/libs2n.a \
|
||||
/usr/local/lib/libcrypto.a \
|
||||
/usr/local/lib/libssl.a
|
||||
|
||||
elasticurl: curl.c
|
||||
@zig build-exe -static -I/usr/local/include -Isrc/ -lc --strip \
|
||||
--name elasticurl curl.c \
|
||||
/usr/local/lib64/libaws-c-*.a \
|
||||
/usr/local/lib64/libs2n.a \
|
||||
/usr/local/lib/libcrypto.a \
|
||||
/usr/local/lib/libssl.a
|
||||
10
README.md
10
README.md
|
|
@ -1,17 +1,17 @@
|
|||
AWS SDK for Zig
|
||||
===============
|
||||
|
||||
[Zig 0.15.1](https://ziglang.org/download/#release-0.15.1):
|
||||
[Zig 0.16.0](https://ziglang.org/download/#release-0.16.0):
|
||||
|
||||
[](https://git.lerch.org/lobo/aws-sdk-for-zig/actions?workflow=build.yaml&state=closed)
|
||||
[](https://git.lerch.org/lobo/aws-sdk-for-zig/actions?workflow=build.yaml&state=closed)
|
||||
|
||||
[Nightly Zig](https://ziglang.org/download/):
|
||||
|
||||
[](https://git.lerch.org/lobo/aws-sdk-for-zig/actions?workflow=zig-nightly.yaml&state=closed)
|
||||
|
||||
[Zig 0.14.1](https://ziglang.org/download/#release-0.14.1):
|
||||
[Zig 0.15.2](https://ziglang.org/download/#release-0.15.2):
|
||||
|
||||
[](https://git.lerch.org/lobo/aws-sdk-for-zig/actions?workflow=zig-previous.yaml&state=closed)
|
||||
[](https://git.lerch.org/lobo/aws-sdk-for-zig/actions?workflow=zig-previous.yaml&state=closed)
|
||||
|
||||
Current executable size for the demo is 980k after compiling with -Doptimize=ReleaseSmall
|
||||
in x86_64-linux, and will vary based on services used. Tested targets:
|
||||
|
|
@ -34,7 +34,7 @@ Branches
|
|||
a new zig release appears. Expect significant delays in any
|
||||
build failures (PRs always welcome!).
|
||||
* **master**: This branch tracks the latest released zig version
|
||||
* **zig-0.14.x**: This branch tracks the 0.14/0.14.1 released zig versions.
|
||||
* **zig-0.15.x**: This branch tracks the 0.15.2 released zig version.
|
||||
Support for these previous version is best effort, generally
|
||||
degrading over time. Fixes will generally appear in master, then
|
||||
backported into the previous version.
|
||||
|
|
|
|||
|
|
@ -57,30 +57,32 @@ pub fn main(init: std.process.Init) anyerror!void {
|
|||
models_dir = try std.Io.Dir.cwd().openDir(io, args[i + 1], .{ .iterate = true });
|
||||
}
|
||||
|
||||
var manifest_file = try output_dir.createFile(io, "service_manifest.zig", .{});
|
||||
defer manifest_file.close(io);
|
||||
var manifest = manifest_file.writer(io, &manifest_buf).interface;
|
||||
defer manifest.flush() catch @panic("Could not flush service manifest");
|
||||
var files_processed: usize = 0;
|
||||
var skip_next = true;
|
||||
for (args) |arg| {
|
||||
if (skip_next) {
|
||||
skip_next = false;
|
||||
continue;
|
||||
}
|
||||
if (std.mem.eql(u8, "--verbose", arg)) {
|
||||
verbose = true;
|
||||
continue;
|
||||
}
|
||||
{
|
||||
var manifest_file = try output_dir.createFile(io, "service_manifest.zig", .{});
|
||||
defer manifest_file.close(io);
|
||||
var manifest = manifest_file.writer(io, &manifest_buf).interface;
|
||||
defer manifest.flush() catch @panic("Could not flush service manifest");
|
||||
var skip_next = true;
|
||||
for (args) |arg| {
|
||||
if (skip_next) {
|
||||
skip_next = false;
|
||||
continue;
|
||||
}
|
||||
if (std.mem.eql(u8, "--verbose", arg)) {
|
||||
verbose = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (std.mem.eql(u8, "--models", arg) or
|
||||
std.mem.eql(u8, "--output", arg))
|
||||
{
|
||||
skip_next = true;
|
||||
continue;
|
||||
if (std.mem.eql(u8, "--models", arg) or
|
||||
std.mem.eql(u8, "--output", arg))
|
||||
{
|
||||
skip_next = true;
|
||||
continue;
|
||||
}
|
||||
try processFile(io, arg, output_dir, &manifest);
|
||||
files_processed += 1;
|
||||
}
|
||||
try processFile(io, arg, output_dir, &manifest);
|
||||
files_processed += 1;
|
||||
}
|
||||
if (files_processed == 0) {
|
||||
// no files specified, look for json files in models directory or cwd
|
||||
|
|
@ -102,7 +104,15 @@ pub fn main(init: std.process.Init) anyerror!void {
|
|||
|
||||
if (verbose) {
|
||||
const output_path = try output_dir.realPathFileAlloc(io, ".", allocator);
|
||||
// Build system suppresses stdout, we have to send this to stderr
|
||||
std.debug.print("Output path: {s}\n", .{output_path});
|
||||
std.debug.print(
|
||||
\\Note: if this is run from within zig build, output from verbose mode will
|
||||
\\ trigger zig to say 'failed command'. This program has succeeded,
|
||||
\\ and the message from the build system will not effect actual processing
|
||||
\\ of the build. It is simply indicative of the build runner detecting
|
||||
\\ output
|
||||
, .{});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
|
||||
.dependencies = .{
|
||||
.aws = .{
|
||||
.url = "https://git.lerch.org/api/packages/lobo/generic/aws-sdk-with-models/e41f98b389539c8bc6b1a231d25e2980318e5ef4/e41f98b389539c8bc6b1a231d25e2980318e5ef4-with-models.tar.gz",
|
||||
.hash = "aws-0.0.1-SbsFcI0RCgBdf1nak95gi1kAtI6sv3Ntb7BPETH30fpS",
|
||||
.url = "https://git.lerch.org/api/packages/lobo/generic/aws-sdk-with-models/2fddf4f122198ba64fbb2320e702b317b0b86837/2fddf4f122198ba64fbb2320e702b317b0b86837-with-models.tar.gz",
|
||||
.hash = "aws-0.0.1-SbsFcLhoAwQ5TcclMwXhIljwW0Zz_Kcjd4yrIeQq5uHt",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,12 +11,11 @@ pub const std_options: std.Options = .{
|
|||
},
|
||||
};
|
||||
|
||||
pub fn main() anyerror!void {
|
||||
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
|
||||
defer _ = gpa.deinit();
|
||||
const allocator = gpa.allocator();
|
||||
pub fn main(init: std.process.Init) anyerror!void {
|
||||
const allocator = init.gpa;
|
||||
const io = init.io;
|
||||
var stdout_buffer: [1024]u8 = undefined;
|
||||
var stdout_raw = std.fs.File.stdout().writer(&stdout_buffer);
|
||||
var stdout_raw = std.Io.File.stdout().writer(io, &stdout_buffer);
|
||||
const stdout = &stdout_raw.interface;
|
||||
defer stdout.flush() catch unreachable;
|
||||
|
||||
|
|
@ -28,10 +27,7 @@ pub fn main() anyerror!void {
|
|||
// };
|
||||
//
|
||||
// var client = aws.Client.init(allocator, .{ .proxy = proxy });
|
||||
var threaded: std.Io.Threaded = .init(allocator);
|
||||
defer threaded.deinit();
|
||||
const io = threaded.io();
|
||||
var client = aws.Client.init(allocator, .{ .io = io });
|
||||
var client = aws.Client.init(allocator, .{ .io = io, .map = init.environ_map });
|
||||
defer client.deinit();
|
||||
|
||||
const options = aws.Options{
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
{
|
||||
"ignore": ["lib/json/src/json.zig"]
|
||||
"ignore": ["lib/json/src/json.zig", "codegen/src/Hasher.zig"]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue