Fix x86_64-pc-windows-gnu build (#8411) · RustPython/RustPython@1e34770 · GitHub
Skip to content

Commit 1e34770

Browse files
Fix x86_64-pc-windows-gnu build (#8411)
A few functions were improperly gated to MSVC. Those functions call `windows-sys` so they're not MSVC.
1 parent 55b3d68 commit 1e34770

4 files changed

Lines changed: 17 additions & 4 deletions

File tree

.github/actions/install-linux-deps/action.yml

Lines changed: 8 additions & 0 deletions

.github/workflows/ci.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,10 @@ jobs:
198198
target: aarch64-unknown-linux-gnu
199199
dependencies:
200200
gcc-aarch64-linux-gnu: true
201+
- os: ubuntu-latest
202+
target: x86_64-pc-windows-gnu
203+
dependencies:
204+
gcc-mingw-w64-x86-64: true
201205
- os: macos-latest
202206
target: aarch64-apple-ios
203207
- os: macos-latest
@@ -216,6 +220,7 @@ jobs:
216220
gcc-multilib: ${{ matrix.dependencies.gcc-multilib || false }}
217221
musl-tools: ${{ matrix.dependencies.musl-tools || false }}
218222
gcc-aarch64-linux-gnu: ${{ matrix.dependencies.gcc-aarch64-linux-gnu || false }}
223+
gcc-mingw-w64-x86-64: ${{ matrix.dependencies.gcc-mingw-w64-x86-64 || false }}
219224

220225
- name: Restore cache
221226
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0

crates/host_env/src/time.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ pub fn gethrvtime_duration() -> Duration {
334334
Duration::from_nanos(unsafe { libc::gethrvtime() })
335335
}
336336

337-
#[cfg(target_env = "msvc")]
337+
#[cfg(windows)]
338338
#[cfg(not(target_arch = "wasm32"))]
339339
#[derive(Clone, Debug)]
340340
pub struct WindowsTimeZoneInfo {
@@ -345,15 +345,15 @@ pub struct WindowsTimeZoneInfo {
345345
pub daylight_name: String,
346346
}
347347

348-
#[cfg(target_env = "msvc")]
348+
#[cfg(windows)]
349349
#[cfg(not(target_arch = "wasm32"))]
350350
fn decode_tz_name(name: &[u16]) -> String {
351351
widestring::decode_utf16_lossy(name.iter().copied())
352352
.take_while(|&c| c != '\0')
353353
.collect()
354354
}
355355

356-
#[cfg(target_env = "msvc")]
356+
#[cfg(windows)]
357357
#[cfg(not(target_arch = "wasm32"))]
358358
#[must_use]
359359
pub fn get_tz_info() -> WindowsTimeZoneInfo {

crates/vm/src/stdlib/time.rs

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)