Comments (22)
Added nodbus
in 0d84a3d
from beeep.
There is also this issue godbus/dbus#315, are you cross-compiling? Can you try on actual FreeBSD?
from beeep.
Also, this one godbus/dbus#237, as stated there, is the only platform that uses CGO, so in order to cross-compile, you will need FreeBSD toolchain on Linux.
from beeep.
Ok, so it looks like there is no bug, after all, godbus/dbus
just happens to use CGO on FreeBSD, so it should work if you compile it on FreeBSD (not cross-compile).
What I can do here to make it easier for you is to add e.g. nodbus
build tag, and a new file that will only use notify-send/kdialog
(they are currently used only as a fallback), so you can build without CGO, but it will require one of those apps to be installed in PATH and it will just call them with exec.Command
. Does that help and do you need it? Not sure when will I find time to do it though.
from beeep.
D-Bus is used to send notifications, i.e org.freedesktop.Notifications
, and it uses CGO only on FreeBSD (maybe some other *BSD, not sure). On Linux, it does not and everything is native.
I don't know the reason for that, but there must be one otherwise devs will avoid CGO usage if possible. Sometimes that is the only possible way (i.e. OpenGL, or on Darwin where syscall is not possible etc.).
from beeep.
The cgo requirement comes from this file here: https://github.com/godbus/dbus/blob/master/transport_unixcred_freebsd.go
It would be great if someone finds a way to replace it with go.
Building with dbus on FreeBSD could be guarded with the "cgo" build tag and use a fallback like notify-send for CGO_ENABLED=0 .
from beeep.
I really don't have time to debug your project. You are probably not passing tag everywhere, for go test
etc.
from beeep.
Of course, I didn't mean to be rude.
from beeep.
Support for BSDs is added here #14, just some build tags. As I can see from your link the problem is godbus/dbus
with *unixTransport does not implement transport (missing SendNullByte method)
, so not sure what can be done in beeep.
from beeep.
@gen2brain That was my point? I can't compile on FreeBSD with your library right now. Can we fix this? I quite like beep :)
from beeep.
But that is not controlled by me, it is another repo, dbus?
from beeep.
There is also this issue godbus/dbus#315, are you cross-compiling? Can you try on actual FreeBSD?
I was cross-compiling yes.
But the user that had a problem was not.
from beeep.
There is also this issue godbus/dbus#315, are you cross-compiling? Can you try on actual FreeBSD?
Why do we depend on dbus here anyway? How is this getting pulled in?
from beeep.
Ok, so it looks like there is no bug, after all,
godbus/dbus
just happens to use CGO on FreeBSD, so it should work if you compile it on FreeBSD (not cross-compile).What I can do here to make it easier for you is to add e.g.
nodbus
build tag, and a new file that will only usenotify-send/kdialog
(they are currently used only as a fallback), so you can build without CGO, but it will require one of those apps to be installed in PATH and it will just call them withexec.Command
. Does that help and do you need it? Not sure when will I find time to do it though.
Oh! So you're using dbus here for something? And that forces CGO to be used? If so, yes please, if we can have a CGO-less option here that would be great 👌
from beeep.
@gen2brain I'm still not sure why we depend on dbus in the first place, but if we do for a good reason, is there a way we can interop with dbus without CGO? Is there a better library we can use here? I mean D-Bus has an API right?
from beeep.
Well, the first line in that file is the reason The UnixCredentials system call is currently only implemented on Linux
. So BSD doesn't have one. It is not possible to find a way and replace it with Go, the BSD kernel must implement that system call.
As I said, I can add nodbus
tag and copy notify_unix.go
to notify_unix_nodbus.go
, remove dbus code, add build tags etc. so it only uses notify-send
or kdialog
if first is not found in path. That can be a workaround.
The other, more complicated solution for you would be to compile FreeBSD toolchain on Linux (maybe there are ready-made Docker or scripts) and compile with something similar to this:
CC=x86_64-pc-freebsd-gcc CGO_ENABLED=1 GOOS=freebsd GOARCH=amd64 go build
from beeep.
D-Bus is used to send notifications, i.e
org.freedesktop.Notifications
, and it uses CGO only on FreeBSD (maybe some other *BSD, not sure). On Linux, it does not and everything is native. I don't know the reason for that, but there must be one otherwise devs will avoid CGO usage if possible. Sometimes that is the only possible way (i.e. OpenGL, or on Darwin where syscall is not possible etc.).
Can we file (you should probably) upstream to the author of that dbus library to fix this? We should get native support there too!
from beeep.
@gen2brain Please do this 👌 Let's not ruin a good "notification" library just because *BSD hasn't implement something Linux has had for a while 😂 cough 🤣
from beeep.
Added
nodbus
in 0d84a3d
Nice one! 👌 Would you mind also tagging a new release when you're done too? 🙇♂️
from beeep.
I'm trying to see if your commit lets me cross-compile (when I do releases) but something is not working for me :/
⨯ release failed after 3.91s error=failed to build for freebsd_arm64: exit status 2: # github.com/godbus/dbus/v5
../../go/pkg/mod/github.com/godbus/dbus/[email protected]/transport_unix.go:52:3: cannot use t (type *unixTransport) as type transport in return argument:
*unixTransport does not implement transport (missing SendNullByte method)
../../go/pkg/mod/github.com/godbus/dbus/[email protected]/transport_unix.go:58:3: cannot use t (type *unixTransport) as type transport in return argument:
*unixTransport does not implement transport (missing SendNullByte method)
(⎈ |local:default)
prologic@Jamess-iMac
Wed Mar 23 23:08:15
~/Projects/saltyim
(master) 1
$ sift nodbus
Makefile:41: -tags "netgo static_build nodbus" \
.goreleaser.yml:12: - -tags=netgo static_build nodbus
What am I doing wrong?
from beeep.
See: https://git.mills.io/prologic/saltyim/pulls/47
from beeep.
I really don't have time to debug your project. You are probably not passing tag everywhere, for
go test
etc.
I wasn't expecting you to, and that came across as a "tad bit rude", I hope you didn't mean for that to happen 🤗 I'll work it out don't worry 😅
from beeep.
Related Issues (20)
- Add support for tray icons HOT 4
- Support for supplying image-data as a blob HOT 3
- Blink icon app notification HOT 4
- Allow for notifications from any user on Linux HOT 6
- Clicking the notification opens AppleScript editor HOT 3
- Go module support? HOT 1
- `title` and `message` not escaped when using AppleScript on macOS HOT 3
- Icon not displayed HOT 3
- Macos icon HOT 2
- Use terminal-notifier or alerter when available HOT 4
- How to use icon on macOS ? HOT 1
- go install support HOT 3
- Alert() `title` and `message` not escaped when using AppleScript on macOS HOT 2
- Windows 11 support? HOT 7
- allow for passing in applicationID
- Support for notification urgency HOT 2
- Support for closing notifications HOT 3
- The terminal is cleared on Windows 11 when sending a notification HOT 4
- Window 7 does not automatically close the system tray icon
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from beeep.