Skip to content

Split up Solaris and illumos targets #1716

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

Merged
merged 2 commits into from
Apr 11, 2020

Conversation

pfmooney
Copy link
Contributor

@pfmooney pfmooney commented Apr 3, 2020

While they share a common lineage, Solaris and illumos are distinct (and diverging) platforms which should be handled differently in libc. This PR splits them up and addresses some all of the libc-test failures which appeared on illumos. I have a separate branch for the libc-test updates, but given that ctest does not support illumos today, and the maintainer appears to be absent, those updates only function with that dependency overridden.

This is one of the last remaining pre-req updates required for rust-lang/rust#55553

@rust-highfive
Copy link

r? @JohnTitor

(rust_highfive has picked a reviewer for you, use r? to override)

Copy link
Contributor Author

@pfmooney pfmooney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are some comments to help contextualize some of the changes.

@@ -1361,7 +1312,7 @@ pub const RLIMIT_AS: ::c_int = RLIMIT_VMEM;

#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIM_NLIMITS: rlim_t = 7;
pub const RLIM_INFINITY: rlim_t = 0x7fffffff;
pub const RLIM_INFINITY: rlim_t = 0xfffffffffffffffd;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was previously using the 32-bit value. Given that all of the illumos/Solaris targets are 64-bit today, it made sense to use that value.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn’t it be a good idea to make this definition different for 32 and 64 bit targets ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The existing builds for rust on both Solaris and illumos target only x86_64. If/when someone is inclined to set up a 32-bit build, they'll need to check all of the libc interfaces, this constant included, for conformance.

@@ -1018,7 +969,7 @@ pub const O_CREAT: ::c_int = 256;
pub const O_EXCL: ::c_int = 1024;
pub const O_NOCTTY: ::c_int = 2048;
pub const O_TRUNC: ::c_int = 512;
pub const O_NOFOLLOW: ::c_int = 0x200000;
pub const O_NOFOLLOW: ::c_int = 0x20000;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appears to have been a typo during the initial import.

Comment on lines +1872 to +1874
pub const CSTART: ::tcflag_t = 0o21;
pub const CSTOP: ::tcflag_t = 0o23;
pub const CSWTCH: ::tcflag_t = 0o32;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These were transcription errors, given they were 0-prefixed octal values in the source header

Comment on lines +73 to +94
s_no_extra_traits! {
#[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))]
pub union door_desc_t__d_data {
pub d_desc: door_desc_t__d_data__d_desc,
d_resv: [::c_int; 5], /* Check out /usr/include/sys/door.h */
}

#[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))]
pub struct door_desc_t {
pub d_attributes: door_attr_t,
pub d_data: door_desc_t__d_data,
}

#[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))]
pub struct door_arg_t {
pub data_ptr: *const ::c_char,
pub data_size: ::size_t,
pub desc_ptr: *const door_desc_t,
pub dec_num: ::c_uint,
pub rbuf: *const ::c_char,
pub rsize: ::size_t,
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Being not thrilled with the type naming mess, I've hidden the doors API from the new illumos target for now. We can circle back in the future to address it. At least one error was made when it was imported (dec_num should be desc_num in door_arg_t, for example)

@JohnTitor
Copy link
Member

JohnTitor commented Apr 3, 2020

Thanks for the PR!

I have a separate branch for the libc-test updates, but given that ctest does not support illumos today, and the maintainer appears to be absent, those updates only function with that dependency overridden.

I'd like to fork ctest repo and use that repo until @gnzlbg gets back since I have no permission on the original repo. Would you mind sending PR(s) to the repo?

@pfmooney
Copy link
Contributor Author

pfmooney commented Apr 3, 2020

Thanks for the PR!

I have a separate branch for the libc-test updates, but given that ctest does not support illumos today, and the maintainer appears to be absent, those updates only function with that dependency overridden.

I'd like to fork ctest repo and use that repo until @gnzlbg gets back since I have no permission on the original repo. Would you mind sending PR(s) to the repo?

Yes, of course! Some of these issues were frustrating to find, as they would have been caught by the tests (had they actually been run).

@pfmooney
Copy link
Contributor Author

pfmooney commented Apr 7, 2020

The additional ctest-related commit fixes the test suite for illumos, and presumably improves the situation for Solaris. I have no Solaris(tm) environment to test in. It does require a local ctest dependency with JohnTitor/ctest2#1 merged (or equivalent).

@pfmooney
Copy link
Contributor Author

pfmooney commented Apr 7, 2020

If/when this is merged, what are your thoughts about a patch version bump for the package? Do you have some preferred criteria for what's necessary to meet that threshold?

@JohnTitor
Copy link
Member

If/when this is merged, what are your thoughts about a patch version bump for the package? Do you have some preferred criteria for what's necessary to meet that threshold?

Usually, I release a new version if requested as mentioned in contributing guide. So if you want me to release it once this PR gets merged, I'm happy to do so :)

@pfmooney
Copy link
Contributor Author

pfmooney commented Apr 7, 2020

Usually, I release a new version if requested as mentioned in contributing guide. So if you want me to release it once this PR gets merged, I'm happy to do so :)

Once this is merged, I'll circle back to do another round of testing with the rust-lang/rust#55553 wad and then open a ticket here requesting the version bump.

Thanks!

@pfmooney
Copy link
Contributor Author

With the tests added, are there any other changes you'd like to see made to this before it goes in?

Copy link
Member

@JohnTitor JohnTitor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, sorry for the delay!

@JohnTitor JohnTitor merged commit 9782b7f into rust-lang:master Apr 11, 2020
@pfmooney
Copy link
Contributor Author

Looks good to me, sorry for the delay!

No worries! Thanks.

@pfmooney pfmooney deleted the illumos-target branch July 17, 2020 17:47
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

Successfully merging this pull request may close these issues.

6 participants