diff --git a/.gitignore b/.gitignore index ce3853d..9789edb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -/vagrant-*.tar.gz +/v-*.tar.gz /vagrant-spec-*.tar.gz diff --git a/sources b/sources index 33458a6..e27ee7e 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (vagrant-2.2.9.tar.gz) = 15e230bcf336615f0d49a2c40db36f7f26a9f0f6fd42d2ce801f28afc663aadded4fa373e33f9102b21ee70d98563fc68e2b24ffa6c3eec321f58b2c42b0d260 -SHA512 (vagrant-spec-abfc34474d122235d56e4c6b6fb5d3e35bedfa90.tar.gz) = cbb60d661d34b37bc5d414da0b2a31f39e2910c11251e334da5efbd8f010b5bd428bc1ae476fcb9b42ec4e8f8c6265292ba3f8f543625178ecb85aad06e8856f +SHA512 (v2.2.16.tar.gz) = cb1edf0d614e9dda252b0a99571febc05f3dc497825852167d0e80e2a59821fb52ddb91b8085646c7bdeaf6ece642c0889d1a6cb4fdcc37b9f789f86fd8c0ee9 +SHA512 (vagrant-spec-9057cd6e0ac299688da608d459deac66bfad8880.tar.gz) = 7846e910cd4b9a036d1edb22d4ead7f9180ebed60a58c10c26044879b9b5d0adab9cfe645625d9d7f2f399707c5044a36eb06fb0f9dc4e32df66910398dab65c diff --git a/vagrant-2.2.16-fix-compatibility-with-ruby-3.0.patch b/vagrant-2.2.16-fix-compatibility-with-ruby-3.0.patch new file mode 100644 index 0000000..bf30e63 --- /dev/null +++ b/vagrant-2.2.16-fix-compatibility-with-ruby-3.0.patch @@ -0,0 +1,185 @@ +From e4859e2486a3ac031a79ae62ef17bd8cbdbb86e2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= +Date: Sun, 4 Apr 2021 22:46:45 +0200 +Subject: [PATCH] Fix shell provisioner with ruby 3.0 + +I recently updated to Fedora 34 (which uses ruby 3.0), and `vagrant up` errors out like this: + +``` +/usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/ui.rb:230:in `say': wrong number of arguments (given 4, expected 2..3) (ArgumentError) + from (eval):3:in `detail' + from (eval):9:in `detail' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/provisioners/shell/provisioner.rb:79:in `handle_comm' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/provisioners/shell/provisioner.rb:127:in `block (3 levels) in provision_ssh' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/communicators/ssh/communicator.rb:254:in `block (2 levels) in execute' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/communicators/ssh/communicator.rb:617:in `block (3 levels) in shell_execute' + from /usr/share/gems/gems/net-ssh-6.1.0/lib/net/ssh/connection/channel.rb:598:in `do_extended_data' + from /usr/share/gems/gems/net-ssh-6.1.0/lib/net/ssh/connection/session.rb:673:in `channel_extended_data' + from /usr/share/gems/gems/net-ssh-6.1.0/lib/net/ssh/connection/session.rb:548:in `dispatch_incoming_packets' + from /usr/share/gems/gems/net-ssh-6.1.0/lib/net/ssh/connection/session.rb:248:in `ev_preprocess' + from /usr/share/gems/gems/net-ssh-6.1.0/lib/net/ssh/connection/event_loop.rb:100:in `each' + from /usr/share/gems/gems/net-ssh-6.1.0/lib/net/ssh/connection/event_loop.rb:100:in `ev_preprocess' + from /usr/share/gems/gems/net-ssh-6.1.0/lib/net/ssh/connection/event_loop.rb:28:in `process' + from /usr/share/gems/gems/net-ssh-6.1.0/lib/net/ssh/connection/session.rb:227:in `process' + from /usr/share/gems/gems/net-ssh-6.1.0/lib/net/ssh/connection/session.rb:180:in `block in loop' + from /usr/share/gems/gems/net-ssh-6.1.0/lib/net/ssh/connection/session.rb:180:in `loop' + from /usr/share/gems/gems/net-ssh-6.1.0/lib/net/ssh/connection/session.rb:180:in `loop' + from /usr/share/gems/gems/net-ssh-6.1.0/lib/net/ssh/connection/channel.rb:272:in `wait' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/communicators/ssh/communicator.rb:702:in `shell_execute' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/communicators/ssh/communicator.rb:247:in `block in execute' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/communicators/ssh/communicator.rb:391:in `connect' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/communicators/ssh/communicator.rb:240:in `execute' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/provisioners/shell/provisioner.rb:122:in `block (2 levels) in provision_ssh' + from :90:in `tap' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/provisioners/shell/provisioner.rb:96:in `block in provision_ssh' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/provisioners/shell/provisioner.rb:329:in `with_script_file' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/provisioners/shell/provisioner.rb:94:in `provision_ssh' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/plugins/provisioners/shell/provisioner.rb:33:in `provision' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/builtin/provision.rb:138:in `run_provisioner' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/warden.rb:127:in `call' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/warden.rb:127:in `block in finalize_action' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/warden.rb:48:in `call' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/builder.rb:149:in `call' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/runner.rb:89:in `block in run' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/util/busy.rb:19:in `busy' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/runner.rb:89:in `run' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/environment.rb:525:in `hook' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/builtin/provision.rb:126:in `call' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/builtin/provision.rb:126:in `block in call' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/builtin/provision.rb:103:in `each' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/builtin/provision.rb:103:in `call' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/warden.rb:48:in `call' + from /usr/share/vagrant/gems/gems/vagrant-libvirt-0.1.2/lib/vagrant-libvirt/action/create_domain.rb:363:in `call' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/warden.rb:48:in `call' + from /usr/share/vagrant/gems/gems/vagrant-libvirt-0.1.2/lib/vagrant-libvirt/action/create_domain_volume.rb:89:in `call' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/warden.rb:48:in `call' + from /usr/share/vagrant/gems/gems/vagrant-libvirt-0.1.2/lib/vagrant-libvirt/action/handle_box_image.rb:124:in `call' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/warden.rb:48:in `call' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/builtin/handle_box.rb:56:in `call' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/warden.rb:48:in `call' + from /usr/share/vagrant/gems/gems/vagrant-libvirt-0.1.2/lib/vagrant-libvirt/action/handle_storage_pool.rb:57:in `call' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/warden.rb:48:in `call' + from /usr/share/vagrant/gems/gems/vagrant-libvirt-0.1.2/lib/vagrant-libvirt/action/set_name_of_domain.rb:32:in `call' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/warden.rb:48:in `call' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/warden.rb:127:in `block in finalize_action' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/warden.rb:48:in `call' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/builder.rb:149:in `call' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/runner.rb:89:in `block in run' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/util/busy.rb:19:in `busy' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/runner.rb:89:in `run' + from /usr/share/vagrant/gems/gems/vagrant-2.2.9/lib/vagrant/action/builtin/call.rb:53:in `call' +``` + +I'm not a ruby expert but I believe it's related to [this breaking change](https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/). This change fixes it for me. +--- + plugins/provisioners/shell/provisioner.rb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/plugins/provisioners/shell/provisioner.rb b/plugins/provisioners/shell/provisioner.rb +index 08c8cf739d3..e95f176f28b 100644 +--- a/plugins/provisioners/shell/provisioner.rb ++++ b/plugins/provisioners/shell/provisioner.rb +@@ -78,7 +78,7 @@ def handle_comm(type, data) + options = {} + options[:color] = color if !config.keep_color + +- @machine.ui.detail(data.chomp, options) ++ @machine.ui.detail(data.chomp, **options) + end + end + +From c145867fdd4fb2767f73534057a7bdb9cad3468e Mon Sep 17 00:00:00 2001 +From: Pavel Valena +Date: Fri, 7 May 2021 01:52:27 +0200 +Subject: [PATCH] Fix compatibility with Ruby 3.0 + +Currently it fails with Ruby 3.0: +``` + 1) VagrantPlugins::Kernel_V2::VagrantConfigDisk#add_provider_config normalizes +provider config + Failure/Error: subject.add_provider_config(test_provider_config) + + ArgumentError: + wrong number of arguments (given 1, expected 0) + # ./plugins/kernel_v2/config/disk.rb:88:in `add_provider_config' + # ./test/unit/plugins/kernel_v2/config/disk_test.rb:122:in `block (3 levels) +in ' + # /usr/share/gems/gems/webmock-3.12.1/lib/webmock/rspec.rb:37:in `block (2 +levels) in ' +``` +--- + test/unit/plugins/kernel_v2/config/disk_test.rb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/test/unit/plugins/kernel_v2/config/disk_test.rb b/test/unit/plugins/kernel_v2/config/disk_test.rb +index b05d4f105fb..05e91ced6ed 100644 +--- a/test/unit/plugins/kernel_v2/config/disk_test.rb ++++ b/test/unit/plugins/kernel_v2/config/disk_test.rb +@@ -119,7 +119,7 @@ def assert_valid + describe "#add_provider_config" do + it "normalizes provider config" do + test_provider_config = {provider__something: "special" } +- subject.add_provider_config(test_provider_config) ++ subject.add_provider_config(**test_provider_config) + expect(subject.provider_config).to eq( { provider: {something: "special" }} ) + end + end +From bda7c07c02fafb2a3817982d827fc12d71daa817 Mon Sep 17 00:00:00 2001 +From: Pavel Valena +Date: Fri, 7 May 2021 01:49:31 +0200 +Subject: [PATCH] Remove unsused &block in add_provider_config. + +Also AFAIK this is not valid with Ruby 3.0. +--- + plugins/kernel_v2/config/disk.rb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/plugins/kernel_v2/config/disk.rb b/plugins/kernel_v2/config/disk.rb +index 0062d8d354b..bd16941ff3c 100644 +--- a/plugins/kernel_v2/config/disk.rb ++++ b/plugins/kernel_v2/config/disk.rb +@@ -85,7 +85,7 @@ def initialize(type) + # Duplicates will be overriden + # + # @param [Hash] options +- def add_provider_config(**options, &block) ++ def add_provider_config(**options) + current = {} + options.each do |k,v| + opts = k.to_s.split("__") +From 3ec791d1687903f6d7a7d837b27633559f791230 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jaime=20Caama=C3=B1o=20Ruiz?= +Date: Wed, 12 May 2021 17:01:34 +0200 +Subject: [PATCH] Additional ruby 3.0 keyword argument fixes + +--- + lib/vagrant/plugin/v2/trigger.rb | 2 +- + plugins/provisioners/container/client.rb | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/vagrant/plugin/v2/trigger.rb b/lib/vagrant/plugin/v2/trigger.rb +index 99d6ac05325..731b5854733 100644 +--- a/lib/vagrant/plugin/v2/trigger.rb ++++ b/lib/vagrant/plugin/v2/trigger.rb +@@ -271,7 +271,7 @@ def run(config, on_error, exit_codes) + options[:color] = :red if !config.keep_color + end + +- @ui.detail(data, options) ++ @ui.detail(data, **options) + end + if !exit_codes.include?(result.exit_code) + raise Errors::TriggersBadExitCodes, +diff --git a/plugins/provisioners/container/client.rb b/plugins/provisioners/container/client.rb +index 72a2d86ab44..db3e2c0ac94 100644 +--- a/plugins/provisioners/container/client.rb ++++ b/plugins/provisioners/container/client.rb +@@ -195,7 +195,7 @@ def handle_comm(type, data) + options = {} + #options[:color] = color if !config.keep_color + +- @machine.ui.info(data.chomp, options) ++ @machine.ui.info(data.chomp, **options) + end + end + end diff --git a/vagrant-2.2.9-Relax-Ruby-dependency-restriction.patch b/vagrant-2.2.9-Relax-Ruby-dependency-restriction.patch index a167e16..84a2923 100644 --- a/vagrant-2.2.9-Relax-Ruby-dependency-restriction.patch +++ b/vagrant-2.2.9-Relax-Ruby-dependency-restriction.patch @@ -1,10 +1,13 @@ +diff --git a/vagrant.gemspec b/vagrant.gemspec +index 1643681..7b87b63 100644 --- a/vagrant.gemspec +++ b/vagrant.gemspec -@@ -12,7 +12,6 @@ +@@ -12,7 +12,6 @@ Gem::Specification.new do |s| s.summary = "Build and distribute virtualized development environments." s.description = "Vagrant is a tool for building and distributing virtualized development environments." - + - s.required_ruby_version = "~> 2.5", "< 2.8" s.required_rubygems_version = ">= 1.3.6" - - s.add_dependency "bcrypt_pbkdf", "~> 1.0.0" + + s.add_dependency "bcrypt_pbkdf", "~> 1.1" + diff --git a/vagrant-2.2.9-Replace-unmaintained-Erubis-by-Erubi.patch b/vagrant-2.2.9-Replace-unmaintained-Erubis-by-Erubi.patch deleted file mode 100644 index 2303ec9..0000000 --- a/vagrant-2.2.9-Replace-unmaintained-Erubis-by-Erubi.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 09f75eb834bfefa6643a676249b48161bbcf0cad Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?V=C3=ADt=20Ondruch?= -Date: Mon, 17 Aug 2020 14:47:19 +0200 -Subject: [PATCH] Replace unmaintained Erubis by Erubi. -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Erubis is not maintained since 2011 and it has some unfixed security -issues. Erubi is used by Ruby on Rails, so it should be much better -choice. - -Signed-off-by: Vít Ondruch ---- - lib/vagrant/util/template_renderer.rb | 4 ++-- - vagrant.gemspec | 2 +- - 2 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/lib/vagrant/util/template_renderer.rb b/lib/vagrant/util/template_renderer.rb -index 8b8e730ba..eec0b2362 100644 ---- a/lib/vagrant/util/template_renderer.rb -+++ b/lib/vagrant/util/template_renderer.rb -@@ -1,7 +1,7 @@ - require 'ostruct' - require "pathname" - --require 'erubis' -+require 'erubi' - - module Vagrant - module Util -@@ -73,7 +73,7 @@ module Vagrant - # - # @return [String] - def render_string -- Erubis::Eruby.new(template, trim: true).result(binding) -+ eval(Erubi::Engine.new(template).src) - end - - # Returns the full path to the template, taking into account the gem directory -diff --git a/vagrant.gemspec b/vagrant.gemspec -index 465b12805..6f2b726fa 100644 ---- a/vagrant.gemspec -+++ b/vagrant.gemspec -@@ -18,7 +18,7 @@ Gem::Specification.new do |s| - s.add_dependency "bcrypt_pbkdf", "~> 1.0.0" - s.add_dependency "childprocess", "~> 3.0.0" - s.add_dependency "ed25519", "~> 1.2.4" -- s.add_dependency "erubis", "~> 2.7.0" -+ s.add_dependency "erubi" - s.add_dependency "i18n", "~> 1.8" - s.add_dependency "listen", "~> 3.1.5" - s.add_dependency "hashicorp-checkpoint", "~> 0.1.5" --- -2.27.0 - diff --git a/vagrant-2.2.9-Use-test-doubles-instead-of-true.patch b/vagrant-2.2.9-Use-test-doubles-instead-of-true.patch deleted file mode 100644 index a31aa27..0000000 --- a/vagrant-2.2.9-Use-test-doubles-instead-of-true.patch +++ /dev/null @@ -1,94 +0,0 @@ -From ba7ee11601b5d79278b6ca9ffe61867a21af06b9 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?V=C3=ADt=20Ondruch?= -Date: Wed, 20 Jan 2021 18:43:18 +0100 -Subject: [PATCH] Use test doubles instead of `true`. -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This solves possible issues such as: - -~~~ - 1) VagrantPlugins::DockerProvider::Provider#host_vm returns the host machine object - Failure/Error: allow(machine.env).to receive(:root_path).and_return("/.vagrant.d") - ArgumentError: - Cannot proxy frozen objects, rspec-mocks relies on proxies for method stubbing and expectations. - # ./test/unit/plugins/providers/docker/provider_test.rb:82:in `block (3 levels) in ' -~~~ - -This is not good idea, because frozen object should not receive -modifications, because these possibly can't be undone. This is -prohibited since rspec-mock 3.10.1. - -Signed-off-by: Vít Ondruch ---- - test/unit/plugins/providers/docker/provider_test.rb | 2 +- - .../plugins/provisioners/puppet/provisioner/puppet_test.rb | 4 ++-- - .../plugins/synced_folders/rsync/command/rsync_auto_test.rb | 2 +- - test/unit/vagrant/util/ssh_test.rb | 2 +- - 4 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/test/unit/plugins/providers/docker/provider_test.rb b/test/unit/plugins/providers/docker/provider_test.rb -index 3cb6e03cb..b420ba527 100644 ---- a/test/unit/plugins/providers/docker/provider_test.rb -+++ b/test/unit/plugins/providers/docker/provider_test.rb -@@ -78,7 +78,7 @@ describe VagrantPlugins::DockerProvider::Provider do - it "returns the host machine object" do - allow(machine.provider_config).to receive(:vagrant_vagrantfile).and_return("/path/to/Vagrantfile") - allow(machine.provider_config).to receive(:vagrant_machine).and_return(:default) -- allow(machine).to receive(:env).and_return(true) -+ allow(machine).to receive(:env).and_return(double()) - allow(machine.env).to receive(:root_path).and_return("/.vagrant.d") - allow(machine.env).to receive(:home_path).and_return("/path/to") - allow(machine.env).to receive(:ui_class).and_return(true) -diff --git a/test/unit/plugins/provisioners/puppet/provisioner/puppet_test.rb b/test/unit/plugins/provisioners/puppet/provisioner/puppet_test.rb -index c4ee727cc..27f5d9435 100644 ---- a/test/unit/plugins/provisioners/puppet/provisioner/puppet_test.rb -+++ b/test/unit/plugins/provisioners/puppet/provisioner/puppet_test.rb -@@ -81,7 +81,7 @@ describe VagrantPlugins::Puppet::Provisioner::Puppet do - let(:environment_paths) { ["/etc/puppet/environment"] } - - it "builds structured facts if set" do -- allow(machine).to receive(:guest).and_return(true) -+ allow(machine).to receive(:guest).and_return(double()) - allow(machine.guest).to receive(:capability?).and_return(false) - allow(config).to receive(:environment_path).and_return(environment_paths) - allow(config).to receive(:environment).and_return("production") -@@ -105,7 +105,7 @@ describe VagrantPlugins::Puppet::Provisioner::Puppet do - end - - it "does not build structured facts if not set" do -- allow(machine).to receive(:guest).and_return(true) -+ allow(machine).to receive(:guest).and_return(double()) - allow(machine.guest).to receive(:capability?).and_return(false) - allow(config).to receive(:environment_path).and_return(environment_paths) - allow(config).to receive(:environment).and_return("production") -diff --git a/test/unit/plugins/synced_folders/rsync/command/rsync_auto_test.rb b/test/unit/plugins/synced_folders/rsync/command/rsync_auto_test.rb -index 5a9c691ff..3600fbd67 100644 ---- a/test/unit/plugins/synced_folders/rsync/command/rsync_auto_test.rb -+++ b/test/unit/plugins/synced_folders/rsync/command/rsync_auto_test.rb -@@ -81,7 +81,7 @@ describe VagrantPlugins::SyncedFolderRSync::Command::RsyncAuto do - allow(machine.env).to receive(:cwd). - and_return("/Users/brian/code/vagrant-sandbox") - allow(machine.provider).to receive(:capability?).and_return(false) -- allow(machine.config).to receive(:vm).and_return(true) -+ allow(machine.config).to receive(:vm).and_return(double()) - allow(machine.config.vm).to receive(:synced_folders).and_return(config_synced_folders) - - allow(subject).to receive(:synced_folders). -diff --git a/test/unit/vagrant/util/ssh_test.rb b/test/unit/vagrant/util/ssh_test.rb -index 9f30727a0..0fc6146cf 100644 ---- a/test/unit/vagrant/util/ssh_test.rb -+++ b/test/unit/vagrant/util/ssh_test.rb -@@ -270,7 +270,7 @@ describe Vagrant::Util::SSH do - # mock out ChildProcess - process = double() - allow(ChildProcess).to receive(:build).and_return(process) -- allow(process).to receive(:io).and_return(true) -+ allow(process).to receive(:io).and_return(double()) - allow(process.io).to receive(:inherit!).and_return(true) - allow(process).to receive(:start).and_return(true) - allow(process).to receive(:wait).and_return(true) --- -2.29.2 - diff --git a/vagrant-2.2.9-do-not-load-dependencies.patch b/vagrant-2.2.9-do-not-load-dependencies.patch index 185d1a4..a659a42 100644 --- a/vagrant-2.2.9-do-not-load-dependencies.patch +++ b/vagrant-2.2.9-do-not-load-dependencies.patch @@ -3,15 +3,11 @@ From: Pavel Valena Date: Thu, 7 May 2020 22:40:54 +0200 Subject: [PATCH] Do not activate gems if gemspec is not found ---- - lib/vagrant/bundler.rb | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - diff --git a/lib/vagrant/bundler.rb b/lib/vagrant/bundler.rb -index 92ee53a..cf92ff7 100644 +index eb2caab..bd9f8a0 100644 --- a/lib/vagrant/bundler.rb +++ b/lib/vagrant/bundler.rb -@@ -622,14 +622,14 @@ module Vagrant +@@ -645,12 +645,10 @@ module Vagrant if !self_spec @logger.warn("Failed to locate activated vagrant specification. Activating...") self_spec = Gem::Specification.find { |s| s.name == "vagrant" } @@ -24,12 +20,5 @@ index 92ee53a..cf92ff7 100644 @logger.info("Activated vagrant specification version - #{self_spec.version}") + end end -+ if self_spec - self_spec.runtime_dependencies.each { |d| gem d.name, *d.requirement.as_list } -+ end # discover all the gems we have available list = {} - directories = [Gem::Specification.default_specifications_dir] --- -2.25.0 - diff --git a/vagrant.spec b/vagrant.spec index 2eb7e48..044c308 100644 --- a/vagrant.spec +++ b/vagrant.spec @@ -1,22 +1,23 @@ %global bashcompletion_dir %(pkg-config --variable=completionsdir bash-completion 2> /dev/null || :) -%global vagrant_spec_commit abfc34474d122235d56e4c6b6fb5d3e35bedfa90 +%global vagrant_spec_commit 9057cd6e0ac299688da608d459deac66bfad8880 %bcond_without help2man +%bcond_with ed25519 Name: vagrant -Version: 2.2.9 -Release: 6%{?dist} +Version: 2.2.16 +Release: 1%{?dist} Summary: Build and distribute virtualized development environments License: MIT URL: http://vagrantup.com -Source0: https://github.com/mitchellh/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz +Source0: https://github.com/hashicorp/%{name}/archive/refs/tags/v%{version}.tar.gz # Upstream binstub with adjusted paths, the offical way how to run vagrant Source1: binstub # The library has no official release yet. But since it is just test # dependency, it should be fine to include the source right here. -# wget https://github.com/mitchellh/vagrant-spec/archive/abfc34474d122235d56e4c6b6fb5d3e35bedfa90/vagrant-spec-abfc34474d122235d56e4c6b6fb5d3e35bedfa90.tar.gz -Source2: https://github.com/mitchellh/%{name}-spec/archive/%{vagrant_spec_commit}/%{name}-spec-%{vagrant_spec_commit}.tar.gz +# wget https://github.com/mitchellh/vagrant-spec/archive/9057cd6e0ac299688da608d459deac66bfad8880/vagrant-spec-9057cd6e0ac299688da608d459deac66bfad8880.tar.gz +Source2: https://github.com/vagrant/%{name}-spec/archive/%{vagrant_spec_commit}/%{name}-spec-%{vagrant_spec_commit}.tar.gz # Monkey-patching needed for Vagrant to work until the respective patches # for RubyGems and Bundler are in place Source4: macros.vagrant @@ -27,19 +28,16 @@ Patch0: vagrant-2.2.3-Fix-fake_ftp-0.3.x-compatibility.patch # Do not load runtime dependencies in %%check if vagrant is not loaded # https://github.com/hashicorp/vagrant/pull/10945 Patch1: vagrant-2.2.9-do-not-load-dependencies.patch -# Use Erubi instead of Erubis. -# https://github.com/hashicorp/vagrant/pull/11829 -Patch2: vagrant-2.2.9-Replace-unmaintained-Erubis-by-Erubi.patch -# Fix Ruby 3.0 compatibility. -# https://github.com/hashicorp/vagrant/pull/11814 -Patch3: vagrant-2.2.10-Updates-to-address-all-Ruby-deprecations-and-warnings.patch -# Fix rspec-mocks 3.10.1+ compatibility. -# https://github.com/hashicorp/vagrant/pull/12145 -Patch4: vagrant-2.2.9-Use-test-doubles-instead-of-true.patch # Relax Ruby version restriction (use patch to make sure we don't regress # if upstream fixes this. # https://bugzilla.redhat.com/show_bug.cgi?id=1915671 Patch5: vagrant-2.2.9-Relax-Ruby-dependency-restriction.patch +# Fix shell provisioner compatibility with ruby 3.0 +# https://github.com/hashicorp/vagrant/pull/12273 +# https://github.com/hashicorp/vagrant/pull/12353 +# https://github.com/hashicorp/vagrant/pull/12352 +# https://github.com/jcaamano/vagrant/commit/3ec791d1687903f6d7a7d837b27633559f791230 +Patch6: vagrant-2.2.16-fix-compatibility-with-ruby-3.0.patch # The load directive is supported since RPM 4.12, i.e. F21+. The build process # fails on older Fedoras. @@ -66,9 +64,15 @@ Requires: curl Recommends: vagrant(vagrant-libvirt) Recommends: rubygem(bcrypt_pbkdf) -Recommends: rubygem(ed25519) Recommends: (podman-docker if podman) +%if %{with ed25519} +Requires: rubygem(ed25519) +BuildRequires: rubygem(ed25519) +%else +Recommends: rubygem(ed25519) +%endif + BuildRequires: bsdtar BuildRequires: ruby BuildRequires: rubygems-devel @@ -123,10 +127,8 @@ Documentation for %{name}. %setup -q -b2 %patch0 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 %patch5 -p1 +%patch6 -p1 # TODO: package vagrant_cloud, as it is not in Fedora yet %gemspec_remove_dep -s %{name}.gemspec -g vagrant_cloud @@ -141,6 +143,10 @@ sed -i '/^\s*command(:login) do$/,/\s*end$/ s/^/#/g' plugins/commands/login/plug %gemspec_remove_dep -s %{name}.gemspec -g net-scp '~> 1.2.0' %gemspec_add_dep -s %{name}.gemspec -g net-scp '>= 1.2.0' +# We have older version in Fedora +%gemspec_remove_dep -s %{name}.gemspec -g net-sftp '~> 3.0' +%gemspec_add_dep -s %{name}.gemspec -g net-sftp '>= 2.1.2' + # Remove Windows specific dependencies %gemspec_remove_dep -s %{name}.gemspec -g wdm %gemspec_remove_dep -s %{name}.gemspec -g winrm @@ -150,27 +156,11 @@ sed -i '/^\s*command(:login) do$/,/\s*end$/ s/^/#/g' plugins/commands/login/plug # Remove BSD dependency %gemspec_remove_dep -s %{name}.gemspec -g rb-kqueue -# Do not impose any Ruby version restrictions on Fedora. -%gemspec_remove_dep -s %{name}.gemspec -g ruby_dep - -# Allow newer listen version -# https://github.com/hashicorp/vagrant/pull/11208 -%gemspec_remove_dep -s %{name}.gemspec -g listen '~> 3.1.5' -%gemspec_add_dep -s %{name}.gemspec -g listen '>= 3.1.5' - # Allow older childprocess version %gemspec_remove_dep -s %{name}.gemspec -g childprocess %gemspec_add_dep -s %{name}.gemspec -g childprocess '>= 1.0.1' -# Relax net-ssh dependency. This helps with update of net-ssh coming in with -# Vagrant 2.2.10+: -# https://github.com/hashicorp/vagrant/commit/af3053bbdfee45d1dffbb293241364fd0159ce79 -# https://github.com/hashicorp/vagrant/commit/b8e14604494f7648c17b7b42c7a469700fc1b4e3 -%gemspec_remove_dep -s %{name}.gemspec -g net-ssh '~> 5.2.0' -%gemspec_add_dep -s %{name}.gemspec -g net-ssh ['>= 5.2.0', '< 7'] - # Remove optional dependencies -%gemspec_remove_dep -s %{name}.gemspec -g ed25519 %gemspec_remove_dep -s %{name}.gemspec -g bcrypt_pbkdf # Load missing dependency Vagrant::Util::MapCommandOptions @@ -178,6 +168,17 @@ sed -i '/^\s*command(:login) do$/,/\s*end$/ s/^/#/g' plugins/commands/login/plug sed -i '/^\s*require..vagrant.util.experimental.\s*$/ a\require "vagrant/util/map_command_options"' \ plugins/kernel_v2/config/vm.rb +# Apply net-ssh patches apply regardless of net-ssh version +sed -i 's/^if Net::SSH::Version::STRING.*$/if true/' \ + lib/vagrant/patches/net-ssh.rb + +%if %{without ed25519} +%gemspec_remove_dep -s %{name}.gemspec -g ed25519 +# Disable patch for ed25519 +sed -i '/^ require .net\/ssh\/authentication\/ed25519.$/,/^ end$/ s/^/#/' \ + lib/vagrant/patches/net-ssh.rb +%endif + %build gem build %{name}.gemspec @@ -275,7 +276,7 @@ mv test/unit/vagrant/util/env_test.rb{,.disable} # vagrant_cloud is not in Fedora yet; login command is deprecated # in favor of vagrant_cloud -rm -r test/unit/plugins/commands/{cloud,login}/ +rm -r test/unit/plugins/commands/cloud/ # fake_ftp 0.3.0 compatibility. # https://github.com/livinginthepast/fake_ftp/pull/56 @@ -301,6 +302,16 @@ rm -rf test/unit/plugins/hosts/bsd sed -i '/^\s*it "installs docker if not present" do$/ a\ skip "GH#11606"' \ test/unit/plugins/provisioners/docker/installer_test.rb +# Disable tests failing on class variable access from toplevel +# > Failure/Error: @@logger = nil +# https://github.com/hashicorp/vagrant/issues/12362 +mv test/unit/plugins/synced_folders/unix_mount_helpers_test.rb{,.disable} + +# Disable currently broken powershell tests, due to: +# https://github.com/hashicorp/vagrant/commit/5967a23fa097e89726d335dcf781ae43cb256bc1# +# https://github.com/hashicorp/vagrant/issues/12363 +mv test/unit/vagrant/util/powershell_test.rb{,.disable} + # Export the OS as an environment variable that Vagrant can access, so the # test suite is executed with same host it will be run (also avoids docker # installer_test issue). @@ -445,6 +456,10 @@ end %{vagrant_plugin_instdir}/vagrant-spec.config.example.rb %changelog +* Fri Apr 16 2021 Pavel Valena - 2.2.16-1 +- Update to Vagrant 2.2.16. + Resolves: rhbz#1872307 + * Wed Jan 27 2021 Fedora Release Engineering - 2.2.9-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild