Hi,
I break the Zig build… to which it does not provide rhyme or reason (or a good one anyway).
❯ zig build
install
└─ install keep-alive
└─ zig build-exe keep-alive Debug native failure
error: the following command terminated unexpectedly:
/opt/zig-linux-x86_64-0.15.0-dev.208+8acedfd5b/zig build-exe -ODebug --dep utils --dep microsmart -Mroot=/home/anonymous/Laboratory/Zig/pascal-string/src/cmd/keep-alive.zig -ODebug -Mutils=/home/anonymous/Laboratory/Zig/pascal-string/src/utils/Assemble.zig -ODebug --dep utils -Mmicrosmart=/home/anonymous/Laboratory/Zig/pascal-string/src/microsmart/Assemble.zig --cache-dir /home/anonymous/Laboratory/Zig/pascal-string/.zig-cache --global-cache-dir /home/anonymous/.cache/zig --name keep-alive --zig-lib-dir /opt/zig-linux-x86_64-0.15.0-dev.208+8acedfd5b/lib/ --listen=-
Build Summary: 0/3 steps succeeded; 1 failed
install transitive failure
└─ install keep-alive transitive failure
└─ zig build-exe keep-alive Debug native failure
error: the following build command failed with exit code 1:
/home/anonymous/Laboratory/Zig/pascal-string/.zig-cache/o/c877d0d0d6381fd3f8e963ccc2c00249/build /opt/zig-linux-x86_64-0.15.0-dev.208+8acedfd5b/zig /opt/zig-linux-x86_64-0.15.0-dev.208+8acedfd5b/lib /home/anonymous/Laboratory/Zig/pascal-string /home/anonymous/Laboratory/Zig/pascal-string/.zig-cache /home/anonymous/.cache/zig --seed 0x774524a3 -Za2d3715e6aee1600
I have boiled it down to when I:
const args = ThreadArgs{ .service = &acq };
const threadConfig = std.Thread.SpawnConfig{
.stack_size = 1024 * 16,
};
var th = try std.Thread.spawn(
threadConfig,
runner,
.{ .ta = args}, // <<< this line breaks the compiler
){};
When trying
var th = try std.Thread.spawn(
threadConfig,
runner,
.{ args},
){};
I get
src/cmd/keep-alive.zig:35:10: error: unable to evaluate comptime expression
.{ args},
My question being: How does one run a “method” on a struct, that takes *Self as the receiver from a Thread spawn.
My observation being: That this breaks the compiler to the point that this could potentially be very tough to find from the error… Not going to make a meal of it, hope you as the reader will see how the error does not correlate at all to the failure. I know Zig is pre-release; but if this is not a known bug then maybe somebody can take notice thereof.
I have tested this against 0.14 and 0.15(latest). Same issue.
Regards and Thanks,