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 {
180
180
ImagePlatform :: from_const_target ( TargetTriple :: X86_64UnknownLinuxGnu ) ;
181
181
pub const AARCH64_UNKNOWN_LINUX_GNU : Self =
182
182
ImagePlatform :: from_const_target ( TargetTriple :: Aarch64UnknownLinuxGnu ) ;
183
+ pub const X86_64_PC_WINDOWS_MSVC : Self =
184
+ ImagePlatform :: from_const_target ( TargetTriple :: X86_64PcWindowsMsvc ) ;
183
185
184
186
/// Get a representative version of this platform specifier for usage in `--platform`
185
187
///
@@ -199,6 +201,7 @@ impl ImagePlatform {
199
201
TargetTriple :: Aarch64UnknownLinuxGnu => {
200
202
Some ( "ImagePlatform::AARCH64_UNKNOWN_LINUX_GNU" )
201
203
}
204
+ TargetTriple :: X86_64PcWindowsMsvc => Some ( "ImagePlatform::X86_64_PC_WINDOWS_MSVC" ) ,
202
205
_ => None ,
203
206
}
204
207
}
@@ -237,6 +240,7 @@ impl std::str::FromStr for ImagePlatform {
237
240
match s {
238
241
"linux/amd64" => return Ok ( Self :: X86_64_UNKNOWN_LINUX_GNU ) ,
239
242
"linux/arm64" | "linux/arm64/v8" => return Ok ( Self :: AARCH64_UNKNOWN_LINUX_GNU ) ,
243
+ "windows/amd64" => return Ok ( Self :: X86_64_PC_WINDOWS_MSVC ) ,
240
244
_ => { }
241
245
} ;
242
246
@@ -542,6 +546,11 @@ pub mod tests {
542
546
ImagePlatform :: AARCH64_UNKNOWN_LINUX_GNU
543
547
) ;
544
548
549
+ assert_eq ! (
550
+ "windows/amd64" . parse:: <ImagePlatform >( ) ?,
551
+ ImagePlatform :: X86_64_PC_WINDOWS_MSVC
552
+ ) ;
553
+
545
554
Ok ( ( ) )
546
555
}
547
556
}
Original file line number Diff line number Diff line change @@ -363,6 +363,7 @@ fn has_native_image(
363
363
Ok ( match target. sub . as_deref ( ) {
364
364
// FIXME: add additional subs for new Linux distros, such as alpine.
365
365
None | Some ( "centos" ) => match ( platform, target. name . as_str ( ) ) {
366
+ // TODO: "windows/amd64"?
366
367
( "linux/386" , "i686-unknown-linux-gnu" )
367
368
| ( "linux/amd64" , "x86_64-unknown-linux-gnu" )
368
369
| ( "linux/arm64" | "linux/arm64/v8" , "aarch64-unknown-linux-gnu" )
You can’t perform that action at this time.
0 commit comments