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

Proposal: allow compilation on systems without UNIX sockets #43

Closed
Robertof opened this issue Oct 6, 2018 · 4 comments
Closed

Proposal: allow compilation on systems without UNIX sockets #43

Robertof opened this issue Oct 6, 2018 · 4 comments

Comments

@Robertof
Copy link
Contributor

Robertof commented Oct 6, 2018

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)] before std::os::unix::net, add a new error kind "UnsupportedPlatform" and return that error when functions such as unix 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

17dec pushed a commit to 17dec/fern that referenced this issue Mar 4, 2019
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.
daboross pushed a commit to daboross/fern that referenced this issue Mar 14, 2019
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.
@Kromey
Copy link

Kromey commented Apr 3, 2019

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.

@Robertof
Copy link
Contributor Author

Robertof commented Apr 4, 2019

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 Cargo.toml:

[patch.crates-io]
syslog = { git = "https://github.com/Robertof/rust-syslog" }

@Kromey
Copy link

Kromey commented Apr 4, 2019

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.

@Geal
Copy link
Owner

Geal commented Nov 1, 2019

@Robertof the patch looks fine, I imported it as 8e4c611. Sorry for the delay

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