#Zig Commandline doesn't recompile?

1 messages · Page 1 of 1 (latest)

stiff raft
#

So i have this file that i want to test,
it has a datastructure and then just

test "the_test" {
...
}

When I change something and wanna try to see if it now works, it just doesn't return anything. (see pic)

I do change things in the file tbc, and the test for sure isn't passing.
It sometimes does actually recompile but only sometimes.
How does this happen?

orchid herald
#

You can run zig test octtree.zig -femit-bin=octtree.exe --test-no-exec and ./octtree.exe separately to see whether the compiler or the test is crashing

stiff raft
#

but it sometimes does succeed

#

with the exact same code and give me normal compiler errors

orchid herald
#

then you are triggering a compiler bug and should create an issue with reproduction steps

stiff raft
#

ic, ok thx

#
const std = @import("std");

const Fizz = struct {
    pub const FooBar = union(enum) {
        b: ?*[2]FooBar,
    };

    pub fn foo() !void {
        var foos: [1]FooBar = .{FooBar{ .b = null }};

        for (&foos) |*n| {
            n.* = FooBar{ .b = null };
        }
    }
};

test "simple test" {
    try Fizz.foo();
}
``` smallest example i can get il make gh issue now
orchid herald
#

nice, you crashed llvm

stiff raft
#

oh?

orchid herald
#

fwiw the workaround is zig test octtree.zig -fstrip

sonic merlin
stiff raft
#

doesn't show any errors so i don't think so

#

it never even shows "LLVM Emit Object..."

stiff raft
orchid herald