Skip to content

Rename os_version to os.version#163

Open
orf wants to merge 1 commit into
youki-dev:mainfrom
orf:os-version_rename
Open

Rename os_version to os.version#163
orf wants to merge 1 commit into
youki-dev:mainfrom
orf:os-version_rename

Conversation

@orf
Copy link
Copy Markdown

@orf orf commented Apr 13, 2024

I believe this should be os.version like ImageConfig?

For example this is what Github container repo returns:

{
  "schemaVersion": 2,
  "manifests": [
    {
      "mediaType": "application/vnd.oci.image.manifest.v1+json",
      "digest": "sha256:b09d1eb75170275f0e465ed97e90718e596aab4a2413ba7eedcfb9f13580aca6",
      "size": 2015,
      "platform": {
        "architecture": "amd64",
        "os": "darwin",
        "os.version": "macOS 13.3"
      },

Also the tests failed on MacOS. I fixed this by canonicalising the temporary directory as well:

thread 'runtime::tests::test_canonicalize_rootfs' panicked at 'assertion failed: `(left == right)`
  left: `"/var/folders/q1/c031nnz57ls4qm4dk3m3w74h0000gn/T/.tmpxAJ0q3/rootfs"`,
 right: `"/private/var/folders/q1/c031nnz57ls4qm4dk3m3w74h0000gn/T/.tmpxAJ0q3/rootfs"`', src/runtime/mod.rs:306:13

Unfortunately std::env::consts::OS returns macos instead of Darwin, so I added an extra arm to the match condition to handle this. This makes Default work properly on MacOS.

Same as #134

Signed-off-by: Tom Forbes <tom@tomforb.es>
@orf orf force-pushed the os-version_rename branch from 02aae16 to 639dabd Compare April 13, 2024 13:30
Comment thread src/image/mod.rs
"android" => Os::Android,
"darwin" => Os::Darwin,
// std::env::consts::OS returns "macos" instead of darwin
"macos" => Os::Darwin,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I ask you to create another commit or PR about this change?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's been a long time, I suggest maintainers close this PR and properly commit this fix themselves.

Copy link
Copy Markdown
Contributor

@MOZGIII MOZGIII Jan 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, and this PR is also obsolete, since master already has the title changes.

@MOZGIII
Copy link
Copy Markdown
Contributor

MOZGIII commented Jan 7, 2025

Actually, according to the spec, all the os_* fields are supposed to be os.* - that includes os.features too.

@utam0k
Copy link
Copy Markdown
Member

utam0k commented Jan 10, 2025

@MOZGIII Do you intend to create another PR to take over this one?

@MOZGIII
Copy link
Copy Markdown
Contributor

MOZGIII commented Jan 10, 2025

@MOZGIII Do you intend to create another PR to take over this one?

No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants