zig icon indicating copy to clipboard operation
zig copied to clipboard

Code runs on Linux and macOS but freezes up compiling on Windows

Open prime31 opened this issue 4 years ago • 4 comments

I don't know how to get more information from the compiler for this one (extra logging). I'll describe the issue here and if you let me know how to add some more useful information/logs I can get them for you. Everything works fine on macOS and Linux but on Windows the compiler hangs at "Executing task: zig build run".

main.zig

const fna_image = @import("fna_image");

// later in main
_ = fna_image.load(device, "assets/font.png");

fna_image.zig

pub fn load(device: ?*c_void, file: [*c]const u8) i32 {
    // uncommenting this line on Windows cause the Zig compiler to freeze
    // on "Executing task: zig build run" with no other logs
    // var rw = sdl.SDL_RWFromFile(file, "rb");
    return 1;
}

prime31 avatar May 08 '20 01:05 prime31

label:os-windows

Mouvedia avatar Aug 30 '20 13:08 Mouvedia

I think I'm experiencing the same issue. In my case it manifests when I attempt to @cInclude the SDL2/SDL.h header and use some sdl functionality in two separate zig files. No problems if I keep all the sdl calls in one file.

I end up with a couple of hanging zig.exe instances which I have to kill before I can build again. Possibly some kind of compile time ambiguity/race? Happy to collect more info.

Chris-E-J-Ellis avatar Oct 25 '20 14:10 Chris-E-J-Ellis

@Chris-E-J-Ellis that's #4568?

Mouvedia avatar Oct 25 '20 14:10 Mouvedia

@Chris-E-J-Ellis that's #4568?

Ah, you're completely correct, should have done a bit more searching before my comment, just saw sdl was mentioned and thought this one looked similar.

Chris-E-J-Ellis avatar Oct 25 '20 16:10 Chris-E-J-Ellis