zigzap / zap

blazingly fast backends in zig
MIT License
1.98k stars 71 forks source link

Zap won't compile on Microsoft Windows. #74

Closed FoxTale-Labs closed 5 months ago

FoxTale-Labs commented 5 months ago

I've been trying to create a project using Zap and building it, but Zap throws an error making my project unable to compile. I've tried many things to get it working and verified my build files, but the error persists and comes out of Zap's build file it seems.

Here is the error image

and comes from here within Zap (build.zig) image

My build.zig (shortened)

const std = @import("std");

pub fn build(b: *std.Build) void {
    // ...

    const exe = b.addExecutable(.{
        .name = "api",
        .root_source_file = .{ .path = "src/main.zig" },
        .target = target,
        .optimize = optimize,
    });

    // LOADING ZAP
    const zap = b.dependency("zap", .{
        .target = target,
        .optimize = optimize,
        .openssl = false, // set to true to enable TLS support
    });
    exe.addModule("zap", zap.module("zap"));
    exe.linkLibrary(zap.artifact("facil.io"));

    b.installArtifact(exe);

    // ...
}

My build.zig.zon file (shortened)

.{
    .dependencies = .{
        // zap v0.5.0
        .zap = .{
            .url = "https://github.com/zigzap/zap/archive/refs/tags/v0.5.0.tar.gz",
            .hash = "1220aabff84ad1d800f5657d6a49cb90dab3799765811ada27faf527be45dd315a4d",
        },
    },
}

Version of Zig 0.11.0 Version of Zap 0.5.0 Version of Windows Windows 11 - Build 23620.1000 - 22H2

renerocksai commented 5 months ago

Zap doesn't work on Windows. You can use WSL2 or docker on Windows.

That's actually at the very top of the readme, in the faq

Froxcey commented 5 months ago

Would it be better if build.zig provides a better error message when someone does try building on Windows? You can re-open the issue and I can add that real quick.