Port mgmt to OpenBSD
Versions:
-
mgmt version (eg:
mgmt --version): git master -
operating system/distribution (eg:
uname -a): OpenBSD 6.6 GENERIC.MP#402 amd64 -
golang version (eg:
go version): go version go1.13.3 openbsd/amd64
Description:
I'd like to create a port of mgmt for OpenBSD
The main problem right now is that, as I understand it, mgmt currently requires go1.11.x, once it builds with the go compiler in OpenBSD-current I'll start trying to port it.
@Superpat We have a 1.11 minimum for testing purposes, and in particular because we pull in etcd, but if you want to use an older version I wouldn't be surprised if it would still work. Or did you mean that you wanted to use a newer version?
I meant using a newer version than 1.11. At the time being, the openbsd version of go is 1.13
@Superpat Oh, port away. I'll be moving the default to 1.12 shortly, with the test adding in 1.13 as optional. I've only delayed it because I found a bug that seems to occur with much higher frequency on 1.12 (I plan to patch it ASAP) but it shouldn't block any porting.
HTH
For reference: I've gotten to the point where almost all go deps are installed, I'm facing a few linking problems now, but havent had the time to check them out in depth.
@Superpat Cool-- Feel free to ping here with progress or any questions.
So during compilation:
$ GOTAGS='novirt nodocker' gmake build
Building: mgmt, os/arch: openbsd-amd64, version: 0.0.21-38-ge18adc7-dirty...
real 0m1.462s
user 0m0.780s
sys 0m0.910s
gmake: *** [Makefile:175: build/mgmt-openbsd-amd64] Error 2
I'm facing these two issues:
This I'm not sure yet how to fix yet
# github.com/purpleidea/mgmt/util/socketset
util/socketset/socketset.go:48:31: undefined: unix.AF_NETLINK
util/socketset/socketset.go:54:33: undefined: unix.SockaddrNetlink
util/socketset/socketset.go:107:9: undefined: unix.NLMSG_HDRLEN
util/socketset/socketset.go:116:51: undefined: syscall.NetlinkMessage
util/socketset/socketset.go:122:9: undefined: syscall.ParseNetlinkMessage
I have to get rid / replace this dependency.
# github.com/coreos/go-systemd/internal/dlopen
ld: error: unable to find library -ldl
cc: error: linker command failed with exit code 1 (use -v to see invocation)
For socketset, you'll see here:
https://github.com/purpleidea/mgmt/search?q=util%2Fsocketset&unscoped_q=util%2Fsocketset
It's only used by the net resource (systemd) and cpu count.
You can provide alternates on BSD-- for the svc resource, you can just disable it with an os build tag. If you think there's a good BSD system manager, then please write a resource for that =D
For the cpu count, you can make an alternate that returns an error or a -1 or something. Ideally you'd actually implement this though =D
@Superpat do you have a fork or clone somewhere with your diffs? I'm interested in seeing how close this gets for the Other BSD.
@dhc done !
I have some train hours this week while travelling before fosdem, maybe I can work on this a bit more.
@purpleidea After rebasing and installing new etcd deps, I'm getting the following errors:
`
firefly$ GOTAGS='novirt nodocker' gmake build
Building: mgmt, os/arch: openbsd-amd64, version: 0.0.21-63-g9f4daa2-dirty...
../../../go.etcd.io/etcd/vendor/google.golang.org/grpc/balancer_conn_wrappers.go:28:2: use of internal package google.golang.org/grpc/internal/buffer not allowed
../../../go.etcd.io/etcd/vendor/google.golang.org/grpc/clientconn.go:49:2: use of internal package google.golang.org/grpc/internal/resolver/dns not allowed
../../../go.etcd.io/etcd/vendor/google.golang.org/grpc/clientconn.go:50:2: use of internal package google.golang.org/grpc/internal/resolver/passthrough not allowed
real 0m0.476s user 0m0.410s sys 0m0.300s gmake: *** [Makefile:175: build/mgmt-openbsd-amd64] Error 1 `
I'll spend some more time on this tomorrow morning.
use of internal package google.golang.org/grpc/internal/resolver/passthrough
I don't know why, but make sure you have the submodules checked out at the correct versions:
git submodule init && git submodule update ... You should see a bunch of stuff if you run tree vendor/ in the mgmt root directory.
Or maybe those just don't work on *BSD ?