-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[0.2] Backports #4815
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
Draft
tgross35
wants to merge
36
commits into
rust-lang:libc-0.2
Choose a base branch
from
tgross35:backport-mung
base: libc-0.2
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
[0.2] Backports #4815
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5c936c0 to
bf193d5
Compare
This is a cherry pick of 1b08efd ("Increase the recursion limit to fix docs.rs `ctest`") but we don't need the ctest bit, only the docs build. So, in essence: (backport <rust-lang#4371>) (cherry picked from commit 1b08efd)
(backport <rust-lang#4808>) (cherry picked from commit b4cb730)
This was part of e09683e ("run clippy on 3 major platforms"), most of which made it to libc-0.2. However, this line was missed.
The x86-64 NetBSD target is tier 2, so we can start testing it. (backport <rust-lang#4782>) (cherry picked from commit d77b8e7)
This is not always present when we are building as `rustc-dep-of-std`. (backport <rust-lang#4782>) (cherry picked from commit 919d0d4)
This pattern is currently used by the `freebsd-version` check but will be used by more in the future. (backport <rust-lang#4782>) (cherry picked from commit 91f208c)
Some of these may have been removed. `NI_MAXHOST` is already specified in the unix semver file. (backport <rust-lang#4782>) (cherry picked from commit 60d7ccc)
Currently this target fails to build. (backport <rust-lang#4782>) (cherry picked from commit 368df02)
Add headers required for the new constants we have, add skips for things we can't easily fix, and remove skips for things that now work. Additionally, check the NetBSD version via `uname` for configuring skips based on the tested version. (backport <rust-lang#4782>) (cherry picked from commit 5634c88)
These were previously packed, but this was changed in NetBSD10. Link: NetBSD/src@1ca39e8 (backport <rust-lang#4782>) (cherry picked from commit 277c0c5)
Upstream commit: NetBSD/src@091e152 (backport <rust-lang#4782>) (cherry picked from commit 35d5592)
These assorted constants may have existed at some point but I can't find any reference to them in the source repo. Remove them now. (backport <rust-lang#4782>) (cherry picked from commit 17727db)
As noted, this has been deprecated a long time and is no longer present on x86_64. Remove the typedef. (backport <rust-lang#4782>) (cherry picked from commit 11d36ae)
These are currently incorrect, so remove them for now. If desired, they can be added back in the future using the `_IO*` functions. (backport <rust-lang#4782>) (cherry picked from commit 7de84bf)
Upstream commit: NetBSD/src@cc8bab3 (backport <rust-lang#4782>) (cherry picked from commit b038f17)
Link: https://github.com/NetBSD/src/blob/6017cb90fd7d83ed6e45d93129b12d525978c2fa/sys/sys/ucred.h#L52 (backport <rust-lang#4782>) (cherry picked from commit 3bb84eb)
This changed in 10.0. The change is ABI-compatible so we can make it now. This is a minor break, but should allow users to remove some special casing on NetBSD since this brings it in line with other BSDs. Link: https://github.com/NetBSD/src/blob/6017cb90fd7d83ed6e45d93129b12d525978c2fa/sys/sys/event.h#L72 (backport <rust-lang#4782>) (cherry picked from commit 14f2bc5)
Link: https://github.com/NetBSD/src/blob/6ace5fed3bd010695a1b88ca6c1f8a5af7793ffb/sys/sys/ptrace.h#L62 (backport <rust-lang#4782>) (cherry picked from commit 5e47663)
Link: https://github.com/NetBSD/src/blob/908770859a5d5141adc63c7844190d01db8a18a4/include/fnmatch.h#L43-L48 (backport <rust-lang#4782>) (cherry picked from commit cfb674c)
Link: https://github.com/NetBSD/src/blob/6017cb90fd7d83ed6e45d93129b12d525978c2fa/sys/arch/amd64/include/mcontext.h#L59-L65 (backport <rust-lang#4782>) (cherry picked from commit a47db53)
Upstream commit: NetBSD/src@a3d9e0f (backport <rust-lang#4782>) (cherry picked from commit 8ff5e7e)
Our definition was correct for how it is defined internally, but in the header where it is included it is an incomplete definition. Link: https://github.com/NetBSD/src/blob/6017cb90fd7d83ed6e45d93129b12d525978c2fa/sys/sys/sched.h#L99 (backport <rust-lang#4782>) (cherry picked from commit 95e5cdb)
Deprecate the PT_LWPINFO and PL_EVENT* constants, as well as `ptrace_lwpinfo`. Upstream commit: NetBSD/src@4f79a48 (backport <rust-lang#4782>) (cherry picked from commit c4a86e0)
Move statvfs types to the `new` module. Link: https://github.com/NetBSD/src/blob/6ace5fed3bd010695a1b88ca6c1f8a5af7793ffb/sys/sys/statvfs.h#L66-L101 (backport <rust-lang#4782>) (cherry picked from commit c4731a0)
With NetBSD10 the type changes and fields get adjusted. Make the field nonpublic now to prepare for this change in the future. This is a minor breaking change but means that the NetBSD10 updates will not be breaking. Link: https://github.com/NetBSD/src/blob/6017cb90fd7d83ed6e45d93129b12d525978c2fa/sys/sys/statvfs.h#L94 (backport <rust-lang#4782>) (cherry picked from commit d5f4354)
This went through an ABI change with a symbol version in NetBSD10. Our version still works but tests don't pass. Link: NetBSD/src@02cdd24 (backport <rust-lang#4782>) (cherry picked from commit bf0f52c)
The field ordering is incorrect on NetBSD. Move it to the `new` module for NetBSD and OpenBSD and fix the mismatch on NetBSD. Link: https://github.com/NetBSD/src/blob/6ace5fed3bd010695a1b88ca6c1f8a5af7793ffb/sys/sys/ipc.h#L54-L68 Link: https://github.com/openbsd/src/blob/9abc5df53d8ad6b65dbd35b89ed94f73e2fc58da/sys/sys/ipc.h#L53-L61 (backport <rust-lang#4782>) (cherry picked from commit 066e702)
The field order was incorrect. Update this and move it to `new`, along with the rest of `utmp`. As part of this, correct an incorrectly spelled `utpname` to `utmpname`. Fixes: 42289eb "Implement utmp for NetBSD" (backport <rust-lang#4782>) (cherry picked from commit 6a01e2f)
Create a new module for `utmpx` and move definitions there, then correct
`_UTX_PADSIZE`. We can also just use `s!`, there is no need to manually
implement the traits.
NetBSD defines `_UTX_PADSIZE` manually but includes this comment in
their source:
/*
* This should be:
* 40 - (sizeof(struct timeval) - sizeof(struct { long s; long u; })))
* but g++ does not like it, to retain size compatibility with v1.00,
* so we do it manually.
*/
#ifdef _LP64
#define _UTX_PADSIZE 36
#else
#define _UTX_PADSIZE 40
#endif
I tried using the expression here:
40 - (size_of::<crate::timeval>() - size_of::<(c_long, c_long)>());
But this returns a value of 8 which doesn't match the expected 36. So,
keep with their source and hardcode the values.
Link: https://github.com/NetBSD/src/blob/6ace5fed3bd010695a1b88ca6c1f8a5af7793ffb/include/utmpx.h#L91-L101
(backport <rust-lang#4782>)
(cherry picked from commit 4055637)
This is currently defined as an `unsigned int` but should be `int32_t`. Also move some related definitions `new`. Link: https://github.com/NetBSD/src/blob/6ace5fed3bd010695a1b88ca6c1f8a5af7793ffb/sys/sys/types.h#L200 (backport <rust-lang#4782>) (cherry picked from commit 2946483)
Move `timex.h` types to the `new/` module. (backport <rust-lang#4782>) (cherry picked from commit fb74b6f)
Link: https://github.com/NetBSD/src/blob/6ace5fed3bd010695a1b88ca6c1f8a5af7793ffb/sys/sys/time.h#L305-L306 (backport <rust-lang#4782>) (cherry picked from commit 57213d4)
The definition of `struct ifreq` didn't match up. Make a new module for `net/if.h` and fix it there. Note that this drops some trait implementations since the correct API involves unions. (backport <rust-lang#4782>) (cherry picked from commit 8cb1db9)
Relevant source: * `devname`: https://github.com/NetBSD/src/blob/908770859a5d5141adc63c7844190d01db8a18a4/include/stdlib.h#L296 * `getutent`: https://github.com/NetBSD/src/blob/908770859a5d5141adc63c7844190d01db8a18a4/include/utmp.h#L70 * `ntp_gettime`: https://github.com/NetBSD/src/blob/908770859a5d5141adc63c7844190d01db8a18a4/sys/sys/timex.h#L257 * `sched_rr_get_interval`: https://github.com/NetBSD/src/blob/908770859a5d5141adc63c7844190d01db8a18a4/include/sched.h#L50-L51 * `shmctl`: https://github.com/NetBSD/src/blob/908770859a5d5141adc63c7844190d01db8a18a4/sys/sys/shm.h#L2011 * `sig{action,suspend}`: https://github.com/NetBSD/src/blob/908770859a5d5141adc63c7844190d01db8a18a4/include/signal.h#L85-L95 * `{get,set}itimer`: https://github.com/NetBSD/src/blob/908770859a5d5141adc63c7844190d01db8a18a4/sys/sys/time.h#L331-L335 * `timer_{get,set}time`: https://github.com/NetBSD/src/blob/908770859a5d5141adc63c7844190d01db8a18a4/include/time.h#L158-L160 * `utmpx` symbols: https://github.com/NetBSD/src/blob/908770859a5d5141adc63c7844190d01db8a18a4/include/utmpx.h#L135-L150 * `wait4`: https://github.com/NetBSD/src/blob/908770859a5d5141adc63c7844190d01db8a18a4/sys/sys/wait.h#L209 Excluded are `__statvfs90`, `__fstatvfs90`, `__sigaction_siginfo`, `__getmntinfo90`, `__getvfsstat90`which are only present in 10.0+ (the symbol version seems to be N-1). Source: * https://github.com/NetBSD/src/blob/908770859a5d5141adc63c7844190d01db8a18a4/sys/sys/statvfs.h#L160-L168 There is also a deprecated aliases that used to be needed and is removed here. * `__getmntinfo13`: https://github.com/NetBSD/src/blob/62c785e59d064070166dab5d2a4492055effba89/lib/libc/compat/gen/compat___getmntinfo13.c#L49-L50 (backport <rust-lang#4782>) (cherry picked from commit 1816f60)
(backport <rust-lang#4811>) (cherry picked from commit e654f3a)
Add `check=True` to catch nonzero exit codes, and address one other lint for unneeded collection to `list`. Additionally, add some print statements in an attempt to help debug the CI failure on Windows. (backport <rust-lang#4813>) (cherry picked from commit 83bd32f)
bf193d5 to
893d417
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.