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

syscall.EBADFD at FreeBSD #68

Closed
lnlsn opened this issue Feb 2, 2016 · 2 comments
Closed

syscall.EBADFD at FreeBSD #68

lnlsn opened this issue Feb 2, 2016 · 2 comments

Comments

@lnlsn
Copy link
Contributor

lnlsn commented Feb 2, 2016

Hello,
I was trying to use afero as Hugo dependency at FreeBSD:

$ go get github.com/spf13/afero
# github.com/spf13/afero
gocode/src/github.com/spf13/afero/const_win_unix.go:22: undefined: syscall.EBADFD
$ uname -a
FreeBSD nixbsd 10.2-RELEASE-p9 FreeBSD 10.2-RELEASE-p9 #0: Thu Jan 14 01:32:46 UTC 2016     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64
$ go version
go version go1.5.3 freebsd/amd64
$ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="freebsd"
GOOS="freebsd"
GOPATH="/home/nixusr/gocode"
GORACE=""
GOROOT="/home/nixusr/go"
GOTOOLDIR="/home/nixusr/go/pkg/tool/freebsd_amd64"
GO15VENDOREXPERIMENT=""
CC="gcc48"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"
$

Then, is FreeBSD not supported yet?

@mbertschler
Copy link
Collaborator

It's hard for me to test this but I guess it should work like for OS X and OpenBSD.
Could you try to change line 14 in const_bsds.go to // +build darwin openbsd freebsd
and change the contents of const_win_unix.go to

// +build !darwin
// +build !openbsd
// +build !freebsd

and then report if that works?

@lnlsn
Copy link
Contributor Author

lnlsn commented Feb 3, 2016

It works!

$ git diff
diff --git a/const_bsds.go b/const_bsds.go
index 28cd274..9717374 100644
--- a/const_bsds.go
+++ b/const_bsds.go
@@ -11,7 +11,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.

-// +build darwin openbsd
+// +build darwin openbsd freebsd

 package afero

diff --git a/const_win_unix.go b/const_win_unix.go
index 72d6aaf..d8f392b 100644
--- a/const_win_unix.go
+++ b/const_win_unix.go
@@ -12,6 +12,7 @@
 // limitations under the License.
 // +build !darwin
 // +build !openbsd
+// +build !freebsd

 package afero
$ pwd
/home/nixusr/gocode/src/github.com/spf13/afero
$ go build
$ go install
$ go test
PASS
ok      github.com/spf13/afero  4.103s

lnlsn pushed a commit to lnlsn/afero that referenced this issue Feb 3, 2016
Solve this: spf13#68

      go get github.com/spf13/afero
      # github.com/spf13/afero
      gocode/src/github.com/spf13/afero/const_win_unix.go:22: undefined: syscall.EBADFD
@spf13 spf13 closed this as completed Feb 8, 2016
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

No branches or pull requests

3 participants