zig-clap icon indicating copy to clipboard operation
zig-clap copied to clipboard

zig-clap doesn't build with zig 0.9.1

Open pepijno opened this issue 2 years ago • 5 comments

Taking a checkout of master (commit ac5f465) and running zig build results in the following error:

./clap.zig:913:19: error: default_value of field 'help' is of type '*const bool', expected 'bool' or '?bool'
    return @Type(.{ .Struct = .{
                  ^
./clap.zig:680:24: note: called from here
        args: Arguments(Id, params, value_parsers, .slice),
                       ^
./clap.zig:680:24: note: called from here
        args: Arguments(Id, params, value_parsers, .slice),

zig version is 0.9.1. Running zig build test has the following errors:

./clap.zig:913:19: error: default_value of field 'str' is of type '*const ?[]const u8', expected '?[]const u8' or '??[]const u8'
    return @Type(.{ .Struct = .{
                  ^
./clap.zig:812:24: note: called from here
        args: Arguments(Id, params, value_parsers, .slice),
                       ^
./clap.zig:812:24: note: called from here
        args: Arguments(Id, params, value_parsers, .slice),
                       ^
./clap.zig:913:19: error: default_value of field 'aa' is of type '*const bool', expected 'bool' or '?bool'
    return @Type(.{ .Struct = .{
                  ^
./clap.zig:812:24: note: called from here
        args: Arguments(Id, params, value_parsers, .slice),
                       ^
./clap.zig:812:24: note: called from here
        args: Arguments(Id, params, value_parsers, .slice),
                       ^
./clap.zig:913:19: error: default_value of field 'aa' is of type '*const bool', expected 'bool' or '?bool'
    return @Type(.{ .Struct = .{
                  ^
./clap.zig:812:24: note: called from here
        args: Arguments(Id, params, value_parsers, .slice),
                       ^
./clap.zig:812:24: note: called from here
        args: Arguments(Id, params, value_parsers, .slice),

pepijno avatar Apr 10 '22 19:04 pepijno

Hi. The master branch of zig-clap targets zig master. The tagged releases of clap target tagged releases of zig

Hejsil avatar Apr 11 '22 06:04 Hejsil

The master branch of zig-clap targets zig master

Would it be a good idea to make this clear in the readme?

tealsnow avatar Jun 07 '22 19:06 tealsnow

Would it be a good idea to make this clear in the readme?

Similarly it would be good to know what I should do for 0.9.1; there's no 0.9.x tag, so I guessed the latest smaller tag (0.5.0), which seems to build OK—but now I have no idea how to install the library. I guess this isn't a zig-clap-specific question, but being new to zig, I'm a bit lost where to start, and zig build install --verbose suggests that no installation is actually being done!

Thanks for zig-clap! I looked at zig a while ago and found no command-line parser, and so gave up, as that's central to the sort of programs I write; it's good to see that now there is good support.

rrthomas avatar Jul 21 '22 22:07 rrthomas

The master branch of zig-clap targets zig master

Would it be a good idea to make this clear in the readme?

Yes, this makes sense. I'll add a little note.

Similarly it would be good to know what I should do for 0.9.1; there's no 0.9.x tag, so I guessed the latest smaller tag (0.5.0), which seems to build OK—but now I have no idea how to install the library. I guess this isn't a zig-clap-specific question, but being new to zig, I'm a bit lost where to start, and zig build install --verbose suggests that no installation is actually being done!

Each release of zig-clap specifies on the release notes which version it targets, though everyone might not look there, so I'll also add to the readme that each release of clap targets a release of zig.

As for install. A similar question has been asked here.

Hejsil avatar Jul 22 '22 08:07 Hejsil

Thanks very much for taking the time to give detailed answers to this newbie!

rrthomas avatar Jul 22 '22 09:07 rrthomas