pkg
pkg copied to clipboard
`pkg -c` is broken: Cannot open /dev/null
Using pkg -c results in:
pkg: Cannot open /dev/null:No such file or directory
/dev/null is not available inside the chroot.
Full logs: https://builds.sr.ht/~sircmpwn/job/70073 (list of all failures: https://builds.sr.ht/~sircmpwn/freebsd)
I believe this is the commit that has introduced the regression: https://github.com/freebsd/pkg/commit/4cbe4573c8f5534e402651828f7140d39a315066
What would be the best way to fix this?
this is not a bug, this is expected, poudriere has been patched to add the proper mounting, any other script should mount devfs before callign pkg -c then unmount it
All right. Is there anything else to mount?
nope, just devfs
@bapt , I disagree and I think that it is, maybe not a bug, but certainly a problem. The same problem also exists with pkg -r. I think that it is easy to open /dev/null in the host environment and then use that file descriptor whenever pkg wants to spawn a child with one of its standard file descriptors redirected to /dev/null. Maybe pkg -c was created specifically for poudriere but there can be other reasonable uses and installing into a chroot does not imply that the chroot must have devfs mounted (unlike a jail).
By the way, Panzura build process uses both pkg -c and pkg -r.
after making some thought we could open /dev/null at the very beginning (before chroot) and then use that each time we need /dev/null. Any patch in that direction would be accepted