File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -180,6 +180,8 @@ impl ImagePlatform {
180180 ImagePlatform :: from_const_target ( TargetTriple :: X86_64UnknownLinuxGnu ) ;
181181 pub const AARCH64_UNKNOWN_LINUX_GNU : Self =
182182 ImagePlatform :: from_const_target ( TargetTriple :: Aarch64UnknownLinuxGnu ) ;
183+ pub const X86_64_PC_WINDOWS_MSVC : Self =
184+ ImagePlatform :: from_const_target ( TargetTriple :: X86_64PcWindowsMsvc ) ;
183185
184186 /// Get a representative version of this platform specifier for usage in `--platform`
185187 ///
@@ -199,6 +201,7 @@ impl ImagePlatform {
199201 TargetTriple :: Aarch64UnknownLinuxGnu => {
200202 Some ( "ImagePlatform::AARCH64_UNKNOWN_LINUX_GNU" )
201203 }
204+ TargetTriple :: X86_64PcWindowsMsvc => Some ( "ImagePlatform::X86_64_PC_WINDOWS_MSVC" ) ,
202205 _ => None ,
203206 }
204207 }
@@ -237,6 +240,7 @@ impl std::str::FromStr for ImagePlatform {
237240 match s {
238241 "linux/amd64" => return Ok ( Self :: X86_64_UNKNOWN_LINUX_GNU ) ,
239242 "linux/arm64" | "linux/arm64/v8" => return Ok ( Self :: AARCH64_UNKNOWN_LINUX_GNU ) ,
243+ "windows/amd64" => return Ok ( Self :: X86_64_PC_WINDOWS_MSVC ) ,
240244 _ => { }
241245 } ;
242246
@@ -542,6 +546,11 @@ pub mod tests {
542546 ImagePlatform :: AARCH64_UNKNOWN_LINUX_GNU
543547 ) ;
544548
549+ assert_eq ! (
550+ "windows/amd64" . parse:: <ImagePlatform >( ) ?,
551+ ImagePlatform :: X86_64_PC_WINDOWS_MSVC
552+ ) ;
553+
545554 Ok ( ( ) )
546555 }
547556}
Original file line number Diff line number Diff line change @@ -363,6 +363,7 @@ fn has_native_image(
363363 Ok ( match target. sub . as_deref ( ) {
364364 // FIXME: add additional subs for new Linux distros, such as alpine.
365365 None | Some ( "centos" ) => match ( platform, target. name . as_str ( ) ) {
366+ // TODO: "windows/amd64"?
366367 ( "linux/386" , "i686-unknown-linux-gnu" )
367368 | ( "linux/amd64" , "x86_64-unknown-linux-gnu" )
368369 | ( "linux/arm64" | "linux/arm64/v8" , "aarch64-unknown-linux-gnu" )
You can’t perform that action at this time.
0 commit comments