Skip to content

Commit 84d1dfb

Browse files
committed
feat: deprecate windows time64_t
Functionality related to the Windows `time64_t` has been deprecated in favor of a single, 64-bit wide `time_t`. This has also required some work into getting rid of the conditional compilation uses of `time_t` on GNU target environments, and tweaking the `max_align_t` type, as that seemed to provide an incoherent interface in Windows with mingw32. During this work, what seems like some incoherences in the CI pipeline where found out, and have been addressed as well. This mostly consists of a step where mingw32 was being installed and possible "fixed" but that would never run because it relied on environment variables that were only visible in the runner once the job coming after the one setting up the Rust toolchain ran. This has now been removed in favor of not performing any checks, as CI logs seem to have been running for some time without this. The FIXME comment on the tier 1 platform support for Windows with GNU has also been removed as no segfaults were observed.
1 parent 34527ca commit 84d1dfb

5 files changed

Lines changed: 16 additions & 39 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,13 @@ jobs:
123123
os: windows-11-arm
124124
- target: aarch64-unknown-linux-gnu
125125
os: ubuntu-24.04-arm
126-
# FIXME: It currently causes segfaults.
127-
#- target: i686-pc-windows-gnu
128-
# env: { ARCH_BITS: 32, ARCH: i686 }
126+
- target: i686-pc-windows-gnu
127+
os: windows-2025
129128
- target: i686-pc-windows-msvc
130129
os: windows-2025
131130
- target: i686-unknown-linux-gnu
132131
- target: x86_64-pc-windows-gnu
133132
os: windows-2025
134-
env: { ARCH_BITS: 64, ARCH: x86_64 }
135133
- target: x86_64-pc-windows-msvc
136134
os: windows-2025
137135
- target: x86_64-unknown-linux-gnu

ci/install-rust.sh

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,11 @@ if [ -n "${INSTALL_RUST_SRC:-}" ]; then
3838
fi
3939

4040
if [ "$os" = "windows" ]; then
41-
if [ "${ARCH_BITS:-}" = "i686" ]; then
42-
echo "Install MinGW32"
43-
choco install mingw --x86 --force
44-
fi
45-
4641
echo "Find GCC libraries"
4742
gcc -print-search-dirs
48-
/usr/bin/find "C:\ProgramData\Chocolatey" -name "crt2*"
49-
/usr/bin/find "C:\ProgramData\Chocolatey" -name "dllcrt2*"
50-
/usr/bin/find "C:\ProgramData\Chocolatey" -name "libmsvcrt*"
51-
52-
if [ -n "${ARCH_BITS:-}" ]; then
53-
echo "Fix MinGW"
54-
for i in crt2.o dllcrt2.o libmingwex.a libmsvcrt.a; do
55-
cp -f "/C/ProgramData/Chocolatey/lib/mingw/tools/install/mingw$ARCH_BITS/$ARCH-w64-mingw32/lib/$i" "$(rustc --print sysroot)/lib/rustlib/$TARGET/lib"
56-
done
57-
fi
43+
/usr/bin/find "C:\ProgramData\chocolatey" -name "crt2*"
44+
/usr/bin/find "C:\ProgramData\chocolatey" -name "dllcrt2*"
45+
/usr/bin/find "C:\ProgramData\chocolatey" -name "libmsvcrt*"
5846
fi
5947

6048
echo "Query rust and cargo versions"

libc-test/build.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,6 @@ fn test_cygwin(target: &str) {
753753
fn test_windows(target: &str) {
754754
assert!(target.contains("windows"));
755755
let gnu = target.contains("gnu");
756-
let i686 = target.contains("i686");
757756

758757
let mut cfg = ctest_cfg();
759758

@@ -818,19 +817,9 @@ fn test_windows(target: &str) {
818817
cfg.skip_alias(move |alias| match alias.ident() {
819818
"SSIZE_T" if !gnu => true,
820819
"ssize_t" if !gnu => true,
821-
// FIXME(windows): The size and alignment of this type are incorrect
822-
"time_t" if gnu && i686 => true,
823820
_ => false,
824821
});
825822

826-
cfg.skip_struct(move |struct_| {
827-
match struct_.ident() {
828-
// FIXME(windows): The size and alignment of this struct are incorrect
829-
"timespec" if gnu && i686 => true,
830-
_ => false,
831-
}
832-
});
833-
834823
cfg.skip_const(move |constant| {
835824
match constant.ident() {
836825
// FIXME(windows): API error:

src/windows/gnu/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
use crate::prelude::*;
22

3+
// The below configuration for machines with 32-bit word size aligns with the
4+
// declaration in the `mingw-w64` headers.
35
cfg_if! {
46
if #[cfg(target_pointer_width = "64")] {
57
s_no_extra_traits! {
@@ -10,9 +12,9 @@ cfg_if! {
1012
}
1113
} else if #[cfg(target_pointer_width = "32")] {
1214
s_no_extra_traits! {
13-
#[repr(align(16))]
15+
#[repr(align(8))]
1416
pub struct max_align_t {
15-
priv_: [i64; 6],
17+
priv_: [i64; 3],
1618
}
1719
}
1820
}

src/windows/mod.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,7 @@ pub type clock_t = i32;
1818

1919
pub type errno_t = c_int;
2020

21-
cfg_if! {
22-
if #[cfg(all(target_arch = "x86", target_env = "gnu"))] {
23-
pub type time_t = i32;
24-
} else {
25-
pub type time_t = i64;
26-
}
27-
}
21+
pub type time_t = i64;
2822

2923
pub type off_t = i32;
3024
pub type dev_t = u32;
@@ -34,6 +28,12 @@ extern_ty! {
3428
pub enum timezone {}
3529
}
3630

31+
#[deprecated(
32+
since = "1.0.0",
33+
note = "This time-related value, among others, is part of the shift \
34+
towards using a single, 64-bit-sized `time_t`. See #PENDING for \
35+
discussion."
36+
)]
3737
pub type time64_t = i64;
3838

3939
pub type SOCKET = crate::uintptr_t;

0 commit comments

Comments
 (0)