vrischmann / zig-sqlite

zig-sqlite is a small wrapper around sqlite's C API, making it easier to use with Zig.
MIT License
367 stars 49 forks source link

Build panics when specify a glibc version #147

Closed hawkbee closed 9 months ago

hawkbee commented 10 months ago

zig-sqlite commit

3d8e617c43d04

Zig version

0.12.0-dev.1800+559e216f3

Steps to reproduce

I am run an x86_64 linux and want to target to a diffirent glibc version.

╰─➤  uname -m -s -r
Linux 6.1.64-1-MANJARO x86_64

╰─➤zig build -Doptimize=ReleaseSafe -Dtarget=native-linux-gnu.2.28
thread 119243 panic: invalid enum value
/usr/lib/zig/lib/std/zig/CrossTarget.zig:616:46: 0x2dbd80 in zigTriple (build)
        try result.writer().print("-{s}.", .{@tagName(self.getAbi())});
                                             ^
/home/hequn/router/zig/zig-sqlite/build.zig:330:39: 0x2d6ccf in build (build)
            try cross_target.zigTriple(b.allocator),
                                      ^
/usr/lib/zig/lib/std/Build.zig:1883:43: 0x2c2b84 in runBuild__anon_6856 (build)
        .ErrorUnion => try build_zig.build(b),
                                          ^
/usr/lib/zig/lib/build_runner.zig:313:29: 0x2be702 in main (build)
        try builder.runBuild(root);
                            ^
/usr/lib/zig/lib/std/start.zig:585:37: 0x2a9a55 in posixCallMainAndExit (build)
            const result = root.main() catch |err| {
                                    ^
/usr/lib/zig/lib/std/start.zig:253:5: 0x2a9541 in _start (build)
    asm volatile (switch (native_arch) {
    ^
???:?:?: 0x8 in ??? (???)
Unwind information for `???:0x8` was not available, trace may be incomplete

Expected behaviour

This cross compile can compile successful.

vrischmann commented 9 months ago

This was fixed with #150. Please let me know if it didn't fix it for you.