Keybase client cli on Netbsd (using procfs on NetBSD)#19061
Keybase client cli on Netbsd (using procfs on NetBSD)#19061atomicules wants to merge 3 commits intokeybase:masterfrom
Conversation
I literally copypasted the openbsd go-ps file to netbsd, REALLY requires a closer look. But AFAICT that's the only truly nonportable code.
Building broke on BSDs due to these: - keybase#16949 - keybase@38900b9 AFAICT all that is needed are the following changes to get things building again. Tested on NetBSD, but guessing the same will apply to OpenBSD and FreeBSD hence why also all those build headers. Renamed stop_linux.go to stop_nix.go to reflect applicability. _Probably_ this works fine. On NetBSD I am only concerned with the command line so don't care about stopping the GUI. One thing to note with regards to running on NetBSD - using Linux Emulation so you have the procfs mounted helps a lot. In fact I don't think the process_netbsd.go file in go-ps is required at all then. NetBSD can just use the Linux one (after adding itself to the build header)
|
Thanks for the PR. Since the go-ps change is in another repo, can you make a PR on https://github.com/keybase/go-ps with the relevant changes? After that is merged I can vendor it in. It would probably be a good idea to add building this to CI so we don't break it in the future. cc @jzila, shouldn't be too bad because of go's cross compilation support? One last thing, I'll also need make a new PR and cherrypick these commits for CI to run. |
|
Thanks for the reminder about the PR for go-ps. I had pushed that but just forgot to PR. It's here: keybase/go-ps#10 |
|
We can add x-compilation to CI. Go ahead and make a ticket. |
|
See comment here: keybase/go-ps#10 (comment) |
|
Great. I'm forking this now so CI can run and vendoring in the go-ps changes. |
|
Continued on #19160 |
These are really relatively minor changes (just adding
netbsdbuild headers to files) that get me a working Keybase cli client on NetBSD. As such I see little harm in merging them in.I'm relying on NetBSD's linux emulation and the fact that that gives me a profs (
/proc). With this the cli seems to work perfectly - i.e. it launches the server to the background. I can read and send chats. It's great 😄This was inspired by dressupgeekout's post which I had initially followed. But then I wanted to build a more recent version and so ended up with these changes.
go-ps/process_netbsd.gofile from dressupgeekout's approach and instead use thego-ps/process_unix.gofor netbsd since I can take advantage of procfs on NetBSD.Ultimately I would like to get a proper
go-ps/process_netbsd.goapproach working on NetBSD, but at the moment although it builds fine I can't get the tests to pass so that's why I've just gone for the procfs approach with this PR.The only downsides I see with this PR is that some NetBSD users might be able to have this build and then not work because they don't have a procfs.