Skip to content

Conversation

@atomicules
Copy link
Contributor

These are really relatively minor changes (just adding netbsd build 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.

  • Used dressupgeekout's commit as a basis
  • Added "bsd" (openbsd, freebsd and netbsd) headers to a couple of files after bsd building was inadvertently broken in:
  • Removed the go-ps/process_netbsd.go file from dressupgeekout's approach and instead use the go-ps/process_unix.go for netbsd since I can take advantage of procfs on NetBSD.

Ultimately I would like to get a proper go-ps/process_netbsd.go approach 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.

Charlotte Koch and others added 3 commits August 14, 2019 16:24
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)
@heronhaye heronhaye self-requested a review August 23, 2019 01:47
@heronhaye
Copy link
Contributor

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.

@atomicules
Copy link
Contributor Author

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

@jzila
Copy link
Contributor

jzila commented Aug 24, 2019

We can add x-compilation to CI. Go ahead and make a ticket.

@atomicules
Copy link
Contributor Author

See comment here: keybase/go-ps#10 (comment)

@heronhaye
Copy link
Contributor

Great. I'm forking this now so CI can run and vendoring in the go-ps changes.

@heronhaye heronhaye closed this Aug 27, 2019
@heronhaye
Copy link
Contributor

Continued on #19160

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants