-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviortranslate-cC to Zig source translation feature (@cImport)C to Zig source translation feature (@cImport)
Milestone
Description
Zig Version
0.16.0-dev.452+1f7ee99b3
i'm on macos 26.0
Steps to Reproduce and Observed Behavior
minimal repro build.zig (i just used a foo.h
with a single define):
const std = @import("std");
pub fn build(b: *std.Build) void {
const optimize = b.standardOptimizeOption(.{});
const target = b.standardTargetOptions(.{});
const translate = b.addTranslateC(.{
.root_source_file = b.path("foo.h"),
.optimize = optimize,
.target = target,
});
const output = translate.getOutput();
const i = b.addInstallFile(output, "foo.zig");
b.getInstallStep().dependOn(&i.step);
}
$ zig build
thread 7325870 panic: attempt to use null value
/Users/carmen/.zvm/master/lib/std/Build/Step/TranslateC.zig:200:46: 0x102fc36db in make (build)
translate_c.output_file.path = output_dir.?.joinString(b.allocator, translate_c.out_basename) catch @panic("OOM");
^
/Users/carmen/.zvm/master/lib/std/Build/Step.zig:255:33: 0x102f5aa8f in make (build)
const make_result = s.makeFn(s, options);
^
/Users/carmen/.zvm/master/lib/compiler/build_runner.zig:1248:31: 0x102f39d6b in workerMakeOneStep (build)
const make_result = s.make(.{
^
/Users/carmen/.zvm/master/lib/std/Thread/Pool.zig:118:39: 0x102f3a51b in runFn (build)
@call(.auto, func, closure.arguments);
^
/Users/carmen/.zvm/master/lib/std/Thread/Pool.zig:293:27: 0x102f76293 in worker (build)
runnable.runFn(runnable, id);
^
/Users/carmen/.zvm/master/lib/std/Thread.zig:511:13: 0x102f5823f in callFn__anon_72425 (build)
@call(.auto, f, args);
^
/Users/carmen/.zvm/master/lib/std/Thread.zig:783:30: 0x102f38503 in entryFn (build)
return callFn(f, args_ptr.*);
^
???:?:?: 0x1929b8c07 in ??? (libsystem_pthread.dylib)
???:?:?: 0x1929b3ba7 in ??? (libsystem_pthread.dylib)
error: the following build command crashed:
.zig-cache/o/41dc0e498ae8896dedeb76e025cf4a9b/build /Users/carmen/.zvm/master/zig /Users/carmen/.zvm/master/lib /Users/carmen/tmp .zig-cache /Users/carmen/.cache/zig --seed 0xf529cc0e -Ze56f4a375ad03ecf
Expected Behavior
the above zig build
command should succeed silently
yapxuan, phcreery, Darkyenus and SiimHendrik
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviortranslate-cC to Zig source translation feature (@cImport)C to Zig source translation feature (@cImport)