Skip to content

Commit 0644a87

Browse files
committed
Auto merge of #3355 - asomers:freebsd-14-beta2, r=JohnTitor
Reenable FreeBSD 14 CI, and update definitions to match 14.0-RC1. This reverts commit c9643c8. New FreeBSD images have been available in gcloud since July. Update the testing image to the latest, 14.0-BETA2
2 parents 43f0c3e + 58121b2 commit 0644a87

File tree

3 files changed

+46
-9
lines changed

3 files changed

+46
-9
lines changed

.cirrus.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ task:
2929
task:
3030
name: nightly x86_64-unknown-freebsd-14
3131
freebsd_instance:
32-
# FIXME: FreeBSD 14 CI fails due to pkg installation.
33-
# Use 14 again once a new image is available on Cirrus CI.
34-
image_family: freebsd-13-2
32+
image: freebsd-14-0-rc1-amd64
3533
setup_script:
3634
- pkg install -y libnghttp2 curl
3735
- curl https://sh.rustup.rs -sSf --output rustup.sh

libc-test/build.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1987,6 +1987,10 @@ fn test_freebsd(target: &str) {
19871987
Some(n) if n >= 13 => true,
19881988
_ => false,
19891989
};
1990+
let freebsd14 = match freebsd_ver {
1991+
Some(n) if n >= 14 => true,
1992+
_ => false,
1993+
};
19901994

19911995
headers! { cfg:
19921996
"aio.h",
@@ -2074,6 +2078,7 @@ fn test_freebsd(target: &str) {
20742078
"sys/sysctl.h",
20752079
"sys/thr.h",
20762080
"sys/time.h",
2081+
[freebsd14]:"sys/timerfd.h",
20772082
"sys/times.h",
20782083
"sys/timex.h",
20792084
"sys/types.h",
@@ -2196,6 +2201,12 @@ fn test_freebsd(target: &str) {
21962201
// should've been used anywhere anyway.
21972202
"TDF_UNUSED23" => true,
21982203

2204+
// Removed in FreeBSD 14 (git a6b55ee6be1)
2205+
"IFF_KNOWSEPOCH" => true,
2206+
2207+
// Removed in FreeBSD 14 (git 7ff9ae90f0b)
2208+
"IFF_NOGROUP" => true,
2209+
21992210
// FIXME: These are deprecated - remove in a couple of releases.
22002211
// These symbols are not stable across OS-versions. They were
22012212
// changed for FreeBSD 14 in git revisions b62848b0c3f and
@@ -2277,8 +2288,8 @@ fn test_freebsd(target: &str) {
22772288
// Added in freebsd 14.
22782289
"IFCAP_MEXTPG" if Some(14) > freebsd_ver => true,
22792290
// Added in freebsd 13.
2280-
"IFF_KNOWSEPOCH" | "IFCAP_TXTLS4" | "IFCAP_TXTLS6" | "IFCAP_VXLAN_HWCSUM"
2281-
| "IFCAP_VXLAN_HWTSO" | "IFCAP_TXTLS_RTLMT" | "IFCAP_TXTLS"
2291+
"IFCAP_TXTLS4" | "IFCAP_TXTLS6" | "IFCAP_VXLAN_HWCSUM" | "IFCAP_VXLAN_HWTSO"
2292+
| "IFCAP_TXTLS_RTLMT" | "IFCAP_TXTLS"
22822293
if Some(13) > freebsd_ver =>
22832294
{
22842295
true

src/unix/bsd/freebsdlike/freebsd/mod.rs

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -365,9 +365,13 @@ s! {
365365
}
366366

367367
pub struct cpuset_t {
368-
#[cfg(target_pointer_width = "64")]
368+
#[cfg(all(freebsd14, target_pointer_width = "64"))]
369+
__bits: [::c_long; 16],
370+
#[cfg(all(freebsd14, target_pointer_width = "32"))]
371+
__bits: [::c_long; 32],
372+
#[cfg(all(not(freebsd14), target_pointer_width = "64"))]
369373
__bits: [::c_long; 4],
370-
#[cfg(target_pointer_width = "32")]
374+
#[cfg(all(not(freebsd14), target_pointer_width = "32"))]
371375
__bits: [::c_long; 8],
372376
}
373377

@@ -998,6 +1002,8 @@ s! {
9981002
pub pcbcnt: u32,
9991003
}
10001004

1005+
// Note: this structure will change in a backwards-incompatible way in
1006+
// FreeBSD 15.
10011007
pub struct tcp_info {
10021008
pub tcpi_state: u8,
10031009
pub __tcpi_ca_state: u8,
@@ -1055,7 +1061,21 @@ s! {
10551061
#[cfg(freebsd14)]
10561062
pub __tcpi_received_ce_bytes: u32,
10571063
#[cfg(freebsd14)]
1058-
pub __tcpi_pad: [u32; 19],
1064+
pub tcpi_total_tlp: u32,
1065+
#[cfg(freebsd14)]
1066+
pub tcpi_total_tlp_bytes: u64,
1067+
#[cfg(freebsd14)]
1068+
pub tcpi_snd_una: u32,
1069+
#[cfg(freebsd14)]
1070+
pub tcpi_snd_max: u32,
1071+
#[cfg(freebsd14)]
1072+
pub tcpi_rcv_numsacks: u32,
1073+
#[cfg(freebsd14)]
1074+
pub tcpi_rcv_adv: u32,
1075+
#[cfg(freebsd14)]
1076+
pub tcpi_dupacks: u32,
1077+
#[cfg(freebsd14)]
1078+
pub __tcpi_pad: [u32; 10],
10591079
#[cfg(not(freebsd14))]
10601080
pub __tcpi_pad: [u32; 26],
10611081
}
@@ -2599,7 +2619,13 @@ pub const DEVSTAT_N_TRANS_FLAGS: ::c_int = 4;
25992619
pub const DEVSTAT_NAME_LEN: ::c_int = 16;
26002620

26012621
// sys/cpuset.h
2602-
pub const CPU_SETSIZE: ::c_int = 256;
2622+
cfg_if! {
2623+
if #[cfg(freebsd14)] {
2624+
pub const CPU_SETSIZE: ::c_int = 1024;
2625+
} else {
2626+
pub const CPU_SETSIZE: ::c_int = 256;
2627+
}
2628+
}
26032629

26042630
pub const SIGEV_THREAD_ID: ::c_int = 4;
26052631

@@ -3172,6 +3198,7 @@ pub const IFF_LOOPBACK: ::c_int = 0x8;
31723198
/// (i) is a point-to-point link
31733199
pub const IFF_POINTOPOINT: ::c_int = 0x10;
31743200
/// (i) calls if_input in net epoch
3201+
#[deprecated(since = "0.2.149", note = "Removed in FreeBSD 14")]
31753202
pub const IFF_KNOWSEPOCH: ::c_int = 0x20;
31763203
/// (d) resources allocated
31773204
pub const IFF_RUNNING: ::c_int = 0x40;
@@ -3219,6 +3246,7 @@ pub const IFF_DYING: ::c_int = 0x200000;
32193246
/// (n) interface is being renamed
32203247
pub const IFF_RENAMING: ::c_int = 0x400000;
32213248
/// interface is not part of any groups
3249+
#[deprecated(since = "0.2.149", note = "Removed in FreeBSD 14")]
32223250
pub const IFF_NOGROUP: ::c_int = 0x800000;
32233251

32243252
/// link invalid/unknown

0 commit comments

Comments
 (0)