I’m attempting to use Zig on OpenBSD-current. I have to perform seemingly every action, from viewing zig build —help to actually building a project, as root. This hasn’t been a problem with make, the uxn assembler, etc. What do I need to do to make this easier?

(I am using zig-0.15.2 from the package repo; maybe I should be using the latest snapshot? I saw there were some OpenBSD-related changes made not that long ago but I figured the version available from ports would either work out of the box or give me instructions for making it work.)

#OpenBSD #Zig

@[email protected] maybe something in your configuration is wrong. i just ran 'zig init' then 'zig build =help' on openbsd -current (amd64) as a normal user.

check folder permissions? did you initially run 'zig init' as root?
@brettm I didn’t initialize the first projects that presented this problem, but I assume zig init wasn’t run as root. I honestly don’t remember if I needed root permissions with my later tests—sleep-deprived and shouldn’t be awake right now—but I’ll double-check in a bit.

@brettm set up a new test repo and was able to zig init without root permissions but build still said no:

$ pwd
/home/tanis/repos/test
$ ls
src build.zig build.zig.zon
$ zig build --help
error: sub-compilation of compiler_rt failed
note: failed to check cache: manifest_create AccessDenied
/usr/local/lib/zig/std/std.zig:1:1: error: unable to load 'std.zig': AccessDenied
/usr/local/lib/zig/ubsan_rt.zig:1:1: error: unable to load 'ubsan_rt.zig': AccessDenied
@[email protected] huh that's weird, idk why it works for me and not you

@brettm did you install the zig package or direct from the project website?

This is my fstab for reference:

d1c9e688a9b2ad1f.b none swap sw
d1c9e688a9b2ad1f.a / ffs rw,noatime 1 1
d1c9e688a9b2ad1f.l /home ffs rw,noatime,nodev,nosuid 1 2
d1c9e688a9b2ad1f.d /tmp ffs rw,noatime,nodev,nosuid 1 2
d1c9e688a9b2ad1f.f /usr ffs rw,noatime,nodev 1 2
d1c9e688a9b2ad1f.g /usr/X11R6 ffs rw,noatime,nodev 1 2
d1c9e688a9b2ad1f.h /usr/local ffs rw,noatime,wxallowed,nodev 1 2
d1c9e688a9b2ad1f.k /usr/obj ffs rw,noatime,nodev,nosuid 1 2
d1c9e688a9b2ad1f.j /usr/src ffs rw,noatime,nodev,nosuid 1 2
d1c9e688a9b2ad1f.e /var ffs rw,noatime,nodev,nosuid 1 2

Groups:

tanis wheel network _shutdown _seatd
@[email protected] pkg_add zig

(just to build something written in zig, i can't remember what)

@brettm meanwhile in Rust-land:

$ pwd
/home/tanis/repos/test
$ ls
src Cargo.lock Cargo.toml
$ cargo run
Compiling obsdtest v0.1.0 (/home/tanis/repos/test)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.67s
Running `target/debug/obsdtest
Hello, world!