Bug 262351 - sysutils/rubygem-hiera-eyaml: broken
Summary: sysutils/rubygem-hiera-eyaml: broken
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: FreeBSD Puppet Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-05 07:41 UTC by Andre Rikkert de Koe - ARK-ICT
Modified: 2022-06-01 15:52 UTC (History)
2 users (show)

See Also:
romain: maintainer-feedback+


Attachments
Update the sysutils/rubygem-hiera-eyaml with a patch (1.34 KB, patch)
2022-03-31 16:34 UTC, ruben
no flags Details | Diff
Update the sysutils/rubygem-hiera-eyaml with a patch (1.38 KB, patch)
2022-04-20 16:00 UTC, ruben
no flags Details | Diff
Add fix to let eyaml work with newer rubygem (1.34 KB, patch)
2022-04-20 16:52 UTC, ruben
no flags Details | Diff
Add fix to let eyaml work with newer rubygem/ruby (1.66 KB, patch)
2022-05-18 07:16 UTC, ruben
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andre Rikkert de Koe - ARK-ICT 2022-03-05 07:41:00 UTC
with current portstree

root@puppetserver:~ # eyaml
Traceback (most recent call last):
	7: from /usr/local/bin/eyaml:25:in `<main>'
	6: from /usr/local/bin/eyaml:25:in `load'
	5: from /usr/local/lib/ruby/gems/2.7/gems/hiera-eyaml-3.2.2/bin/eyaml:10:in `<top (required)>'
	4: from /usr/local/lib/ruby/gems/2.7/gems/hiera-eyaml-3.2.2/lib/hiera/backend/eyaml/plugins.rb:31:in `find'
	3: from /usr/local/lib/ruby/gems/2.7/gems/hiera-eyaml-3.2.2/lib/hiera/backend/eyaml/plugins.rb:31:in `each'
	2: from /usr/local/lib/ruby/gems/2.7/gems/hiera-eyaml-3.2.2/lib/hiera/backend/eyaml/plugins.rb:34:in `block in find'
	1: from /usr/local/lib/ruby/gems/2.7/gems/hiera-eyaml-3.2.2/lib/hiera/backend/eyaml/plugins.rb:34:in `each'
/usr/local/lib/ruby/gems/2.7/gems/hiera-eyaml-3.2.2/lib/hiera/backend/eyaml/plugins.rb:37:in `block (2 levels) in find': undefined method `dependencies' for #<Gem::StubSpecification:0x00000008054bb0d8> (NoMethodError)
root@puppetserver:~ # which eyaml
/usr/local/bin/eyaml
root@puppetserver:~ # pkg which /usr/local/bin/eyaml
/usr/local/bin/eyaml was installed by package rubygem-hiera-eyaml-3.2.2
root@puppetserver:~ # 


puppet lookup still handles decryption of existing encrypted hieradata values using eyaml_lookup_key
Comment 1 ruben 2022-03-26 16:24:09 UTC
This might look like https://github.com/rubygems/rubygems/issues/5235#issuecomment-1002519760

Hiera-eyaml’s issue report this as a ruby 3.x issue, though here we are still using ruby 2.7 https://github.com/voxpupuli/hiera-eyaml/issues/325

Though #258108 mentions al kinds of fixes for ruby 3.x
Comment 2 ruben 2022-03-30 17:34:07 UTC
Crude fix to get it going again

--- /usr/local/lib/ruby/gems/2.7/gems/hiera-eyaml-3.2.2/lib/hiera/backend/eyaml/plugins.rb.orig 2022-03-30 19:25:36.581974000 +0200
+++ /usr/local/lib/ruby/gems/2.7/gems/hiera-eyaml-3.2.2/lib/hiera/backend/eyaml/plugins.rb      2022-03-30 19:30:40.726838000 +0200
@@ -33,6 +33,7 @@
 
             specs.each do |spec|
               next if @@plugins.include? spec
+              spec = Gem::VERSION >= "3.3.7" ? spec.to_spec() : spec
 
               dependency = spec.dependencies.find { |d| d.name == "hiera-eyaml" }
               next if dependency && !dependency.requirement.satisfied_by?( this_version )

Not sure about exact version numbers introducing the regression. Going to check this with the GitHub issue about the same problem
Comment 3 ruben 2022-03-31 16:34:03 UTC
Created attachment 232847 [details]
Update the sysutils/rubygem-hiera-eyaml with a patch
Comment 4 ruben 2022-04-20 16:00:48 UTC
Created attachment 233360 [details]
Update the sysutils/rubygem-hiera-eyaml with a patch

Fix for better version checking
Comment 5 ruben 2022-04-20 16:52:17 UTC
Created attachment 233362 [details]
Add fix to let eyaml work with newer rubygem

Using the fix from https://github.com/voxpupuli/hiera-eyaml/pull/329#pullrequestreview-932407869 instead. 
Works with ruby27-gems-3.3.10 / rubygem-hiera-eyaml-3.2.2 too and is cleaner
Comment 6 Andre Rikkert de Koe - ARK-ICT 2022-04-21 06:53:47 UTC
(In reply to ruben from comment #5)

applied this patch manually and works for me:

root@puppetserver:~ # eyaml
Unknown subcommand

Usage: eyaml <subcommand>

Please use one of the following subcommands or help for more help:
  createkeys, decrypt, edit, encrypt, recrypt, version
root@puppetserver:~ # 


Thanks
Comment 7 ruben 2022-05-17 12:01:10 UTC
caveat: The patch is also needed after the ruby 3.0 upgrade.

There is also another incompatibility that seems to manifest itself inside rubygem-highline that manifests itself as

eyaml encrypt -p
[hiera-eyaml-core] no implicit conversion of Hash into String

echo -n foobar | eyaml encrypt --stdin

can be used as a (unsafe) workaround
Comment 8 ruben 2022-05-18 07:16:30 UTC
Created attachment 234012 [details]
Add fix to let eyaml work with newer rubygem/ruby

After the update to ruby 3.0 it is also required to switch from devel/rubygem-highline1 to devel/rubygem-highline.

This restores eyaml encrypt -p (interactive eyaml encryption)
Comment 9 Romain Tartière freebsd_committer freebsd_triage 2022-06-01 15:48:18 UTC
Ooops, I missed this PR…  LGTM!
Comment 10 commit-hook freebsd_committer freebsd_triage 2022-06-01 15:50:38 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=255d614f9bc8626bd0583274f5c18ec38c7ea662

commit 255d614f9bc8626bd0583274f5c18ec38c7ea662
Author:     Romain Tartière <romain@FreeBSD.org>
AuthorDate: 2022-06-01 15:46:15 +0000
Commit:     Romain Tartière <romain@FreeBSD.org>
CommitDate: 2022-06-01 15:49:44 +0000

    sysutils/rubygem-hiera-eyaml: Fix highline dependency

    The recent update fixed Ruby 3.0 support but `eyaml encrypt -p` remained
    broken.

    PR:             262351
    Reported by:    ruben@verweg.com

 sysutils/rubygem-hiera-eyaml/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Comment 11 Romain Tartière freebsd_committer freebsd_triage 2022-06-01 15:52:12 UTC
Thanks!