-
Notifications
You must be signed in to change notification settings - Fork 667
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
Solaris: fixes build and tests, adds CI #2544
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Sorry for a bunch of comments 🫣
src/sys/termios.rs
Outdated
// Solaris can use libc::_POSIX_VDISABLE once following is pulled in: | ||
// https://github.com/rust-lang/libc/pull/4103 | ||
#[cfg(target_os = "solaris")] | ||
pub const _POSIX_VDISABLE: u8 = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This libc PR has been merged and back-ported into the libc-0.2
branch, though it has not been released, so we can use it from git:
# Cargo.toml
libc = { git = "https://github.com/rust-lang/libc", branch = "libc-0.2", features = ["extra_traits"] }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With git libc
version I'm getting:
error[E0015]: cannot call non-const fn `CMSG_SPACE` in constant functions
--> src/sys/socket/mod.rs:652:14
|
652 | unsafe { libc::CMSG_SPACE(mem::size_of::<T>() as libc::c_uint) as usize }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
No idea from where it comes...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird, looks like it is still a const function:
$ rg "CMSG_SPACE"
mod.rs
2508: pub {const} fn CMSG_SPACE(length: ::c_uint) -> ::c_uint {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please try this in our CI so that I can see the error message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird, I didn't expect it to be broken on all the targets, let me investigate a bit. 😵
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like libc PR rust-lang/libc#4063 broke this, I verified that enabling feature const-extern-fn
will work, but I think it is an issue, so let's wait for the upstream to fix it. 😶
libc = { git = "https://github.com/rust-lang/libc", branch = "libc-0.2", features = ["extra_traits", "const-extern-fn"] }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upstream issue: rust-lang/libc#4115
BTW, looks like |
c713def
to
0aaaff7
Compare
Disables some tests for Solaris. test/test_sendfile.rs: Solaris, sendfilev() doesn't support AF_UNIX sockets. Instead, it expects an AF_INET or AF_INET6 sockets. test/sys/test_timer.rs: Note that sys::test_timer::alarm_fires can fail as timer_create(3C) function requires the PRIV_PROC_CLOCK_HIGHRES. But since tests are supposed to run with sudo it should be ok.
0aaaff7
to
429af01
Compare
Disables some tests for Solaris.
test/test_sendfile.rs:
Solaris, sendfilev() doesn't support AF_UNIX sockets. Instead, it expects an AF_INET or AF_INET6 sockets.