guelfey / go.dbus

Native Go bindings for D-Bus
BSD 2-Clause "Simplified" License
124 stars 42 forks source link

transport_unix does not compile on mac #31

Closed awalterschulze closed 10 years ago

awalterschulze commented 10 years ago

It only compiles on linux, since

syscall.UnixCredentials

is in an _linux.go file in the standard go library.

http://golang.org/src/pkg/syscall/sockcmsg_linux.go?s=367:408#L4

guelfey commented 10 years ago

There's already an open pull request for this (#30).

awalterschulze commented 10 years ago

Thank you I am now watching it :)

jessevdk commented 10 years ago

Actually, that pull request was a mixup between two things. I'll shortly post a PR for this issue as well.

jessevdk commented 10 years ago

Resubmitted a PR in #33

awalterschulze commented 10 years ago

go build . works go test -c works go test -v

=== RUN TestSessionBus-8 --- FAIL: TestSessionBus-8 (0.00 seconds) panic: runtime error: slice bounds out of range [recovered] panic: runtime error: slice bounds out of range

goroutine 3 [running]: runtime.panic(0x1b3f80, 0x3e948a) $GOROOT/src/pkg/runtime/panic.c:266 +0xb6 testing.func·005() $GOROOT/src/pkg/testing/testing.go:383 +0xe8 runtime.panic(0x1b3f80, 0x3e948a) $GOROOT/src/pkg/runtime/panic.c:248 +0x106 github.com/go%2edbus.SessionBusPlatform(0x2105d0, 0x18, 0x1e5380) $GOPATH/src/github.com/go.dbus/conn_darwin.go:15 +0x1c5 github.com/go%2edbus.SessionBusPrivate(0x3f52e0, 0x0, 0x0) $GOPATH/src/github.com/go.dbus/conn.go:99 +0x93 github.com/go%2edbus.SessionBus(0x0, 0x0, 0x0) $GOPATH/src/github.com/go.dbus/conn.go:76 +0xd2 github.com/go%2edbus.TestSessionBus(0xc21005c090) $GOPATH/src/github.com/go.dbus/conn_test.go:6 +0x1e testing.tRunner(0xc21005c090, 0x3e8620) $GOROOT/src/pkg/testing/testing.go:389 +0x8b created by testing.RunTests $GOROOT/src/pkg/testing/testing.go:469 +0x8b2

goroutine 1 [chan receive]: testing.RunTests(0x246958, 0x3e8620, 0xf, 0xf, 0x1) $GOROOT/src/pkg/testing/testing.go:470 +0x8d5 testing.Main(0x246958, 0x3e8620, 0xf, 0xf, 0x3e7fc0, ...) $GOROOT/src/pkg/testing/testing.go:401 +0x84 main.main() github.com/go.dbus/_test/_testmain.go:99 +0x9c exit status 2 FAIL github.com/go.dbus 0.032s

This is after Merged #33

guelfey commented 10 years ago

I don't actually have a darwin machine, but this panic can only happen if launchctl doesn't have any output, which seems like an error to me.

jessevdk commented 10 years ago

I suppose you don't have a session bus running then? What does launchctl getenv DBUS_LAUNCHD_SESSION_BUS_SOCKET say?

awalterschulze commented 10 years ago

It does not returned anything. I guess a better error is the right thing to do.

Sorry I don't actually know anything about dbus. I am just trying to get our project to compile on a mac.

Thank you for the fix.