-
Notifications
You must be signed in to change notification settings - Fork 85
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
BSD support #18
Comments
Likely, but it would mean setting up and testing against a system that I have never used. Does rclone currently support OpenBSD (outside the mount command)? |
It does yes. However I don't test against OpenBSD, and I think building a native binary will be difficult. Unfortunately it seems like xgo doesn't support OpenBSD though which would make creating automated builds very difficult. |
It might be nice to build BSD support, but I agree that without xgo builds would be difficult. We would probably have to also update xgo to support BSD. I might look into all this in the future, especially if you get more than one person asking for it. I am rather short on time right now though. |
I'm interested in NetBSD port. |
@krytarowski does NetBSD support FUSE? Can you point me to good documentation? Would you have the time to contribute any changes? A search finds this: https://www.netbsd.org/docs/puffs/ |
NetBSD supports 3 implementations for fuse: They vary in the scope of implementation. I recall that one of them is using just high-level interfaces, the other one attempted to support both, and the third one aimed to reuse upstream libfuse library with local patches. |
I would get one that is completed, fully-featured and fully-compatible with the world. I hope that one of them can work with cgofuse. |
Reading a bit through the NetBSD docs it seems that librefuse is the way to go. One problem is that it only support the FUSE high-level API and I did have ideas of one day adding FUSE low-level support to cgofuse (once I get it in WinFsp that is). So we have so far: Also very importantly we would have to get xgo support for these platforms in order to easily cross-compile and that is a major undertaking. I will shoot a message to the xgo project and see what they are thinking. |
https://wiki.freebsd.org/WhatsNew/FreeBSD10 notes libfuse work.. but there is an option for wait for requests. |
FreeBSD information is somewhat contradicting. It does appear that there is good FUSE support in FreeBSD 10 and 11, but good documentation on how to load and use it is lacking. See, for example: |
I've never installed FreeBSD, no insight from me. |
My first attempt at porting cgofuse to FreeBSD is in commit 0acc17d (currently in the freebsd branch). Most things seem to work:
A notable exception is that signal handling seems to not be working properly. It is unclear currently why this is the case. |
Attempting to troubleshoot the signal handling problem in FreeBSD, I am finding that the go runtime does not appear to set signal handlers for I added the following code in struct sigaction sa;
memset(&sa, 0, sizeof sa);
sigaction(SIGTERM, 0, &sa);
fprintf(stderr, "sa.handler=%p\n", sa.sa_handler); This prints on Darwin:
And on FreeBSD we get
I believe the FreeBSD response to be incorrect. Shouldn't the Go runtime set its own signal handlers, especially when using |
Additional information: I traced the system calls during memfs startup using
My analysis: <1>: the Go runtime tests and sets a <2>: The modified <3>: Libfuse executes I cannot explain why after EDIT: for completeness I checked both
|
I have merged into master, although I cannot cut a release as signal handling remains broken in FreeBSD. |
Good progress.. it's worth to discuss it with upstream go developers. |
I believe I have found the reason for the "mysterious" The following simple cgo program: package main
/*
#include <stdio.h>
#include <signal.h>
static void sigprint(int sig) {
struct sigaction sa;
int ret = sigaction(sig, 0, &sa);
fprintf(stderr, "ret=%d handler=%p\n", ret, sa.sa_handler);
}
*/
import "C"
import "syscall"
func main() {
C.sigprint(C.int(syscall.SIGTERM))
} Succeeds (prints non-0) on Darwin and Linux: $ go run sigbug.go
ret=0 handler=0x4034150 But fails (prints 0) on FreeBSD: $ go run sigbug.go
ret=0 handler=0x0 The reason that this happens is that the Go runtime invokes A likely fix for this is to do what Linux does for |
Turns out this is fixed on the current go repo tip. So the FreeBSD port should work without problems once Go 1.11 is out. |
NetBSD wants to obsolete syscall(2) as this isn't that much portable across CPUs. Ideally we would call C symbols in C. |
I ended up adding support for OpenBSD in commit c3f5fa1. NetBSD support will have to wait for the next rainy Saturday :) This support is experimental. It has known issues that stem from the differences in the OpenBSD libfuse implementation from the reference libfuse implementation. An additional caveat is that in OpenBSD only root can mount and unmount FUSE file systems. There used to be a Finally note that because of the lack of a CI solution for BSD, it will be hard for me to maintain all these ports. I expect that bitrot will eventually set in for the BSD ports. |
I am on vacation and slightly jetlagged so I am working on NetBSD support. Will see where I get :) In other news I have created Poor Man's CI for testing the BSD ports. It runs on the Google Cloud and currently supports FreeBSD. Will try to add NetBSD and OpenBSD support for it. |
good progress! |
@krytarowski good to hear from you. BTW, how do I get Go 1.10 for NetBSD? Do I have to build it myself? (Even if that is the case I still need a bootstrap Go for NetBSD from somewhere.) |
The typical way is to get pkgsrc. lang/go is 1.10.3 http://pkgsrc.se/lang/go pkgsrc.org has some instructions. Please note that there might be need to install mozilla-rootcerts for https. |
Hmmm... I was misled by the list linked below, which does not appear to list a Go(?): http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/devel/README.html I just tried the following and it worked.
|
I indeed needed |
go is in lang, not devel. |
Makes sense. Just learning my way around NetBSD, hence the n00b mistake. BTW, I got this to the point of passing most basic smoke tests, but have to troubleshoot a |
NetBSD support was added in commit 3bc5ead. |
This looks great! Thank you. |
@krytarowski I am attempting to add NetBSD support to Poor Man's CI so that I can regularly test the NetBSD port using the Google Compute Engine. I am currently using NetBSD 8.0_RC2, but I am not clear on how I should setup my
Any pointers on what |
Please try: 8.99.1 is NetBSD-current and 8.0 was branched a year ago. |
Thank you. This works without warnings. |
Thank you for the port! I wonder whether perfuse would work better in NetBSD... we tend to have too many features for the same thing. 3 fuse implementations. |
There are indeed 3 choices in NetBSD.
I think that despite some incompatibilities |
I see. Thank you for making it clear. From a NetBSD developer point of view perhaps it looks like it would be the best to sync the kernel capabilities with Linux and get feature parity in libpuffs.. and keep an option for RUMP/PUFFS users with librefuse and export there low-level parts. The libperfuse option can be kept around as an intermediate form to get the job done on NetBSD. Your work is highly appreciated and thank you for the NetBSD port! |
@krytarowski you are welcome :) |
@krytarowski sorry to bother you again. I am facing a NetBSD failure while doing Continuous Integration using Poor Man's CI. I note that cgofuse compiles and runs fine under NetBSD 7.1.2 (on my local VM) but fails when run under NetBSD 8.0_RC2 in the Google Cloud. Here is the build log:
Do you have any idea what the missing |
If this is a C code, please check |
Thanks for the hint. Adding (As a user of NetBSD I would argue that this should be considered a problem. The need for In any case I hit an even more serious problem when trying to run some of the cgofuse smoke tests. It does not look that Go 1.10 is ready for use on NetBSD 8.0_RC2 yet :( It looks like I will have to shelve doing CI for NetBSD, until 8.0 and its associated tooling has matured a bit more. @krytarowski thank you for your help on this.
|
We were fixing Go in their HEAD branch.. is it possible to check Go from the HEAD? |
I propose to file the _KERNTYPES issue to gnats. If Go is still broken in their HEAD or 1.11, please file a bug for it too. |
Yes. I will look into it. |
Ok. I compiled my own Go from golang/go tip. Unfortunately not all tests passed, but I will try to use it for building cgofuse on NetBSD 8.0_RC2 nevertheless. |
@krytarowski unfortunately the problem persists with latest go :(
|
I see, thank you for the test. Please report it on gnats! |
mount is not supported by rclone for openBSD, see: winfsp/cgofuse#18
mount is not supported by rclone for openBSD, see: winfsp/cgofuse#18
mount is not supported by rclone for openBSD, see: winfsp/cgofuse#18
mount is not supported by rclone for openBSD, see: winfsp/cgofuse#18
mount is not supported by rclone for NetBSD, see: winfsp/cgofuse#18
An rclone user requested that rclone mount support openbsd.
OpenBSD apparently supports fuse and libfuse now so maybe cgofuse could too?
The text was updated successfully, but these errors were encountered: