1
0
Fork 0
mirror of https://github.com/zigzap/zap.git synced 2025-10-20 15:14:08 +00:00

make latest patches work on zig master

This commit is contained in:
Rene Schallner 2024-02-23 20:34:19 +01:00
parent 4393866ea5
commit d51a0b8ca3
8 changed files with 19 additions and 35 deletions

View file

@ -22,6 +22,17 @@ jobs:
- name: Check zig version
run: zig version
- name: Build all examples
run: ./build_all.sh
- name: Run all tests
run: zig build test
run: zig build all
# - name: Run all tests
# run: zig build test
# Run tests separately so we can see more clearly which one fails
- name: Run mustache tests
run: zig build test-mustache
- name: Run httpparams tests
run: zig build test-httpparams
- name: Run sendfile tests
run: zig build test-sendfile
- name: Run authentication tests
run: zig build test-authentication
- name: Report end of tests
run: echo "tests finished"

View file

@ -37,7 +37,7 @@ jobs:
sleep 3
zig build
- name: Build all examples
run: ./build_all.sh
run: zig build all
- name: Run authentication tests
run: zig build test-authentication
- name: Run http parameter tests

View file

@ -25,6 +25,6 @@ jobs:
- name: Check zig version
run: zig version
- name: Build all examples
run: ./build_all.sh
run: zig build all
- name: Run all tests
run: zig build test

View file

@ -3,7 +3,7 @@ const build_facilio = @import("facil.io/build.zig").build_facilio;
pub fn build(b: *std.Build) !void {
const target = b.standardTargetOptions(.{});
if (target.getOsTag() == .windows) {
if (target.result.os.tag == .windows) {
std.log.err("\x1b[31mPlatform Not Supported\x1b[0m\nCurrently, Facil.io and Zap are not compatible with Windows. Consider using Linux or Windows Subsystem for Linux (WSL) instead.\nFor more information, please see:\n- https://github.com/zigzap/zap#most-faq\n- https://facil.io/#forking-contributing-and-all-that-jazz\n", .{});
std.os.exit(1);
}

View file

@ -1,6 +0,0 @@
#!/usr/bin/env bash
for i in $(cat targets.txt) ; do
echo "-------------------------------------------"
echo $i $*
zig build $i $*
done

View file

@ -111,7 +111,7 @@ pub const HttpParamBinaryFile = struct {
filename: ?[]const u8 = null,
/// format function for printing file upload data
pub fn format(value: @This(), comptime _: []const u8, _: std.fmt.FormatOptions, writer: anytype) std.os.WriteError!void {
pub fn format(value: @This(), comptime _: []const u8, _: std.fmt.FormatOptions, writer: anytype) !void {
const d = value.data orelse "\\0";
const m = value.mimetype orelse "null";
const f = value.filename orelse "null";

View file

@ -1,21 +0,0 @@
hello
hello2
routes
serve
hello_json
endpoint
wrk
wrk_zigstd
mustache
endpoint_auth
http_params
pkghash
cookies
websockets
userpass_session
sendfile
middleware
middleware_with_endpoint
senderror
bindataformpost
announceybot

View file

@ -6,7 +6,7 @@ pub fn main() !void {
}){};
const allocator = gpa.allocator();
var server = std.http.Server.init(allocator, .{
var server = std.http.Server.init(.{
.reuse_address = true,
});
defer server.deinit();