Merge ~lucaskanashiro/ubuntu/+source/vagrant:fix-warnings into ubuntu/+source/vagrant:ubuntu/devel

Proposed by Lucas Kanashiro
Status: Approved
Approved by: Bryce Harrington
Approved revision: acb8efc681566a2d5dcda417bc8c8172a1b77e7b
Proposed branch: ~lucaskanashiro/ubuntu/+source/vagrant:fix-warnings
Merge into: ubuntu/+source/vagrant:ubuntu/devel
Diff against target: 395 lines (+367/-0)
4 files modified
debian/changelog (+10/-0)
debian/patches/0008-Fix-warnings-for-ruby-2.7.patch (+113/-0)
debian/patches/0009-Fix-more-warnings-under-ruby-2.7.patch (+242/-0)
debian/patches/series (+2/-0)
Reviewer Review Type Date Requested Status
Bryce Harrington (community) Approve
Canonical Server MOTU reviewers Pending
Review via email: mp+382953@code.launchpad.net

Description of the change

Some users have been complaining after Focal release about some ruby 2.7 warnings popping up when vagrant is called via CLI. Debian is ahead of us and the newer version has two patches to fixes those warnings:

https://salsa.debian.org/ruby-team/vagrant/-/commit/a6b02fee0b8092b71451e7be74bdefae345564db

https://salsa.debian.org/ruby-team/vagrant/-/commit/a92beb24687dac86ed22e299a10df39a27ade303

Those patches are applied on top of version 2.2.7 in Debian, I backported them to version 2.2.6 (the version we have in Focal).

Here is a PPA with the proposed changes:

https://launchpad.net/~lucaskanashiro/+archive/ubuntu/focal-vagrant-sru/+packages

autopkgtest is also happy with them:

autopkgtest [17:33:41]: @@@@@@@@@@@@@@@@@@@@ summary
smoke-test PASS
gem2deb-test-runner SKIP exit status 77 and marked as skippable

To post a comment you must log in.
Revision history for this message
Bryce Harrington (bryce) wrote :

Since focal is out, if you want to add them via SRU you'll also need a bug report with the SRU template filled out in its description. Warning fixes can be hard to justify as impactful, however likely you can re-use the arguments provided by the users requesting the change. IOW, what about the warnings is bothering them?

(Fwiw, I despise warnings myself, when they don't flag actual problems that need dealt with. So kudos for tackling them.)

The patches also need origin and perhaps other DEP3 metadata included.

This is more personal style, but I would also suggest describing them more specific than "warnings fixes" and "more warnings fixes". I generally also like to make each patch address a particular class of warning, and say what's being done to inhibit them.

review: Needs Fixing
Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

I have a bug report with the SRU here:

https://bugs.launchpad.net/ubuntu/+source/vagrant/+bug/1871685

And about the patches, I simply backported them using the same name, description and so on. But I can improve them.

Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Bryce, I added some DEP-3 headers to the patches and also added more context for the changes in the changelog. It is up for review again.

Revision history for this message
Bryce Harrington (bryce) wrote :

Yes, this looks better. +1 LGTM.

I've also reproduced the test case in lxc, manually verified the fix from the ppa, and ran the autopkgtest.

Do you need sponsorship for this?

review: Approve
Revision history for this message
Bryce Harrington (bryce) wrote :

A few bits of advice on SRUs (nothing needing changed for this one, but to keep in mind next time):

With the Potential Regression section, one thing I try to do beyond just describing the *likelihood* of a regression, is to think about what a regression would look like. Because, of course the potential should always be Low - if it were high you obviously wouldn't consider SRUing the bug. But a more realistic scenario is that someone updates to your fix, and something completely unrelated breaks, and they wonder if your fix caused their break. By describing what a regression would look like, you can give bug reporters and triagers some clue that actually no, their problem is unlikely to be Lucas' fault, go look elsewhere. ;-)

I've also found by thinking from this direction once and a while I realize there was some angle to the bug I didn't adequately cover, and thus ended up with a better fix overall. So it's a good practice. I think Martin Pitt taught me this way back when.

Also, in test cases, I like to also include directions to install the fixed version, and then show what the output is in that case, for comparison. For this bug the test case is simple enough that's not important. One thing I might do is to trim the usage output, since its text is unnecessary for validating the bug, e.g.:

# Broken behavior:
$ apt install vagrant
$ vagrant --help > /dev/null
NOTE: Gem::Specification.default_specifications_dir is deprecated; use Gem.default_specifications_dir instead. It will be removed on or after 2020-02-01.
Gem::Specification.default_specifications_dir called from /usr/share/rubygems-integration/all/gems/vagrant-2.2.6/lib/vagrant/bundler.rb:428.
/usr/share/rubygems-integration/all/gems/vagrant-2.2.6/lib/vagrant/errors.rb:103: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/usr/share/rubygems-integration/all/gems/i18n-1.8.2/lib/i18n.rb:195: warning: The called method `t' is defined here
(eval):3: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/usr/share/rubygems-integration/all/gems/vagrant-2.2.6/lib/vagrant/ui.rb:223: warning: The called method `say' is defined here
$

# Install fixed version
$ sudo add-apt-repository -yus ppa:lucaskanashiro/focal-vagrant-sru
$ sudo apt install kafka
[...]

# Fixed behavior
$ vagrant --help > /dev/null
$

My rationale for being a bit pedagogic with the test case is because the more "paint by numbers" it is, and easier it is to use, the more likely someone else will bother spending time validating the fix, and the more smoothly and swiftly it'll go through the SRU process. It also can help future bug reporters and triagers to quickly check that their unrelated issue is not caused by this fix.

Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

> Yes, this looks better. +1 LGTM.

\o/

> I've also reproduced the test case in lxc, manually verified the fix from the
> ppa, and ran the autopkgtest.
>
> Do you need sponsorship for this?

Thanks Bryce! Yes, I still need sponsorship.

Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

> A few bits of advice on SRUs (nothing needing changed for this one, but to
> keep in mind next time):
>
> With the Potential Regression section, one thing I try to do beyond just
> describing the *likelihood* of a regression, is to think about what a
> regression would look like. Because, of course the potential should always be
> Low - if it were high you obviously wouldn't consider SRUing the bug. But a
> more realistic scenario is that someone updates to your fix, and something
> completely unrelated breaks, and they wonder if your fix caused their break.
> By describing what a regression would look like, you can give bug reporters
> and triagers some clue that actually no, their problem is unlikely to be
> Lucas' fault, go look elsewhere. ;-)

I see your point and it makes sense. I've checked SRUs proposed by other people but apparently some people write this section with a different perspective. Anyway, it is a good advice, thanks!

> Also, in test cases, I like to also include directions to install the fixed
> version, and then show what the output is in that case, for comparison. For
> this bug the test case is simple enough that's not important. One thing I
> might do is to trim the usage output, since its text is unnecessary for
> validating the bug, e.g.:

You are right, it'd make the warning more clear in this case.

Revision history for this message
Bryce Harrington (bryce) wrote :

Upload sponsored:

~/ubuntu/Vagrant/vagrant-gu$ gpg --verify ../vagrant*source.changes
gpg: Signature made Tue 28 Apr 2020 11:23:20 AM PDT
gpg: using RSA key A661100B3DAC1D4F2CAD8A54E603B2578FB8F0FB
gpg: Good signature from "Bryce Harrington <email address hidden>" [ultimate]
gpg: aka "Bryce Harrington <email address hidden>" [ultimate]
gpg: aka "Bryce Harrington <email address hidden>" [ultimate]
~/ubuntu/Vagrant/vagrant-gu$ git ubuntu tag --upload
~/ubuntu/Vagrant/vagrant-gu$ git push pkg upload/2.2.6+dfsg-2ubuntu2
Enumerating objects: 17, done.
Counting objects: 100% (17/17), done.
Delta compression using up to 12 threads
Compressing objects: 100% (12/12), done.
Writing objects: 100% (12/12), 6.13 KiB | 627.00 KiB/s, done.
Total 12 (delta 7), reused 0 (delta 0)
dput ubuntu ../To ssh://git.launchpad.net/~usd-import-team/ubuntu/+source/vagrant
 * [new tag] upload/2.2.6+dfsg-2ubuntu2 -> upload/2.2.6+dfsg-2ubuntu2
~/ubuntu/Vagrant/vagrant-gu$ dput ubuntu ../
vagrant_2.2.6+dfsg-2ubuntu2_all.deb vagrant_2.2.6+dfsg-2ubuntu2_source.buildinfo
vagrant_2.2.6+dfsg-2ubuntu2_amd64.buildinfo vagrant_2.2.6+dfsg-2ubuntu2_source.changes
vagrant_2.2.6+dfsg-2ubuntu2_amd64.changes vagrant_2.2.6+dfsg.orig.tar.xz
vagrant_2.2.6+dfsg-2ubuntu2.debian.tar.xz vagrant-gu/
vagrant_2.2.6+dfsg-2ubuntu2.dsc
~/ubuntu/Vagrant/vagrant-gu$ dput ubuntu ../vagrant*_source.changes
Checking signature on .changes
gpg: ../vagrant_2.2.6+dfsg-2ubuntu2_source.changes: Valid signature from E603B2578FB8F0FB
Checking signature on .dsc
gpg: ../vagrant_2.2.6+dfsg-2ubuntu2.dsc: Valid signature from E603B2578FB8F0FB
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading vagrant_2.2.6+dfsg-2ubuntu2.dsc: done.
  Uploading vagrant_2.2.6+dfsg-2ubuntu2.debian.tar.xz: done.
  Uploading vagrant_2.2.6+dfsg-2ubuntu2_source.buildinfo: done.
  Uploading vagrant_2.2.6+dfsg-2ubuntu2_source.changes: done.
Successfully uploaded packages.

Unmerged commits

acb8efc... by Lucas Kanashiro

Update changelog

e35c678... by Lucas Kanashiro

Backport two patches from Debian to fix Ruby 2.7 warnings (LP: #1871685)

043058d... by Dave Chiluk

Import patches-unapplied version 2.2.6+dfsg-2ubuntu1 to ubuntu/focal-proposed

Imported using git-ubuntu import.

Changelog parent: 1a3aac7cb40dbac55bce833504050520d7078fd4

New changelog entries:
  * Merge from Debian unstable. Remaining changes:
    - Drop integration-test autopkgtest as it depends on access to the Debian
      archive.

1a3aac7... by Antonio Terceiro

Import patches-unapplied version 2.2.6+dfsg-2 to debian/sid

Imported using git-ubuntu import.

Changelog parent: 11cf3b9efada6e0b81e7ba2bd0ca3f5527bae437

New changelog entries:
  [ Utkarsh Gupta ]
  * Add salsa-ci.yml
  [ Antonio Terceiro ]
  * Add patch to avoid /etc/exports growing forever
  * Add patch for VirtualBox 6.1 support (Closes: #946837)
  * Add Breaks: on unsupported VirtualBox versions (Closes: #946838)

11cf3b9... by Antonio Terceiro

Import patches-unapplied version 2.2.6+dfsg-1 to debian/sid

Imported using git-ubuntu import.

Changelog parent: 884d2431d34b9deec7b9831cb963c005e1e1cd2c

New changelog entries:
  * New upstream version 2.2.6+dfsg
  * Refresh patches
  * Bump dependency on ruby-vagrant-cloud to >= 2.0.3
  * autopkgtest: don't try running a box under /tmp
  * Bump Standards-Version to 4.4.1; no changes needed
  * autopkgtest: drop obsolete resstriction needs-recommends
  * debian/rules: drop README.md files outside of doc dirs
  * autopkgtest smoke-test: use vagrant-libvirt

884d243... by Antonio Terceiro

Import patches-unapplied version 2.2.3+dfsg-1 to debian/sid

Imported using git-ubuntu import.

Changelog parent: 089f6616b2f23c44801d3bc284c5d9d68ef4c1cb

New changelog entries:
  * New upstream version 2.2.3+dfsg
    - adds support for Virtualbox 6 (Closes: #921036)
  * Rebase patches
  * Update packaging with new run of dh-make-ruby
    - Bump debhelper compat to 11
    - Update dependencies
    - Bump Standards-Version to 4.3.0, no changes needed otherwise
    - Update Homepage: to an https:// URL
    - Add Rules-Require-Root: no
    - wrap-and-sort

089f661... by Antonio Terceiro

Import patches-unapplied version 2.1.5+dfsg-1 to debian/sid

Imported using git-ubuntu import.

Changelog parent: 03781bdd012f14bc4bd51768128c4abfef0dec16

New changelog entries:
  [ Antonio Terceiro ]
  * New upstream release
  * Refresh patches
  * Add missing dependency on rsync (Closes: #896660)
  * Bump dependency on ruby-net-ssh to >= 1:5, as vagrant now uses features
    that are not present before that version.
  [ Jelmer Vernooij ]
  * Use secure copyright file specification URI.

03781bd... by Antonio Terceiro

Import patches-unapplied version 2.1.2+dfsg-1 to debian/sid

Imported using git-ubuntu import.

Changelog parent: f1fa29fd49e3031165589ef147a5418720f00e7d

New changelog entries:
  * New upstream version 2.1.2+dfsg (Closes: #906444)
  * Refresh patches
  * debian/{copyright, control}: point to https://github.com/hashicorp
  * Change dependency from bsdtar to libarchive-tools (Closes: #900489)
  * Bump Standards-Version to 4.2.0; no changes needed

f1fa29f... by Antonio Terceiro

Import patches-unapplied version 2.0.2+dfsg-3 to debian/sid

Imported using git-ubuntu import.

Changelog parent: fcc6165ff259c7d28a2833d2e76ac70ded7dd49b

New changelog entries:
  * Specify minimal version of ruby-net-ssh required (Closes: #890662)

fcc6165... by Antonio Terceiro

Import patches-unapplied version 2.0.2+dfsg-2 to debian/sid

Imported using git-ubuntu import.

Changelog parent: 8f29bef47759c7eaad93809ecf5a2d484324e874

New changelog entries:
  * New upstream release.
    - Removes usage of setting name deprecated by ruby-net-ssh (Closes: #884104)
  * debian/tests/integration-test: make sure box pulled for testing is a
    Debian one to avoid failures on non-Debian hosts (Closes: #889174)
  * Refresh patches:
    - 0001-Disable-Checkpoint.patch: removed as checkpoint integration was
      dropped upstream
    - 0007-Virtualbox-5.2-support.patch: removed, applied upstream
    - Renumbered remaining patches
  * Bump Standards-Version to 4.1.3; no changes needed
  * Change Maintainer to the Debian Ruby Team
  * Point Vcs-* to salsa.debian.org
  * debian/rules: check dependencies during the build
    - added dependencies as build dependencies
  * debian/vagrant.lintian-overrides: override warning about shebang in
    upstream bash completion file

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 6b96337..a3b49f3 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,13 @@
6+vagrant (2.2.6+dfsg-2ubuntu2) focal; urgency=medium
7+
8+ * Backport two patches from Debian to fix Ruby 2.7 warnings (LP: #1871685).
9+ - d/p/0008-Fix-warnings-for-ruby-2.7.patch: correctly escape strings while
10+ building URIs, and accept Ruby 2.7 as a required ruby version.
11+ - d/p/0009-Fix-more-warnings-under-ruby-2.7.patch: warnings about using
12+ the last argument of a method call as keyword parameters were fixed.
13+
14+ -- Lucas Kanashiro <lucas.kanashiro@canonical.com> Fri, 24 Apr 2020 17:06:54 -0300
15+
16 vagrant (2.2.6+dfsg-2ubuntu1) focal; urgency=low
17
18 * Merge from Debian unstable. Remaining changes:
19diff --git a/debian/patches/0008-Fix-warnings-for-ruby-2.7.patch b/debian/patches/0008-Fix-warnings-for-ruby-2.7.patch
20new file mode 100644
21index 0000000..1f436a1
22--- /dev/null
23+++ b/debian/patches/0008-Fix-warnings-for-ruby-2.7.patch
24@@ -0,0 +1,113 @@
25+From: Lucas Kanashiro <lucas.kanashiro@canonical.com>
26+Date: Fri, 24 Apr 2020 17:04:13 -0300
27+Subject: Fix warnings for ruby 2.7
28+
29+* Use CGI instead of URI to escape strings while building urls
30+* Set the right gemspec directory depending on the Ruby version
31+* Accept Ruby 2.7 in the required_ruby_version in gemspec
32+
33+Origin: https://salsa.debian.org/ruby-team/vagrant/-/commit/a6b02fee0b8092b71451e7be74bdefae345564db
34+Forwarded: https://github.com/hashicorp/vagrant/pull/11437
35+Bug-Ubuntu: #1871685
36+Reviewed-by: Lucas Kanashiro <lucas.kanashiro@canonical.com>
37+Last-Updated 2020-04-27
38+---
39+ lib/vagrant/action/builtin/box_add.rb | 9 +++++----
40+ lib/vagrant/bundler.rb | 6 +++++-
41+ lib/vagrant/util/downloader.rb | 5 +++--
42+ vagrant.gemspec | 2 +-
43+ 4 files changed, 14 insertions(+), 8 deletions(-)
44+
45+diff --git a/lib/vagrant/action/builtin/box_add.rb b/lib/vagrant/action/builtin/box_add.rb
46+index 60ac6d5..45e8d2e 100644
47+--- a/lib/vagrant/action/builtin/box_add.rb
48++++ b/lib/vagrant/action/builtin/box_add.rb
49+@@ -2,6 +2,7 @@ require "digest/sha1"
50+ require "log4r"
51+ require "pathname"
52+ require "uri"
53++require "cgi"
54+
55+ require "vagrant/box_metadata"
56+ require "vagrant/util/downloader"
57+@@ -44,7 +45,7 @@ module Vagrant
58+ u = u.gsub("\\", "/")
59+ if Util::Platform.windows? && u =~ /^[a-z]:/i
60+ # On Windows, we need to be careful about drive letters
61+- u = "file:///#{URI.escape(u)}"
62++ u = "file:///#{CGI::escape(u)}"
63+ end
64+
65+ if u =~ /^[a-z0-9]+:.*$/i && !u.start_with?("file://")
66+@@ -53,9 +54,9 @@ module Vagrant
67+ end
68+
69+ # Expand the path and try to use that, if possible
70+- p = File.expand_path(URI.unescape(u.gsub(/^file:\/\//, "")))
71++ p = File.expand_path(CGI::unescape(u.gsub(/^file:\/\//, "")))
72+ p = Util::Platform.cygwin_windows_path(p)
73+- next "file://#{URI.escape(p.gsub("\\", "/"))}" if File.file?(p)
74++ next "file://#{p.gsub("\\", "/")}" if File.file?(p)
75+
76+ u
77+ end
78+@@ -488,7 +489,7 @@ module Vagrant
79+ url ||= uri.opaque
80+ #7570 Strip leading slash left in front of drive letter by uri.path
81+ Util::Platform.windows? && url.gsub!(/^\/([a-zA-Z]:)/, '\1')
82+- url = URI.unescape(url)
83++ url = CGI::unescape(url)
84+
85+ begin
86+ File.open(url, "r") do |f|
87+diff --git a/lib/vagrant/bundler.rb b/lib/vagrant/bundler.rb
88+index 7ba4843..739ebab 100644
89+--- a/lib/vagrant/bundler.rb
90++++ b/lib/vagrant/bundler.rb
91+@@ -425,7 +425,11 @@ module Vagrant
92+ runtime_dependencies.each { |d| gem d.name, *d.requirement.as_list }
93+ # discover all the gems we have available
94+ list = {}
95+- directories = [Gem::Specification.default_specifications_dir]
96++ if(Gem::Version.create(RUBY_VERSION) >= Gem::Version.create("2.7"))
97++ directories = [Gem.default_specifications_dir]
98++ else
99++ directories = [Gem::Specification.default_specifications_dir]
100++ end
101+ Gem::Specification.find_all{true}.each do |spec|
102+ list[spec.full_name] = spec
103+ end
104+diff --git a/lib/vagrant/util/downloader.rb b/lib/vagrant/util/downloader.rb
105+index 71c0676..5c46d2c 100644
106+--- a/lib/vagrant/util/downloader.rb
107++++ b/lib/vagrant/util/downloader.rb
108+@@ -1,4 +1,5 @@
109+ require "uri"
110++require "cgi"
111+
112+ require "log4r"
113+ require "digest"
114+@@ -41,8 +42,8 @@ module Vagrant
115+ begin
116+ url = URI.parse(@source)
117+ if url.scheme && url.scheme.start_with?("http") && url.user
118+- auth = "#{URI.unescape(url.user)}"
119+- auth += ":#{URI.unescape(url.password)}" if url.password
120++ auth = "#{CGI::unescape(url.user)}"
121++ auth += ":#{CGI::unescape(url.password)}" if url.password
122+ url.user = nil
123+ url.password = nil
124+ options[:auth] ||= auth
125+diff --git a/vagrant.gemspec b/vagrant.gemspec
126+index 55730e5..76380ed 100644
127+--- a/vagrant.gemspec
128++++ b/vagrant.gemspec
129+@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
130+ s.summary = "Build and distribute virtualized development environments."
131+ s.description = "Vagrant is a tool for building and distributing virtualized development environments."
132+
133+- s.required_ruby_version = "~> 2.4", "< 2.7"
134++ s.required_ruby_version = "~> 2.4"
135+ s.required_rubygems_version = ">= 1.3.6"
136+ s.rubyforge_project = "vagrant"
137+
138diff --git a/debian/patches/0009-Fix-more-warnings-under-ruby-2.7.patch b/debian/patches/0009-Fix-more-warnings-under-ruby-2.7.patch
139new file mode 100644
140index 0000000..cb19ddb
141--- /dev/null
142+++ b/debian/patches/0009-Fix-more-warnings-under-ruby-2.7.patch
143@@ -0,0 +1,242 @@
144+From: Lucas Kanashiro <lucas.kanashiro@canonical.com>
145+Date: Fri, 24 Apr 2020 16:59:24 -0300
146+Subject: Fix more warnings under ruby 2.7
147+
148+Fixed a bunch of warnings of this type:
149+
150+Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
151+
152+More info about this warning here:
153+
154+https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/
155+
156+Origin: https://salsa.debian.org/ruby-team/vagrant/-/commit/a92beb24687dac86ed22e299a10df39a27ade303
157+Forwarded: https://github.com/hashicorp/vagrant/pull/11459
158+Bug-Ubuntu: #1871685
159+Reviewed-by: Lucas Kanashiro <lucas.kanashiro@canonical.com>
160+Last-Updated: 2020-04-27
161+---
162+ lib/vagrant/box.rb | 2 +-
163+ lib/vagrant/errors.rb | 2 +-
164+ lib/vagrant/ui.rb | 10 +++++-----
165+ plugins/kernel_v2/config/vm.rb | 2 +-
166+ test/unit/plugins/providers/docker/driver_compose_test.rb | 11 ++++++++---
167+ test/unit/plugins/providers/virtualbox/action/network_test.rb | 8 ++++----
168+ test/unit/vagrant/action/builtin/mixin_synced_folders_test.rb | 10 +++++-----
169+ test/unit/vagrant/plugin/manager_test.rb | 4 ++--
170+ 8 files changed, 27 insertions(+), 22 deletions(-)
171+
172+diff --git a/lib/vagrant/box.rb b/lib/vagrant/box.rb
173+index af35043..f0e705f 100644
174+--- a/lib/vagrant/box.rb
175++++ b/lib/vagrant/box.rb
176+@@ -166,7 +166,7 @@ module Vagrant
177+ version += ", " if version
178+ version ||= ""
179+ version += "> #{@version}"
180+- md = self.load_metadata(download_options)
181++ md = self.load_metadata(**download_options)
182+ newer = md.version(version, provider: @provider)
183+ return nil if !newer
184+
185+diff --git a/lib/vagrant/errors.rb b/lib/vagrant/errors.rb
186+index 44bed4d..4857e03 100644
187+--- a/lib/vagrant/errors.rb
188++++ b/lib/vagrant/errors.rb
189+@@ -100,7 +100,7 @@ module Vagrant
190+
191+ def translate_error(opts)
192+ return nil if !opts[:_key]
193+- I18n.t("#{opts[:_namespace]}.#{opts[:_key]}", opts)
194++ I18n.t("#{opts[:_namespace]}.#{opts[:_key]}", **opts)
195+ end
196+ end
197+
198+diff --git a/lib/vagrant/ui.rb b/lib/vagrant/ui.rb
199+index 70474d1..70a6c78 100644
200+--- a/lib/vagrant/ui.rb
201++++ b/lib/vagrant/ui.rb
202+@@ -148,9 +148,9 @@ module Vagrant
203+ # to `say`.
204+ [:detail, :info, :warn, :error, :output, :success].each do |method|
205+ class_eval <<-CODE
206+- def #{method}(message, *args)
207++ def #{method}(message, **args)
208+ super(message)
209+- say(#{method.inspect}, message, *args)
210++ say(#{method.inspect}, message, **args)
211+ end
212+ CODE
213+ end
214+@@ -168,7 +168,7 @@ module Vagrant
215+ opts[:prefix] = false if !opts.key?(:prefix)
216+
217+ # Output the data
218+- say(:info, message, opts)
219++ say(:info, message, **opts)
220+
221+ input = nil
222+ if opts[:echo] || !@stdin.respond_to?(:noecho)
223+@@ -179,10 +179,10 @@ module Vagrant
224+
225+ # Output a newline because without echo, the newline isn't
226+ # echoed either.
227+- say(:info, "\n", opts)
228++ say(:info, "\n", **opts)
229+ rescue Errno::EBADF
230+ # This means that stdin doesn't support echoless input.
231+- say(:info, "\n#{I18n.t("vagrant.stdin_cant_hide_input")}\n ", opts)
232++ say(:info, "\n#{I18n.t("vagrant.stdin_cant_hide_input")}\n ", **opts)
233+
234+ # Ask again, with echo enabled
235+ input = ask(message, opts.merge(echo: true))
236+diff --git a/plugins/kernel_v2/config/vm.rb b/plugins/kernel_v2/config/vm.rb
237+index 6339d3e..559f765 100644
238+--- a/plugins/kernel_v2/config/vm.rb
239++++ b/plugins/kernel_v2/config/vm.rb
240+@@ -351,7 +351,7 @@ module VagrantPlugins
241+ prov.preserve_order = !!options.delete(:preserve_order) if \
242+ options.key?(:preserve_order)
243+ prov.run = options.delete(:run) if options.key?(:run)
244+- prov.add_config(options, &block)
245++ prov.add_config(**options, &block)
246+ nil
247+ end
248+
249+diff --git a/test/unit/plugins/providers/docker/driver_compose_test.rb b/test/unit/plugins/providers/docker/driver_compose_test.rb
250+index 9606de5..374593e 100644
251+--- a/test/unit/plugins/providers/docker/driver_compose_test.rb
252++++ b/test/unit/plugins/providers/docker/driver_compose_test.rb
253+@@ -30,9 +30,14 @@ describe VagrantPlugins::DockerProvider::Driver::Compose do
254+ delete: true
255+ )
256+ end
257++
258++ def empty_opts
259++ Gem::Version.create(RUBY_VERSION) >= Gem::Version.create("2.7") ? [] : [{}]
260++ end
261++
262+ let(:data_directory){ double("data-directory", join: composition_path) }
263+ let(:local_data_path){ double("local-data-path") }
264+- let(:compose_execute_up){ ["docker-compose", "-f", "docker-compose.yml", "-p", "cwd", "up", "--remove-orphans", "-d", {}] }
265++ let(:compose_execute_up){ ["docker-compose", "-f", "docker-compose.yml", "-p", "cwd", "up", "--remove-orphans", "-d"] + empty_opts }
266+
267+
268+ subject{ described_class.new(machine) }
269+@@ -277,7 +282,7 @@ describe VagrantPlugins::DockerProvider::Driver::Compose do
270+ before { allow(subject).to receive(:created?).and_return(true) }
271+
272+ it 'removes the container' do
273+- expect(subject).to receive(:execute).with("docker-compose", "-f", "docker-compose.yml", "-p", "cwd", "rm", "-f", "docker_1", {})
274++ expect(subject).to receive(:execute).with("docker-compose", "-f", "docker-compose.yml", "-p", "cwd", "rm", "-f", "docker_1", *empty_opts)
275+ subject.rm(cid)
276+ end
277+ end
278+@@ -286,7 +291,7 @@ describe VagrantPlugins::DockerProvider::Driver::Compose do
279+ before { allow(subject).to receive(:created?).and_return(false) }
280+
281+ it 'does not attempt to remove the container' do
282+- expect(subject).not_to receive(:execute).with("docker-compose", "-f", "docker-compose.yml", "-p", "cwd", "rm", "-f", "docker_1", {})
283++ expect(subject).not_to receive(:execute).with("docker-compose", "-f", "docker-compose.yml", "-p", "cwd", "rm", "-f", "docker_1", *empty_opts)
284+ subject.rm(cid)
285+ end
286+ end
287+diff --git a/test/unit/plugins/providers/virtualbox/action/network_test.rb b/test/unit/plugins/providers/virtualbox/action/network_test.rb
288+index 34ed17d..19a7961 100644
289+--- a/test/unit/plugins/providers/virtualbox/action/network_test.rb
290++++ b/test/unit/plugins/providers/virtualbox/action/network_test.rb
291+@@ -44,7 +44,7 @@ describe VagrantPlugins::ProviderVirtualBox::Action::Network do
292+
293+ it "creates a host-only interface with an IPv6 address <prefix>:1" do
294+ guest = double("guest")
295+- machine.config.vm.network 'private_network', { type: :static, ip: 'dead:beef::100' }
296++ machine.config.vm.network 'private_network', type: :static, ip: 'dead:beef::100'
297+ #allow(driver).to receive(:read_bridged_interfaces) { [] }
298+ allow(driver).to receive(:read_host_only_interfaces) { [] }
299+ #allow(driver).to receive(:read_dhcp_servers) { [] }
300+@@ -72,14 +72,14 @@ describe VagrantPlugins::ProviderVirtualBox::Action::Network do
301+
302+ it "raises the appropriate error when provided with an invalid IP address" do
303+ guest = double("guest")
304+- machine.config.vm.network 'private_network', { ip: '192.168.33.06' }
305++ machine.config.vm.network 'private_network', ip: '192.168.33.06'
306+
307+ expect{ subject.call(env) }.to raise_error(Vagrant::Errors::NetworkAddressInvalid)
308+ end
309+
310+ it "raises no invalid network error when provided with a valid IP address" do
311+ guest = double("guest")
312+- machine.config.vm.network 'private_network', { ip: '192.168.33.6' }
313++ machine.config.vm.network 'private_network', ip: '192.168.33.6'
314+
315+ expect{ subject.call(env) }.not_to raise_error(Vagrant::Errors::NetworkAddressInvalid)
316+ end
317+@@ -92,7 +92,7 @@ describe VagrantPlugins::ProviderVirtualBox::Action::Network do
318+ let(:network_args) {{ type: :dhcp }}
319+
320+ before do
321+- machine.config.vm.network 'private_network', network_args
322++ machine.config.vm.network 'private_network', **network_args
323+ allow(driver).to receive(:read_bridged_interfaces) { bridgedifs }
324+ allow(driver).to receive(:read_host_only_interfaces) { hostonlyifs }
325+ allow(driver).to receive(:read_dhcp_servers) { dhcpservers }
326+diff --git a/test/unit/vagrant/action/builtin/mixin_synced_folders_test.rb b/test/unit/vagrant/action/builtin/mixin_synced_folders_test.rb
327+index e072237..a7f850a 100644
328+--- a/test/unit/vagrant/action/builtin/mixin_synced_folders_test.rb
329++++ b/test/unit/vagrant/action/builtin/mixin_synced_folders_test.rb
330+@@ -270,12 +270,12 @@ describe Vagrant::Action::Builtin::MixinSyncedFolders do
331+
332+ it "should write empty hash to file" do
333+ expect(output_file).to receive(:write).with("{}")
334+- subject.save_synced_folders(machine, folders, options)
335++ subject.save_synced_folders(machine, folders, **options)
336+ end
337+
338+ it "should call credential scrubber before writing file" do
339+ expect(Vagrant::Util::CredentialScrubber).to receive(:desensitize).and_call_original
340+- subject.save_synced_folders(machine, folders, options)
341++ subject.save_synced_folders(machine, folders, **options)
342+ end
343+
344+ context "when folder data is defined" do
345+@@ -286,7 +286,7 @@ describe Vagrant::Action::Builtin::MixinSyncedFolders do
346+
347+ it "should write folder information to file" do
348+ expect(output_file).to receive(:write).with(JSON.dump(folders))
349+- subject.save_synced_folders(machine, folders, options)
350++ subject.save_synced_folders(machine, folders, **options)
351+ end
352+
353+ context "when folder data configuration includes sensitive data" do
354+@@ -303,14 +303,14 @@ describe Vagrant::Action::Builtin::MixinSyncedFolders do
355+ expect(output_file).to receive(:write) do |content|
356+ expect(content).not_to include(password)
357+ end
358+- subject.save_synced_folders(machine, folders, options)
359++ subject.save_synced_folders(machine, folders, **options)
360+ end
361+
362+ it "should mask password content when writing file" do
363+ expect(output_file).to receive(:write) do |content|
364+ expect(content).to include(Vagrant::Util::CredentialScrubber::REPLACEMENT_TEXT)
365+ end
366+- subject.save_synced_folders(machine, folders, options)
367++ subject.save_synced_folders(machine, folders, **options)
368+ end
369+ end
370+ end
371+diff --git a/test/unit/vagrant/plugin/manager_test.rb b/test/unit/vagrant/plugin/manager_test.rb
372+index fea73f6..71164ed 100644
373+--- a/test/unit/vagrant/plugin/manager_test.rb
374++++ b/test/unit/vagrant/plugin/manager_test.rb
375+@@ -118,8 +118,8 @@ describe Vagrant::Plugin::Manager do
376+ end
377+
378+ it "should init the bundler instance with plugins" do
379+- expect(bundler).to receive(:init!).with(plugins)
380+- subject.bundler_init(plugins)
381++ expect(bundler).to receive(:init!).with(plugins, opt: 'value')
382++ subject.bundler_init(plugins, opt: 'value')
383+ end
384+
385+ it "should return nil" do
386diff --git a/debian/patches/series b/debian/patches/series
387index d8c7ba3..9aaebbf 100644
388--- a/debian/patches/series
389+++ b/debian/patches/series
390@@ -5,3 +5,5 @@
391 0005-Relax-dependency-resolution.patch
392 0006-nfs-avoid-adding-extra-newlines-to-etc-exports.patch
393 0007-Add-VirtualBox-provider-support-for-version-6.1.x.patch
394+0008-Fix-warnings-for-ruby-2.7.patch
395+0009-Fix-more-warnings-under-ruby-2.7.patch

Subscribers

People subscribed via source and target branches