Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#75849 - [vagrant] Vagrant is not compatible with Ruby 3

Attached to Project: Community Packages
Opened by Vic (vic) - Thursday, 08 September 2022, 08:41 GMT
Last edited by Toolybird (Toolybird) - Tuesday, 13 September 2022, 21:54 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Jonathan Steel (jsteel)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Using a custom network config results in "wrong number of arguments (given 2, expected 1) (ArgumentError)".

Upstream rolled back their upgrade to Ruby 3.0 because Vagrantfiles are not compatible yet:

https://github.com/hashicorp/vagrant/issues/12448

As the Archlinux package does not contain the embedded ruby but instead uses system ruby (3), we're still bitten by this bug.

Additional info:
* package version(s) 2.3.0-7
* https://github.com/hashicorp/vagrant/issues/12448
This task depends upon

Closed by  Toolybird (Toolybird)
Tuesday, 13 September 2022, 21:54 GMT
Reason for closing:  Not a bug
Additional comments about closing:  See comments
Comment by Toolybird (Toolybird) - Thursday, 08 September 2022, 22:42 GMT
There seems to be conflicting information from upstream. On the one hand they say ruby 3 is compatible [1]. Then on the other hand, docs say don't use a system ruby [2]. Arch will always (naturally) prefer to use system installed stuff. Sidenote: Arch also has ruby2.7 in the repos.

IIUC, you can modify your config to be compatible with ruby3 as mentioned in the linked upstream issue?

[1] https://github.com/hashicorp/vagrant/blob/v2.3.0/vagrant.gemspec#L15
[2] https://www.vagrantup.com/docs/installation/source
Comment by Vic (vic) - Monday, 12 September 2022, 12:00 GMT
My Vagrant config files are automatically generated by kitchen-vagrant[1]. The Vagrantfile is rewritten every time a test starts, so while I can modify it by hand it's not really a solution.

[1] https://github.com/test-kitchen/kitchen-vagrant
Comment by Vic (vic) - Monday, 12 September 2022, 12:52 GMT
Building the package with the ruby2.7 from Arch repositories fixes the issue for me.

diff PKGBUILD.official PKGBUILD
13c13
< pkgrel=7
---
> pkgrel=8
20c20
< 'ruby' 'xz' 'perl')
---
> 'ruby2.7' 'xz' 'perl')
31c31
< local _gemdir="$(gem env gemdir)"
---
> local _gemdir="$(gem-2.7 env gemdir)"
39c39
< gem build $pkgname.gemspec
---
> gem-2.7 build $pkgname.gemspec
63c63
< gem install $pkgname-$pkgver.gem \
---
> gem-2.7 install $pkgname-$pkgver.gem \
83d82
<
Comment by loqs (loqs) - Monday, 12 September 2022, 13:05 GMT
Was kitchen-vagrant not updated to be Ruby 3 compatible with [1]?

[1] https://github.com/test-kitchen/kitchen-vagrant/commit/34a3722cad89652168514c749ad35cf088b71651
Comment by Vic (vic) - Tuesday, 13 September 2022, 08:19 GMT
You're right, looks like that will make the Vagrantfiles created by kitchen-vagrant compatible with Ruby 3.

I don't have that version yet as I'm using the kitchen and kitchen-vagrant included in chef-workstation[1]. However, the issue is fixed for me as I've rebuilt the vagrant package with Ruby 2.7. The fix you've linked may be released by the time a new vagrant version appears.

[1] https://www.chef.io/downloads/tools/workstation?os=ubuntu

Loading...