Skip to content

Instantly share code, notes, and snippets.

@mcandre
Created December 8, 2020 23:28
Show Gist options
  • Save mcandre/cad7173e3a686b54343bca57fbfd3125 to your computer and use it in GitHub Desktop.
Save mcandre/cad7173e3a686b54343bca57fbfd3125 to your computer and use it in GitHub Desktop.
zig build log
$ cat src/zag/main.zig
const std = @import("std");
pub fn main() !void {
const stdout = std.io.getStdOut().writer();
//
// The OK triples from:
// https://github.com/ziglang/zig-bootstrap#supported-triples
//
const targets = .{
"aarch64-linux-musl",
"arm-linux-musleabi",
"arm-linux-musleabihf",
"i386-linux-musl",
"i386-windows-gnu",
"riscv64-linux-musl",
"x86_64-linux-gnu",
"x86_64-linux-musl",
"x86_64-windows-gnu"
};
for (targets) |target| {
try stdout.print("Target: {}\n", .{target});
}
}
$ zig build run
./src/zag/main.zig:22:5: error: unable to evaluate constant expression
for (targets) |target| {
^
/opt/zig-linux-x86_64-0.7.0/lib/zig/std/start.zig:334:40: note: referenced here
const result = root.main() catch |err| {
^
hello...The following command exited with error code 1:
/opt/zig-linux-x86_64-0.7.0/zig build-exe /home/andrew/go/src/github.com/mcandre/zag/src/zag/main.zig --cache-dir /home/andrew/go/src/github.com/mcandre/zag/zig-cache --name hello --enable-cache
error: the following build command failed with exit code 1:
/home/andrew/go/src/github.com/mcandre/zag/zig-cache/o/68d6938bd7d630495eb00989ce2534c0/build /opt/zig-linux-x86_64-0.7.0/zig /home/andrew/go/src/github.com/mcandre/zag /home/andrew/go/src/github.com/mcandre/zag/zig-cache run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment