Dragonfly fixes#5116
Conversation
|
Some changes occurred in a NetBSD-like module cc @semarie |
|
Could you extract ctest changes as another PR? It's independent with dragonflyBSD changes. |
|
@rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
Fix DragonFly type aliases and struct layouts to match current headers, including regex offsets, ifaddrs, pthread barriers, process sizing fields, and mcontext alignment.
ef2e8b4 to
84ff852
Compare
|
@rustbot ready |
| // Kernel-only symbols in DragonFly headers. | ||
| "DTYPE_VNODE" | "DTYPE_SOCKET" | "DTYPE_PIPE" | "DTYPE_FIFO" | "DTYPE_KQUEUE" | ||
| | "DTYPE_CRYPTO" | "DTYPE_MQUEUE" | "DTYPE_DMABUF" => true, | ||
|
|
||
| // Not exposed by current DragonFly userland headers. | ||
| "REG_DUMP" | ||
| | "REG_ASSERT" | ||
| | "REG_ATOI" | ||
| | "REG_ITOA" | ||
| | "REG_TRACE" | ||
| | "REG_LARGE" | ||
| | "IP_ADD_SOURCE_MEMBERSHIP" | ||
| | "IP_DROP_SOURCE_MEMBERSHIP" | ||
| | "IP_BLOCK_SOURCE" | ||
| | "IP_UNBLOCK_SOURCE" | ||
| | "MAP_RENAME" | ||
| | "MAP_NORESERVE" | ||
| | "CTL_UNSPEC" | ||
| | "KERN_PROF" | ||
| | "CTL_P1003_1B_UNUSED1" | ||
| | "CTL_P1003_1B_SEM_VALUE_MAX" | ||
| | "DOWNTIME" | ||
| | "SF_CACHE" => true, | ||
|
|
||
| // libc exposes the 6.0-compatible value for this version-dependent mask. | ||
| "KERN_PROC_FLAGMASK" => true, | ||
|
|
||
| // Renamed in current DragonFly headers. | ||
| "CPUCTL_RSMSR" | "UTX_DB_LASTLOG" => true, |
There was a problem hiding this comment.
Since dragonfly is tier 3, you can make the relevant updates in the library (change or delete as needed) rather than adding test skips.
| cfg.skip_roundtrip(move |ty| { | ||
| matches!( | ||
| ty, | ||
| "kvm_t" | ||
| | "posix_spawnattr_t" | ||
| | "posix_spawn_file_actions_t" | ||
| | "umtx_t" | ||
| | "pmap" | ||
| | "ip_mreq_source" | ||
| ) | ||
| }); |
There was a problem hiding this comment.
Could you add a note for why these are skipped?
The match ty { ... } syntax is preferable over matches! since it's easier to add things like version-specific cases if needed.
| if dragonfly_version < 600_000 => | ||
| { | ||
| true | ||
| } |
There was a problem hiding this comment.
Is 5.x still in active enough use that this is worth worrying about? Per https://www.dragonflybsd.org/releases/ 5.8 is from 2020 and 6.0 was in 2021.
|
It looks like Dragonfly doesn't have a target maintainer, do you have any interest in being added as one? It's pretty much no commitment, just means that people can ping you in the rare occasion that we stumble across Dragonfly-specific questions. If so, all you need to do is PR rust-lang/rust adding a dragonfly page in https://github.com/rust-lang/rust/tree/f7da3c0d4b3a4cc291f8c800cc61549d27d14c49/src/doc/rustc/src/platform-support based on the template, and link it from the table at https://github.com/rust-lang/rust/blob/f7da3c0d4b3a4cc291f8c800cc61549d27d14c49/src/doc/rustc/src/platform-support.md. We're trying to make sure every platform has 1-2 documented maintainers so this would be an awesome help if you are interested! |
|
For the above, |
Description
Improve DragonFly BSD support by fixing existing ABI definitions, fix typo'd constant names, fix constant values, moving BSD constants that are not actually generic down into target modules, and adding missing DragonFly constants and libc declarations.
This also expands
libc-testcoverage for DragonFly and makes the tests handle older DragonFly headers with test-only version skips. The public libc API remains version-independent for DragonFly.Sources
Primary API references are DragonFly BSD 6.4 release headers, using tag
v6.4.0(commitaf5fb9a9e56f90cf51e48514d1874be61e9364e6). The same definitions and test behavior were cross-checked against DragonFly 6.2, 6.0, and 5.8 where older headers differ or omit newer symbols.ABI/type definitions:
segsz_t: https://github.com/DragonFlyBSD/DragonFlyBSD/blob/af5fb9a9e56f90cf51e48514d1874be61e9364e6/sys/sys/types.hif_msghdrand interface flags: https://github.com/DragonFlyBSD/DragonFlyBSD/blob/af5fb9a9e56f90cf51e48514d1874be61e9364e6/sys/net/if.hifaddrs.ifa_addrflags: https://github.com/DragonFlyBSD/DragonFlyBSD/blob/af5fb9a9e56f90cf51e48514d1874be61e9364e6/include/ifaddrs.hkinfo_cputime: https://github.com/DragonFlyBSD/DragonFlyBSD/blob/af5fb9a9e56f90cf51e48514d1874be61e9364e6/sys/sys/kinfo.hmcontext_t: https://github.com/DragonFlyBSD/DragonFlyBSD/blob/af5fb9a9e56f90cf51e48514d1874be61e9364e6/sys/cpu/x86_64/include/ucontext.hregoff_t: https://github.com/DragonFlyBSD/DragonFlyBSD/blob/af5fb9a9e56f90cf51e48514d1874be61e9364e6/lib/libc/tre-regex/regex.hConstants and functions:
posix_fadviseconstants: https://github.com/DragonFlyBSD/DragonFlyBSD/blob/af5fb9a9e56f90cf51e48514d1874be61e9364e6/sys/sys/fcntl.hgetrandomconstants: https://github.com/DragonFlyBSD/DragonFlyBSD/blob/af5fb9a9e56f90cf51e48514d1874be61e9364e6/sys/sys/random.hgetnameinfoconstants: https://github.com/DragonFlyBSD/DragonFlyBSD/blob/af5fb9a9e56f90cf51e48514d1874be61e9364e6/include/netdb.hfdatasyncanddup3: https://github.com/DragonFlyBSD/DragonFlyBSD/blob/af5fb9a9e56f90cf51e48514d1874be61e9364e6/include/unistd.hdlvsym: https://github.com/DragonFlyBSD/DragonFlyBSD/blob/af5fb9a9e56f90cf51e48514d1874be61e9364e6/include/dlfcn.hreallocarrayandqsort_r: https://github.com/DragonFlyBSD/DragonFlyBSD/blob/af5fb9a9e56f90cf51e48514d1874be61e9364e6/include/stdlib.hftok: https://github.com/DragonFlyBSD/DragonFlyBSD/blob/af5fb9a9e56f90cf51e48514d1874be61e9364e6/sys/sys/ipc.hChecklist
libc-test/semverhave been updated*LASTor*MAXareincluded (see #3131)
cd libc-test && cargo test --target mytarget);especially relevant for platforms that may not be checked in CI
Tested on DragonFly 5.8.3, 6.0.1, 6.2.2, 6.4.2 with self-built Rust/Cargo 1.95.0, Rust 1.95.0 on DragonFly 5.8.3 needs patches.
There is actually a
KERN_MAXID, but the same constant is also present and non-deprecated on both nto and apple.@rustbot label +stable-nominated