-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Upgrade to musl 1.1.24 in CI #1588
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
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @gnzlbg (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
There's another change that field |
☔ The latest upstream changes (presumably #1564) made this pull request unmergeable. Please resolve the merge conflicts. |
aea6412
to
b14e947
Compare
ping? @gnzlbg |
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 looks really good @oxalica !
cc @alexcrichton @pietroalbini @mati865 : bumping the musl version for the API exposed by libc looks in general fine to me, but since apparently musl version 1.1 is slightly ABI incompatible with musl 1.0.x we might want to apply the same change to rust-lang/rust to keep everything in sync. As long as musl is statically linked, it should be fine. But some distros like Alpine, dynamically link musl, and dynamically linking an slightly ABI incompatible version might be troublesome. This PR does not apply these ABI incompatible changes to libc, but if we make the upgrade it becomes easy for new APIs that get added to follow the musl 1.1 ABI instead of the 1.0 ABI because that's what we test here against. I'm not a musl expert, so feel free to cc others here as well.
"sched_ss_init_budget", | ||
"sched_ss_max_repl", | ||
].contains(&field) && musl) || | ||
// FIXME: After musl 1.1.24, the type becomes `int` instead of `unsigned short`. |
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 means that musl 1.1 has ABI breaking changes with respect to musl 1.0.x ?
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.
Yes
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.
@gnzlbg Oh, sorry. It may not be an ABI breaking change. The struct layout is kept and just some fields are renamed to reserved.
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.
Does that refer to the change in type of ipc_perm.__seq
field from unsigned short
to int
on aarch64 ? Do you have a musl diff for this change?
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.
IIUC it was unsupported bminor/musl@827aa8f
But still it's breaking change between 1.1.23 and 1.1.24
Edit: replied to wrong comment
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.
Relevant commit for this change bminor/musl@319b2d0
field == "ssi_arch")) | ||
field == "ssi_arch")) || | ||
// FIXME: After musl 1.1.24, it have only one field `sched_priority`, | ||
// while other fields become reserved. |
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 you elaborate here in a comment on what this means? Did the fields of this struct change? Some fields became "private" ?
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 placed the diff of musl in the initial comment
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, there are functions for mapping Rust field names to C field names in ctest, e.g., https://docs.rs/ctest/0.2.22/ctest/struct.TestGenerator.html#method.field_name . So maybe we can just translate the Rust names to the new __reservedX names for 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.
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.
Yes, you are right.
The struct ipc_perm {
key_t __ipc_perm_key;
uid_t uid;
gid_t gid;
uid_t cuid;
gid_t cgid;
mode_t mode;
unsigned short __ipc_perm_seq;
unsigned long __pad1;
unsigned long __pad2;
};
#define IPC_64 0 But the file is removed in musl 1.1.24. It seems to fallback to struct ipc_perm {
key_t __ipc_perm_key;
uid_t uid;
gid_t gid;
uid_t cuid;
gid_t cgid;
mode_t mode;
int __ipc_perm_seq;
long __pad1;
long __pad2;
}; Note that only the field |
This seems fine to me to land, and it should also be fine to land an update in rust-lang/rust |
@bors: r+ |
📌 Commit b14e947 has been approved by |
Upgrade to musl 1.1.24 in CI Required by #1577 Note that in musl 1.1.24, `struct sched_param` from `sched.h` has changed and some fields became reserved. So [these fields](https://github.com/rust-lang/libc/blob/13d4a5da2eafd82d3ebb2acb729d8b8c9148fb1f/src/unix/linux_like/mod.rs#L97) are outdated. I'm not sure if we should rename them, since they are in public API. I simply skip `struct sched_param` from the test now. Here's the diff between musl 1.1.23 and 1.1.24 ``` diff --git a/include/sched.h b/include/sched.h index 05d40b1e..7e470d3a 100644 --- a/include/sched.h +++ b/include/sched.h @@ -18,10 +18,12 @@ extern "C" { struct sched_param { int sched_priority; - int sched_ss_low_priority; - struct timespec sched_ss_repl_period; - struct timespec sched_ss_init_budget; - int sched_ss_max_repl; + int __reserved1; + struct { + time_t __reserved1; + long __reserved2; + } __reserved2[2]; + int __reserved3; }; ```
Do we need to update the public API? |
💔 Test failed - status-azure |
@bors: retry |
Upgrade to musl 1.1.24 in CI Required by #1577 Note that in musl 1.1.24, `struct sched_param` from `sched.h` has changed and some fields became reserved. So [these fields](https://github.com/rust-lang/libc/blob/13d4a5da2eafd82d3ebb2acb729d8b8c9148fb1f/src/unix/linux_like/mod.rs#L97) are outdated. I'm not sure if we should rename them, since they are in public API. I simply skip `struct sched_param` from the test now. Here's the diff between musl 1.1.23 and 1.1.24 ``` diff --git a/include/sched.h b/include/sched.h index 05d40b1e..7e470d3a 100644 --- a/include/sched.h +++ b/include/sched.h @@ -18,10 +18,12 @@ extern "C" { struct sched_param { int sched_priority; - int sched_ss_low_priority; - struct timespec sched_ss_repl_period; - struct timespec sched_ss_init_budget; - int sched_ss_max_repl; + int __reserved1; + struct { + time_t __reserved1; + long __reserved2; + } __reserved2[2]; + int __reserved3; }; ```
☀️ Test successful - checks-cirrus-freebsd-10, checks-cirrus-freebsd-11, checks-cirrus-freebsd-12, status-azure |
Required by #1577
Note that in musl 1.1.24,
struct sched_param
fromsched.h
has changed and some fields became reserved. So these fields are outdated. I'm not sure if we should rename them, since they are in public API.I simply skip
struct sched_param
from the test now.Here's the diff between musl 1.1.23 and 1.1.24