I have checked out a copy of the ports tree from CVS, and I am trying to
install rust.
I am running OpenBSD 7.5 and not -current.
Try something simple and quick first. math/moo is a good one.
However, I face the following error on running make install
pkg_add: pkg_add must be run as root
Do I then run doas make install? Or is it a bug?
Neither. Setup sudo or doas so that your user can run things as root
and pass environment variables through, and set the SUDO variable in
/etc/mk.conf.
e.g.
for sudo, have an entry like "yourusername ALL = SETENV: ALL"
and set "SUDO=sudo -E"
for doas, have an entry like "permit keepenv persist yourusername"
and set "SUDO=doas"
I find the documentation unclear on this point. The Porter's Handbook,
in the section "Configuration of the Ports System" [1], briefly states:
"... ports can be built as a user, but must be installed by root or with
doas(1)."
However, it does not provide further details on the matter.
[1]: https://www.openbsd.org/faq/ports/ports.html#PortsConfig