gpanders / ztags

Generate tags files for Zig projects
https://git.sr.ht/~gpanders/ztags
MIT License
18 stars 3 forks source link

windows: argv isn't supported on Windows #5

Closed matu3ba closed 1 year ago

matu3ba commented 1 year ago
(ins)$ zig build -Drelease-safe
C:\Users\MadMax\Desktop\zigbin\lib\std\os.zig:251:17: error: argv isn't supported on Windows: use std.process.argsAlloc instead
    .windows => @compileError("argv isn't supported on Windows: use std.process.argsAlloc instead"),
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
referenced by:
    usage: src\main.zig:8:71
    main: src\main.zig:26:17
    remaining reference traces hidden; use '-freference-trace' to see all reference traces

C:\Users\MadMax\Desktop\zigbin\lib\std\os.zig:117:24: error: root struct of file 'c' has no member named 'PROT'
pub const PROT = system.PROT;
                 ~~~~~~^~~~~
C:\Users\MadMax\Desktop\zigbin\lib\std\c.zig:146:122: error: root struct of file 'c' has no member named 'off_t'
pub extern "c" fn mmap(addr: ?*align(page_size) anyopaque, len: usize, prot: c_uint, flags: c_uint, fd: c.fd_t, offset: c.off_t) *anyopaque;
                                                                                                                        ~^~~~~~
error: ztags...
error: The following command exited with error code 1:
C:\Users\MadMax\Desktop\zigbin\zig.exe build-exe C:\Users\MadMax\Desktop\ztags\src\main.zig -OReleaseSafe --cache-dir C:\Users\MadMax\Desktop\ztags\zig-cacpData\Local\zig --name ztags --enable-cache

Related question: Is Windows compatibility a goal or not?

gpanders commented 1 year ago

Both master and 0.10.0 branches use std.process.argsWithAllocator. Are you using an older version maybe?

Related question: Is Windows compatibility a goal or not?

Yes, as long as we can achieve Windows compatibility through using portable functions in Zig's standard library. I don't have any way to test Windows though.

matu3ba commented 1 year ago

Both master and 0.10.0 branches use std.process.argsWithAllocator. Are you using an older version maybe?

I do see:

fn usage() void {
    std.debug.print("Usage: {s} [-o OUTPUT] [-a] [-r] FILES...\n", .{std.os.argv[0]});
}
gpanders commented 1 year ago

Doh, right, I forgot about the usage text.

gpanders commented 1 year ago

Should be fixed in ef562337.

matu3ba commented 1 year ago

fixed in https://github.com/gpanders/ztags/commit/ef5623374892de48e863d3b12814b4968f8411ce.

matu3ba commented 1 year ago

Thanks!