Skip to content

Commit

Permalink
Auto merge of #3355 - asomers:freebsd-14-beta2, r=JohnTitor
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bors committed Oct 25, 2023
2 parents 43f0c3e + 58121b2 commit 0644a87
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 9 deletions.
4 changes: 1 addition & 3 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ task:
task:
name: nightly x86_64-unknown-freebsd-14
freebsd_instance:
# FIXME: FreeBSD 14 CI fails due to pkg installation.
# Use 14 again once a new image is available on Cirrus CI.
image_family: freebsd-13-2
image: freebsd-14-0-rc1-amd64
setup_script:
- pkg install -y libnghttp2 curl
- curl https://sh.rustup.rs -sSf --output rustup.sh
Expand Down
15 changes: 13 additions & 2 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1987,6 +1987,10 @@ fn test_freebsd(target: &str) {
Some(n) if n >= 13 => true,
_ => false,
};
let freebsd14 = match freebsd_ver {
Some(n) if n >= 14 => true,
_ => false,
};

headers! { cfg:
"aio.h",
Expand Down Expand Up @@ -2074,6 +2078,7 @@ fn test_freebsd(target: &str) {
"sys/sysctl.h",
"sys/thr.h",
"sys/time.h",
[freebsd14]:"sys/timerfd.h",
"sys/times.h",
"sys/timex.h",
"sys/types.h",
Expand Down Expand Up @@ -2196,6 +2201,12 @@ fn test_freebsd(target: &str) {
// should've been used anywhere anyway.
"TDF_UNUSED23" => true,

// Removed in FreeBSD 14 (git a6b55ee6be1)
"IFF_KNOWSEPOCH" => true,

// Removed in FreeBSD 14 (git 7ff9ae90f0b)
"IFF_NOGROUP" => true,

// FIXME: These are deprecated - remove in a couple of releases.
// These symbols are not stable across OS-versions. They were
// changed for FreeBSD 14 in git revisions b62848b0c3f and
Expand Down Expand Up @@ -2277,8 +2288,8 @@ fn test_freebsd(target: &str) {
// Added in freebsd 14.
"IFCAP_MEXTPG" if Some(14) > freebsd_ver => true,
// Added in freebsd 13.
"IFF_KNOWSEPOCH" | "IFCAP_TXTLS4" | "IFCAP_TXTLS6" | "IFCAP_VXLAN_HWCSUM"
| "IFCAP_VXLAN_HWTSO" | "IFCAP_TXTLS_RTLMT" | "IFCAP_TXTLS"
"IFCAP_TXTLS4" | "IFCAP_TXTLS6" | "IFCAP_VXLAN_HWCSUM" | "IFCAP_VXLAN_HWTSO"
| "IFCAP_TXTLS_RTLMT" | "IFCAP_TXTLS"
if Some(13) > freebsd_ver =>
{
true
Expand Down
36 changes: 32 additions & 4 deletions src/unix/bsd/freebsdlike/freebsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,13 @@ s! {
}

pub struct cpuset_t {
#[cfg(target_pointer_width = "64")]
#[cfg(all(freebsd14, target_pointer_width = "64"))]
__bits: [::c_long; 16],
#[cfg(all(freebsd14, target_pointer_width = "32"))]
__bits: [::c_long; 32],
#[cfg(all(not(freebsd14), target_pointer_width = "64"))]
__bits: [::c_long; 4],
#[cfg(target_pointer_width = "32")]
#[cfg(all(not(freebsd14), target_pointer_width = "32"))]
__bits: [::c_long; 8],
}

Expand Down Expand Up @@ -998,6 +1002,8 @@ s! {
pub pcbcnt: u32,
}

// Note: this structure will change in a backwards-incompatible way in
// FreeBSD 15.
pub struct tcp_info {
pub tcpi_state: u8,
pub __tcpi_ca_state: u8,
Expand Down Expand Up @@ -1055,7 +1061,21 @@ s! {
#[cfg(freebsd14)]
pub __tcpi_received_ce_bytes: u32,
#[cfg(freebsd14)]
pub __tcpi_pad: [u32; 19],
pub tcpi_total_tlp: u32,
#[cfg(freebsd14)]
pub tcpi_total_tlp_bytes: u64,
#[cfg(freebsd14)]
pub tcpi_snd_una: u32,
#[cfg(freebsd14)]
pub tcpi_snd_max: u32,
#[cfg(freebsd14)]
pub tcpi_rcv_numsacks: u32,
#[cfg(freebsd14)]
pub tcpi_rcv_adv: u32,
#[cfg(freebsd14)]
pub tcpi_dupacks: u32,
#[cfg(freebsd14)]
pub __tcpi_pad: [u32; 10],
#[cfg(not(freebsd14))]
pub __tcpi_pad: [u32; 26],
}
Expand Down Expand Up @@ -2599,7 +2619,13 @@ pub const DEVSTAT_N_TRANS_FLAGS: ::c_int = 4;
pub const DEVSTAT_NAME_LEN: ::c_int = 16;

// sys/cpuset.h
pub const CPU_SETSIZE: ::c_int = 256;
cfg_if! {
if #[cfg(freebsd14)] {
pub const CPU_SETSIZE: ::c_int = 1024;
} else {
pub const CPU_SETSIZE: ::c_int = 256;
}
}

pub const SIGEV_THREAD_ID: ::c_int = 4;

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

/// link invalid/unknown
Expand Down

0 comments on commit 0644a87

Please sign in to comment.