-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavior
Description
Zig Version
0.16.0-dev.1363+d2b1aa48a
Steps to Reproduce and Observed Behavior
install
└─ install test
└─ compile exe test Debug native 1 errors
.zig-cache/o/e41889ec32e3fb4ce338a9a64d670654/journal.zig:435:9: error: expected statement, found 'pub'
pub const b = @compileError("unable to resolve var init expr");
^~~
error: 1 compilation errors
failed command: /opt/zig-x86_64-linux-0.16.0-dev.1363+d2b1aa48a/zig build-exe -lsystemd -fsanitize-c=full -ODebug --dep journal -Mroot=/home/kmarek/git/zig-systemd-test/main.zig -ODebug -Mjournal=.zig-cache/o/e41889ec32e3fb4ce338a9a64d670654/journal.zig -lc --cache-dir .zig-cache --global-cache-dir /home/kmarek/.cache/zig --name test --zig-lib-dir /opt/zig-x86_64-linux-0.16.0-dev.1363+d2b1aa48a/lib/ --listen=-
Build Summary: 1/4 steps succeeded (1 failed)
install transitive failure
└─ install test transitive failure
└─ compile exe test Debug native 1 errors
error: the following build command failed with exit code 1:
.zig-cache/o/f8b17bc098d58944d4143cab677a593d/build /opt/zig-x86_64-linux-0.16.0-dev.1363+d2b1aa48a/zig /opt/zig-x86_64-linux-0.16.0-dev.1363+d2b1aa48a/lib /home/kmarek/git/zig-systemd-test .zig-cache /home/kmarek/.cache/zig --seed 0x40d7cc4b -Zc19a739fec1e265e
// build.zig
const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const exe_mod = b.createModule(.{
.root_source_file = b.path("main.zig"),
.target = target,
.sanitize_c = if (optimize == .Debug) .full else .off,
.optimize = optimize,
.link_libc = true,
});
exe_mod.linkSystemLibrary("systemd", .{ .use_pkg_config = .no });
exe_mod.addImport("journal", b.addTranslateC(.{
.root_source_file = b.path("journal.c"),
.optimize = optimize,
.target = target,
}).createModule());
b.installArtifact(b.addExecutable(.{
.name = "test",
.root_module = exe_mod,
}));
}// journal.c
#include <systemd/sd-journal.h>// main.zig
const journal = @import("journal");
pub fn main() !void {
_ = journal;
}Expected Behavior
Should have compiled OK (0.15.2 compiles OK)
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavior