-
Notifications
You must be signed in to change notification settings - Fork 673
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
illumos and Solaris support #1394
Conversation
There are three tests that currently fail on illumos:
However those tests share a mutex with other tests. Their failures cause some additional tests to fail due to a poisoned mutex error:
When the above tests are run individually, they pass. I'm still researching the three actual failures, though the remaining functionality works well enough for stuff using the nix crate to build successfully with this commit on illumos, so it seemed useful even without those resolved. |
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.
In addition to the inline comments, could you also add Illumos to CI ? You can put it in the cross-build section, along with NetBSD and Fuchsia, for OSes that don't have their tests run in CI.
src/dir.rs
Outdated
pub fn file_type(&self) -> Option<Type> { | ||
#[cfg(not(target_os = "illumos"))] |
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.
Do you really need this line, given that file_type
isn't compiled on Illumos?
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.
I don't understand why the whole of file_type()
was made conditional for illumos. In my original patch here it was not, because it seemed like it would then require less changes for consuming code -- we just return None
in all cases and then the consumer knows (as per the documentation) to do their own stat(2)
. @jasonbking ?
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.
Oh my apologies, I missed the whole separate file_type()
below. This must be the result of merging our two porting efforts. Sorry about that!
src/dir.rs
Outdated
@@ -236,5 +240,14 @@ impl Entry { | |||
libc::DT_SOCK => Some(Type::Socket), | |||
/* libc::DT_UNKNOWN | */ _ => None, | |||
} | |||
|
|||
// illumos systems do not have the d_type member at all: | |||
#[cfg(target_os = "illumos")] |
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.
Ditto here. Can you remove this part?
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.
Yeah, this was a merge artifact, I'll fix it up.
@@ -25,6 +25,10 @@ cfg_if! { | |||
unsafe fn errno_location() -> *mut c_int { | |||
libc::__errno_location() | |||
} | |||
} else if #[cfg(any(target_os = "illumos", target_os = "solaris"))] { |
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.
Can this be combined with the clause on line 9?
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.
It's hard to see in the browser, but on illumos and Solaris, it's three underscores, but only two on android/netbsd/openbsd, so I don't believe it can (unless I'm misunderstanding how you wanted to combine them).
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.
You're right; that's awfully hard to see.
src/sys/ioctl/illumos.rs
Outdated
@@ -0,0 +1,92 @@ | |||
/// The datatype used for the ioctl number |
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.
If you combine this code with bsd.rs, how much #[cfg]
stuff would you have to add? The files look pretty similar.
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.
I think the only difference would be for ioctl_num_type (c_int vs c_long). I could do that, though is there a preference here on how (one file w/ a name suggesting both, re-export the shared bits, etc.)?
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.
The file name isn't part of the public API, so it doesn't matter very much. I would probably call it "bsd" just as the path of least resistance.
If you rebase on master that will fix the Android build failures. For Illumos, it looks like you need to choose a more recent toolchain. |
Do you prefer a specific (or rather explicit) version, or is 'stable' good enough? |
270c317
to
f7928f8
Compare
Ok, I think this looks good now. Would you mind squashing your commits? |
8839cf2
to
936b100
Compare
Should be good now. |
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.
bors r+
1394: illumos and Solaris support r=asomers a=jasonbking Adds support for the illumos target as well as improvements in the existing Solaris support. Co-authored-by: Dominik Hassler <[email protected]> Co-authored-by: Joshua M. Clulow <[email protected]> Co-authored-by: Jason King <[email protected]>
Build failed: |
I'm a bit stumped at the build error -- nothing in the PR should have touched (directly or indirectly) the Linux VSOCK support (and checking again, I can't see anything that appears to). Have I possibly overlooked something? |
I also looked at the errno changes and can't see anything that should have impacted Linux. |
You'll have to rebase after #1404 . |
Co-authored-by: Dominik Hassler <[email protected]> Co-authored-by: Joshua M. Clulow <[email protected]>
936b100
to
d444f1b
Compare
Phew :) |
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.
bors r+
Adds support for the illumos target as well as improvements in the existing Solaris support.
Co-authored-by: Dominik Hassler [email protected]
Co-authored-by: Joshua M. Clulow [email protected]