-
Notifications
You must be signed in to change notification settings - Fork 55
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
Proposal: allow compilation on systems without UNIX sockets #43
Comments
The syslog crate doesn't build on Windows: Geal/rust-syslog#43 At the same time it's not possible to selectively disable the "syslog" feature: rust-lang/cargo#1197 This workaround makes sure that building on Windows works even if the syslog feature has been enabled.
The syslog crate doesn't build on Windows: Geal/rust-syslog#43 At the same time it's not possible to selectively disable the "syslog" feature: rust-lang/cargo#1197 This workaround makes sure that building on Windows works even if the syslog feature has been enabled.
This would be a very valuable feature in mixed environments like ours with both Linux and Windows hosts, and which have a central syslog server. I was hoping to ship logs directly from my Rust program, but compilation of course fails on Windows. For now it's back to local log files, sadly. |
Hey @Kromey, as I said in the issue, I made a (proposed) patch to my branch to solve this. If you need the feature and you'd like to try it, just add the following to your
|
I fully intend to try your patch @Robertof, but yesterday I needed the project out the door before requirements shifted under me again, and honestly didn't think to check the issues (or file one myself) until I'd already ditched syslog and returned to my local files. Unfortunately I need to shift gears and get another issue on an unrelated project taken care of, but I'll be back in a few days or so to try your fix. |
Right now the module includes
std::os::unix::net
to support UNIX sockets, however this core module is not built at all on non-UNIX platforms (e.g. Windows). The module should still be able to function though, with the TCP and UDP backends.One idea to add
#[cfg(unix)]
beforestd::os::unix::net
, add a new error kind "UnsupportedPlatform" and return that error when functions such asunix
are called from within unsupported platforms.I have implemented something like that here: Robertof@bffd3a3
If this looks good to you, I can make a PR.
Thanks,
Roberto
The text was updated successfully, but these errors were encountered: