Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

netbsd support in the client #19160

Merged
merged 4 commits into from
Aug 28, 2019
Merged

netbsd support in the client #19160

merged 4 commits into from
Aug 28, 2019

Conversation

heronhaye
Copy link
Contributor

@heronhaye heronhaye commented Aug 27, 2019

@heronhaye heronhaye changed the title Surya/netbsd support netbsd support in the client Aug 27, 2019
@atomicules
Copy link
Contributor

Anything you need from me on this?

dressupgeekout and others added 4 commits August 28, 2019 10:10
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:

- #16949
- 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 merged commit 625084c into master Aug 28, 2019
@heronhaye heronhaye deleted the surya/netbsd-support branch August 28, 2019 16:04
@heronhaye
Copy link
Contributor Author

Could you check out building on netbsd now? Anything else we can do?

I have a ticket to add cross compilation to CI as well.

@atomicules
Copy link
Contributor

Tested master and it builds and works fine (so for me this was upgrading from 4.4.0 to 4.5.0):

~/Code/Go/...go/keybase * master$ go111 install -tags production
~/Code/Go/...go/keybase * master$ keybase version
Client:  4.5.0
Service: 4.4.0
~/Code/Go/...go/keybase * master$ keybase chat ls
▶ WARNING Restarting after upgrade; service is running v4.4.0, while v4.5.0 is available
▶ INFO Restarting service...
▶ INFO Starting background server with pid=25672
[1]   [REDACTED]
[2]   [REDACTED]
[3]   [REDACTED]
[4]   [REDACTED]

@atomicules
Copy link
Contributor

Anything else we can do?

I can't think of anything. I'm not personally concerned with a GUI on BSDs. As long as I can keep the command line client working I'm happy, thank you.

@atomicules
Copy link
Contributor

Fwiw I also cross compiled that latest master build to NetBSD arm and tried that on an NetBSD arm box and it worked there to; I didn't build on the arm box due in part to laziness - would need to also build golang there.

I did see one odd thing where it died, but it ran ok when I tried again:

ip-172-31-20-142$ ./keybase version
Client:  4.5.0
Service: 4.4.0
ip-172-31-20-142$ ./keybase chat ls
▶ WARNING Restarting after upgrade; service is running v4.4.0, while v4.5.0 is available
▶ WARNING Error in Stopping 2642 via RPC: EOF; trying fallback (kill via pidfile)
▶ WARNING Kill via pidfile failed: os: process already finished

▶ ERROR os: process already finished
ip-172-31-20-142$ ./keybase chat ls
▶ INFO Starting background server with pid=13602
[1]  [REDACTED]
[2]  [REDACTED]
[3]  [REDACTED]
[4]  [REDACTED]

You can see how lazy I was being as I couldn't even be bothered to put the executable in my PATH.

@heronhaye
Copy link
Contributor Author

Hmm, weird. May be due to the upgrade, if it happens again let us know. Glad you got it working!

@heronhaye
Copy link
Contributor Author

Oh, what about KBFS? Does fuse work on bsd? (although it is useful even without fuse via the git remote helper and keybase fs commands)

@atomicules
Copy link
Contributor

Hmm... I have not looked at KBFS at all yet. I will take a look and report back. At the moment:

$ keybase fs ps
▶ ERROR Keybase services aren't running - KBFS client not found.

@heronhaye
Copy link
Contributor Author

heronhaye commented Aug 29, 2019

It is a different daemon, you have to build go/kbfs/kbfsfuse and run that in the background. I tried crosscompiling but it seems there are some differences in syscall methods that'd have to be special cased, but nothing unsurmountable.

There are some docs here: https://keybase.io/docs/kbfs, https://keybase.io/docs/kbfs/understanding_kbfs.

On that note: does netbsd have something like systemd/shepherd that handles daemon services?

@atomicules
Copy link
Contributor

@heronhaye Just to follow-up on the kbfs stuff. Someone started on a branch for openbsd for bazil/fuse. OpenBSD and NetBSD are often pretty close so I will dig through that and see if it's possible to finish off and get working, but won't be a quick thing.

@heronhaye
Copy link
Contributor Author

@atomicules Ah, thanks for looking into it. Let me know if you need any help getting that working on Keybase's side.

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