hashicorp / vagrant

Vagrant is a tool for building and distributing development environments.
https://www.vagrantup.com
Other
26.23k stars 4.43k forks source link

Add architecture support #13239

Closed chrisroberts closed 1 year ago

chrisroberts commented 1 year ago

This PR adds box architecture support. It introduces a new setting to the vm configuration within the Vagrantfile:

Vagrant.configure("2") do |config|
  config.vm.box = "box-name"
  config.vm.box_architecture = "amd64"
end

In most circumstances, this setting will not be needed. By default it is set to a special value of :auto. The behavior when set to :auto is as follows: Vagrant will determine the architecture of the host and automatically request it from the box repository. If architecture information is available in the repository metadata and a matching architecture was not found, Vagrant will look for a box with an architecture of "unknown" and flagged as the default architecture. This behavior allows Vagrant to continue working correctly with boxes currently published on Vagrant Cloud that do not include architecture information.

The box_architecture setting can also be set to nil, which will prevent any architecture filtering being performed, and the box flagged as the default architecture will be used.

The box collection will now unpack boxes based on architecture. Special handling is done when box_architecture is set to :auto which prevents Vagrant from not properly detecting boxes installed without architecture support.

The vagrant cloud commands have been updated to include architecture support where required. These updates are dependent on hashicorp/vagrant_cloud#82

Fixes: #12610

websafe commented 1 year ago

Great! Thank you!