Skip to content

intentional @compileError limits zig to a very narrow band of posix systems #13565

@jrmarino

Description

@jrmarino

zig/lib/std/os.zig

Lines 5284 to 5300 in aea617c

.freebsd => {
comptime if (builtin.os.version_range.semver.max.order(.{ .major = 13, .minor = 0 }) == .lt)
@compileError("querying for canonical path of a handle is unsupported on FreeBSD 12 and below");
var kfile: system.kinfo_file = undefined;
kfile.structsize = system.KINFO_FILE_SIZE;
switch (errno(system.fcntl(fd, system.F.KINFO, @ptrToInt(&kfile)))) {
.SUCCESS => {},
.BADF => return error.FileNotFound,
else => |err| return unexpectedErrno(err),
}
const len = mem.indexOfScalar(u8, &kfile.path, 0) orelse MAX_PATH_BYTES;
mem.copy(u8, out_buffer, kfile.path[0..len]);
return out_buffer[0..len];
},
else => @compileError("querying for canonical path of a handle is unsupported on this host"),

so zig 10.0.0 will intentionally does not compile on < FreeBSD 13 and not at all on DragonFly or NetBSD?

There wouldn't be a reason to leave it in Ravenports if that's the case.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions