Skip to content

Commit 639dabd

Browse files
committed
Rename os_version to os.version and fix macos version string.
Signed-off-by: Tom Forbes <tom@tomforb.es>
1 parent 593def8 commit 639dabd

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/image/descriptor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ pub struct Platform {
102102
/// manifests where os.version is not known to work with the host OS
103103
/// version. Valid values are implementation-defined. e.g.
104104
/// 10.0.14393.1066 on windows.
105-
#[serde(skip_serializing_if = "Option::is_none")]
105+
#[serde(rename = "os.version", skip_serializing_if = "Option::is_none")]
106106
#[builder(default)]
107107
os_version: Option<String>,
108108
/// This OPTIONAL property specifies an array of strings, each

src/image/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,8 @@ impl From<&str> for Os {
231231
"aix" => Os::AIX,
232232
"android" => Os::Android,
233233
"darwin" => Os::Darwin,
234+
// std::env::consts::OS returns "macos" instead of darwin
235+
"macos" => Os::Darwin,
234236
"dragonfly" => Os::DragonFlyBSD,
235237
"freebsd" => Os::FreeBSD,
236238
"hurd" => Os::Hurd,

src/runtime/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ mod tests {
295295
.expect("failed to canonicalize rootfs");
296296

297297
assert_eq!(
298-
&rootfs_absolute_path,
298+
&rootfs_absolute_path.canonicalize().unwrap(),
299299
spec.root.expect("no root in spec").path()
300300
);
301301
}
@@ -310,7 +310,7 @@ mod tests {
310310
.expect("failed to canonicalize rootfs");
311311

312312
assert_eq!(
313-
&rootfs_absolute_path,
313+
&rootfs_absolute_path.canonicalize().unwrap(),
314314
spec.root.expect("no root in spec").path()
315315
);
316316
}

0 commit comments

Comments
 (0)