✗
Failing This test is currently failing.
Failed: backend
Failure Output
Showing last 10 of 34 lines
Build Summary: 1/5 steps succeeded; 1 failed
install transitive failure
+- install backend transitive failure
+- compile exe backend Debug native transitive failure
+- compile obj backend_output Debug native 2 errors
+- compile obj backend_output Debug native (reused)
error: the following build command failed with exit code 1:
.zig-cache/o/25c2ea9919e697df10a386ed9c621788/build /opt/homebrew/Cellar/zig/0.15.2_1/bin/zig /opt/homebrew/Cellar/zig/0.15.2_1/lib/zig /Users/larsde/src/koru/tests/regression/300_ADVANCED_FEATURES/310_COMPTIME/310_050_build_flag_check .zig-cache /var/folders/9k/sprb5df11_79lbnlyttj6sfm0000gn/T/koru-regression-cache --seed 0x88a0a903 -Z64167dc9da9510ae Code
// Test: CompilerEnv.hasFlag() with InvocationMeta for build configuration
// When --build=release is passed, only [release] annotated configs should activate
~import std/io
const std = @import("std");
const Root = @import("root");
// A comptime event that checks build configuration (no Source, just meta)
~[comptime]pub event check-build { meta: InvocationMeta }
| activated []const u8
| skipped []const u8
~proc check-build|zig {
// If no annotations, skip
if (meta.annotations.len == 0) {
return .{ .skipped = "no annotation" };
}
// Check known build configs with comptime strings
for (meta.annotations) |ann| {
if (std.mem.eql(u8, ann, "release")) {
if (Root.CompilerEnv.hasFlag("build=release")) {
return .{ .activated = "release" };
}
}
if (std.mem.eql(u8, ann, "debug")) {
if (Root.CompilerEnv.hasFlag("build=debug")) {
return .{ .activated = "debug" };
}
}
}
// No matching build flag - skip this config
return .{ .skipped = "no matching flag" };
}
// Test with [release] annotation - should activate when --build=release
~[release]check-build()
| activated _ |> std/io:print("release: ACTIVATED\n")
| skipped _ |> std/io:print("release: skipped\n")
// Test with [debug] annotation - should activate when --build=debug
~[debug]check-build()
| activated _ |> std/io:print("debug: ACTIVATED\n")
| skipped _ |> std/io:print("debug: skipped\n")
Test Configuration
MUST_RUN