mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
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.
This commit is contained in:
1 parent
9e66266168
commit
3dca6bbdf4
4 files changed
+17
-4
No files matched your search
@@ -29,6 +29,10 @@ inputs:
|
||||
description: Install gcc-aarch64-linux-gnu (gcc-aarch64-linux-gnu)
|
||||
required: false
|
||||
default: "false"
|
||||
gcc-mingw-w64-x86-64:
|
||||
description: Install gcc-mingw-w64-x86-64 (gcc-mingw-w64-x86-64)
|
||||
required: false
|
||||
default: "false"
|
||||
clang:
|
||||
description: Install clang (clang)
|
||||
required: false
|
||||
@@ -44,6 +48,7 @@ runs:
|
||||
MUSL_TOOLS: ${{ inputs.musl-tools }}
|
||||
CLANG: ${{ inputs.clang }}
|
||||
GCC_AARCH64_LINUX_GNU: ${{ inputs.gcc-aarch64-linux-gnu }}
|
||||
GCC_MINGW_W64_X86_64: ${{ inputs.gcc-mingw-w64-x86-64 }}
|
||||
run: |
|
||||
if ! sudo apt-get update; then
|
||||
echo "::warning::apt-get update failed; disabling nonessential Microsoft apt sources and retrying"
|
||||
@@ -68,6 +73,9 @@ runs:
|
||||
if [[ "$GCC_AARCH64_LINUX_GNU" == "true" ]]; then
|
||||
packages+=(gcc-aarch64-linux-gnu linux-libc-dev-arm64-cross libc6-dev-arm64-cross)
|
||||
fi
|
||||
if [[ "$GCC_MINGW_W64_X86_64" == "true" ]]; then
|
||||
packages+=(gcc-mingw-w64-x86-64)
|
||||
fi
|
||||
|
||||
if ((${#packages[@]})); then
|
||||
sudo apt-get install --no-install-recommends "${packages[@]}"
|
||||
|
||||
@@ -198,6 +198,10 @@ jobs:
|
||||
target: aarch64-unknown-linux-gnu
|
||||
dependencies:
|
||||
gcc-aarch64-linux-gnu: true
|
||||
- os: ubuntu-latest
|
||||
target: x86_64-pc-windows-gnu
|
||||
dependencies:
|
||||
gcc-mingw-w64-x86-64: true
|
||||
- os: macos-latest
|
||||
target: aarch64-apple-ios
|
||||
- os: macos-latest
|
||||
@@ -216,6 +220,7 @@ jobs:
|
||||
gcc-multilib: ${{ matrix.dependencies.gcc-multilib || false }}
|
||||
musl-tools: ${{ matrix.dependencies.musl-tools || false }}
|
||||
gcc-aarch64-linux-gnu: ${{ matrix.dependencies.gcc-aarch64-linux-gnu || false }}
|
||||
gcc-mingw-w64-x86-64: ${{ matrix.dependencies.gcc-mingw-w64-x86-64 || false }}
|
||||
|
||||
- name: Restore cache
|
||||
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
||||
|
||||
@@ -334,7 +334,7 @@ pub fn gethrvtime_duration() -> Duration {
|
||||
Duration::from_nanos(unsafe { libc::gethrvtime() })
|
||||
}
|
||||
|
||||
#[cfg(target_env = "msvc")]
|
||||
#[cfg(windows)]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct WindowsTimeZoneInfo {
|
||||
@@ -345,7 +345,7 @@ pub struct WindowsTimeZoneInfo {
|
||||
pub daylight_name: String,
|
||||
}
|
||||
|
||||
#[cfg(target_env = "msvc")]
|
||||
#[cfg(windows)]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
fn decode_tz_name(name: &[u16]) -> String {
|
||||
widestring::decode_utf16_lossy(name.iter().copied())
|
||||
@@ -353,7 +353,7 @@ fn decode_tz_name(name: &[u16]) -> String {
|
||||
.collect()
|
||||
}
|
||||
|
||||
#[cfg(target_env = "msvc")]
|
||||
#[cfg(windows)]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
#[must_use]
|
||||
pub fn get_tz_info() -> WindowsTimeZoneInfo {
|
||||
|
||||
@@ -210,7 +210,7 @@ mod decl {
|
||||
Ok(get_perf_time(vm)?.as_nanos())
|
||||
}
|
||||
|
||||
#[cfg(target_env = "msvc")]
|
||||
#[cfg(windows)]
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
pub(super) fn get_tz_info() -> host_time::WindowsTimeZoneInfo {
|
||||
host_time::get_tz_info()
|
||||
|
||||
Reference in new issue
Block a user