Skip to content

Commit 454bb23

Browse files
committed
fix windows arm64 builds
1 parent cf2c774 commit 454bb23

2 files changed

Lines changed: 16 additions & 14 deletions

File tree

clang-tools-manager/src/downloader/hashing.rs

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,25 @@ use std::{fs, io::Read, num::NonZero, path::Path};
1515
#[derive(Debug, Clone)]
1616
pub enum HashAlgorithm {
1717
/// SHA-256 hash algorithm with the expected checksum value.
18+
///
19+
/// Used by the PyPI downloader.
1820
Sha256(String),
1921

2022
/// BLAKE2b-256 hash algorithm with the expected checksum value.
23+
///
24+
/// Used by the PyPI downloader.
2125
Blake2b256(String),
2226

2327
/// SHA-512 hash algorithm with the expected checksum value.
24-
#[cfg(any(
25-
// Windows support is only for x86_64 architecture (for now)
26-
all(target_os = "windows", target_arch = "x86_64"),
27-
// Linux and macOS support only x86_64 and aarch64 architectures
28+
///
29+
/// Used exclusively by the static distribution downloader.
30+
#[cfg(
31+
// Windows, Linux, and MacOS support only x86_64 and aarch64 architectures
2832
all(
29-
any(target_os = "linux", target_os = "macos"),
33+
any(target_os = "windows", target_os = "linux", target_os = "macos"),
3034
any(target_arch = "x86_64", target_arch = "aarch64")
31-
),
32-
))]
35+
)
36+
)]
3337
Sha512(String),
3438
}
3539

@@ -85,15 +89,13 @@ impl HashAlgorithm {
8589
let hasher = Blake2b::<U32>::new();
8690
Self::hash_file(hasher, file_path, expected)
8791
}
88-
#[cfg(any(
89-
// Windows support is only for x86_64 architecture (for now)
90-
all(target_os = "windows", target_arch = "x86_64"),
91-
// Linux and macOS support only x86_64 and aarch64 architectures
92+
#[cfg(
93+
// Windows, Linux, and MacOS support only x86_64 and aarch64 architectures
9294
all(
93-
any(target_os = "linux", target_os = "macos"),
95+
any(target_os = "windows", target_os = "linux", target_os = "macos"),
9496
any(target_arch = "x86_64", target_arch = "aarch64")
9597
),
96-
))]
98+
)]
9799
HashAlgorithm::Sha512(expected) => {
98100
use sha2::{Digest, Sha512};
99101

clang-tools-manager/src/downloader/static_dist.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ mod supported_platform {
120120

121121
/// Verifies the SHA512 checksum of the downloaded file.
122122
///
123-
/// The expected checksum is extracted from another downloaded `*.sha512sum` file
123+
/// The expected checksum is extracted from another downloaded `SHA512SUMS` file
124124
/// (pointed to by `sha512_path`).
125125
fn verify_sha512(
126126
file_path: &Path,

0 commit comments

Comments
 (0)