Skip to content

metadata.json box version parsing sort discrepancy between linux and mac environment might be ruby sort algo differ under mac? #13714

@BuhtigithuB

Description

@BuhtigithuB

Debug output

{
"name": "...",
"description": "...",
"versions": [
{
"version": "2025.07.11",
...
},
{
"version": "2025.07.14",
...
},
{
"version": "2025.07.17",
...
},
{
"version": "2025.07.21",
...
},
{
"version": "2025.07.24",
...
},

]

}

vagrant up
Bringing machine ...
==> Box '...' could not be found. Attempting to find and install...

Box Version: >= 0

==> Loading metadata for box 'file:///metadata_TESTING.json'

==> Adding box '...' (v2025.07.21) for provider: ...
puppet: Downloading:

Under Mac

{
"name": "...",
"description": "...",
"versions": [
{
"version": "20250711",
...
},
{
"version": "20250714",
...
},
{
"version": "20250717",
...
},
{
"version": "20250721",
...
},
{
"version": "20250724",
...
},

]

}

vagrant up
Bringing machine ...
==> Box '...' could not be found. Attempting to find and install...

Box Version: >= 0

==> Loading metadata for box 'file:///metadata_TESTING.json'

==> Adding box '...' (v20250724) for provider: ...
puppet: Downloading:

Mac Linux without the "." it works and pick-up the right box.

In either case with the "." and without the "." in the version number under Linux it recovers the expected box which shall be the "v2025.07.24" or "v20250724"

Expected behavior

Both environment shall use the "v20250724" version box

Actual behavior

Under Mac compare to Linux the version pulled by vagrant is the "v2025.07.21" with the exact same metadata.json file which doesn't make sense.

We have been testing while removing the "." in or version number and than Mac pick-up the correct expected box

Reproduction information

Vagrant version

Mac
Vagrant 2.4.8
ruby 3.4.5 (2025-07-16 revision 20cda200d3) +PRISM [arm64-darwin24]

Linux
Vagrant 2.4.8
ruby --version
ruby 3.3.8 (2025-04-09 revision b200bad6cd) [x86_64-linux-gnu]

Host operating system

Mac
Darwin 24.6.0 Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:40 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6041 arm64

Linux
Linux 6.12.38+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.38-1 (2025-07-16) x86_64 GNU/Linux

Guest operating system

N/A

Steps to reproduce

  1. Create a dummy metadata.json file with various version number like the example provided and spoof it to the vagrant command

Vagrantfile

Any Vagrant file shall do you only want to check which box vagrant recover when it parse the metadata.json file

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions