Bug 277377 - net-mgmt/rubygem-oxidized-web fails to start with sinatra 4.0
Summary: net-mgmt/rubygem-oxidized-web fails to start with sinatra 4.0
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-28 15:12 UTC by Einar Bjarni Halldórsson
Modified: 2024-03-31 19:13 UTC (History)
2 users (show)

See Also:
nick: maintainer-feedback+


Attachments
Updates gemspec requirements to allow for sinatra 4.0 (1.41 KB, patch)
2024-02-29 10:58 UTC, Einar Bjarni Halldórsson
no flags Details | Diff
Patch oxidized-web.gemspec (2.27 KB, patch)
2024-03-06 09:46 UTC, Einar Bjarni Halldórsson
einar: maintainer-approval?
Details | Diff
updated einar's patch with Makefile diffs (2.62 KB, patch)
2024-03-31 19:13 UTC, Nick Hilliard
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Einar Bjarni Halldórsson 2024-02-28 15:12:38 UTC
After rubygem-sinatra was upgraded to 4.0.0, oxidized fails to start with oxidized-web.
The error, displayed when run with '-d':

$ /usr/local/bin/oxidized -d
oxidized-web not found: sudo gem install oxidized-web - \
          or disable web support by setting "rest: false" in your configuration
/usr/local/lib/ruby/gems/3.2/gems/oxidized-0.29.1/lib/oxidized/core.rb:23:in `rescue in initialize': oxidized-web not found: sudo gem install oxidized-web - \ (Oxidized::OxidizedError)
          or disable web support by setting "rest: false" in your configuration
	from /usr/local/lib/ruby/gems/3.2/gems/oxidized-0.29.1/lib/oxidized/core.rb:20:in `initialize'
	from /usr/local/lib/ruby/gems/3.2/gems/oxidized-0.29.1/lib/oxidized/core.rb:4:in `new'
	from /usr/local/lib/ruby/gems/3.2/gems/oxidized-0.29.1/lib/oxidized/core.rb:4:in `new'
	from /usr/local/lib/ruby/gems/3.2/gems/oxidized-0.29.1/lib/oxidized/cli.rb:13:in `run'
	from /usr/local/lib/ruby/gems/3.2/gems/oxidized-0.29.1/bin/oxidized:8:in `<top (required)>'
	from /usr/local/bin/oxidized:25:in `load'
	from /usr/local/bin/oxidized:25:in `<main>'
/usr/local/lib/ruby/site_ruby/3.2/rubygems/specification.rb:2312:in `raise_if_conflicts': Unable to activate oxidized-web-0.13.1, because sinatra-4.0.0 conflicts with sinatra (~> 3.0, >= 3.0.6) (Gem::ConflictError)
	from /usr/local/lib/ruby/site_ruby/3.2/rubygems/specification.rb:1443:in `activate'
	from /usr/local/lib/ruby/site_ruby/3.2/rubygems.rb:210:in `rescue in try_activate'
	from /usr/local/lib/ruby/site_ruby/3.2/rubygems.rb:203:in `try_activate'
	from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:155:in `rescue in require'
	from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:40:in `require'
	from /usr/local/lib/ruby/gems/3.2/gems/oxidized-0.29.1/lib/oxidized/core.rb:21:in `initialize'
	from /usr/local/lib/ruby/gems/3.2/gems/oxidized-0.29.1/lib/oxidized/core.rb:4:in `new'
	from /usr/local/lib/ruby/gems/3.2/gems/oxidized-0.29.1/lib/oxidized/core.rb:4:in `new'
	from /usr/local/lib/ruby/gems/3.2/gems/oxidized-0.29.1/lib/oxidized/cli.rb:13:in `run'
	from /usr/local/lib/ruby/gems/3.2/gems/oxidized-0.29.1/bin/oxidized:8:in `<top (required)>'
	from /usr/local/bin/oxidized:25:in `load'
	from /usr/local/bin/oxidized:25:in `<main>'
/usr/local/lib/ruby/site_ruby/3.2/rubygems/specification.rb:1471:in `block in activate_dependencies': can't satisfy 'sinatra (~> 3.0, >= 3.0.6)', already activated 'sinatra-4.0.0' (Gem::LoadError)
	from /usr/local/lib/ruby/site_ruby/3.2/rubygems/specification.rb:1463:in `each'
	from /usr/local/lib/ruby/site_ruby/3.2/rubygems/specification.rb:1463:in `activate_dependencies'
	from /usr/local/lib/ruby/site_ruby/3.2/rubygems/specification.rb:1445:in `activate'
	from /usr/local/lib/ruby/site_ruby/3.2/rubygems.rb:204:in `try_activate'
	from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:155:in `rescue in require'
	from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:40:in `require'
	from /usr/local/lib/ruby/gems/3.2/gems/oxidized-0.29.1/lib/oxidized/core.rb:21:in `initialize'
	from /usr/local/lib/ruby/gems/3.2/gems/oxidized-0.29.1/lib/oxidized/core.rb:4:in `new'
	from /usr/local/lib/ruby/gems/3.2/gems/oxidized-0.29.1/lib/oxidized/core.rb:4:in `new'
	from /usr/local/lib/ruby/gems/3.2/gems/oxidized-0.29.1/lib/oxidized/cli.rb:13:in `run'
	from /usr/local/lib/ruby/gems/3.2/gems/oxidized-0.29.1/bin/oxidized:8:in `<top (required)>'
	from /usr/local/bin/oxidized:25:in `load'
	from /usr/local/bin/oxidized:25:in `<main>'
<internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:86:in `require': cannot load such file -- oxidized/web (LoadError)
	from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:86:in `require'
	from /usr/local/lib/ruby/gems/3.2/gems/oxidized-0.29.1/lib/oxidized/core.rb:21:in `initialize'
	from /usr/local/lib/ruby/gems/3.2/gems/oxidized-0.29.1/lib/oxidized/core.rb:4:in `new'
	from /usr/local/lib/ruby/gems/3.2/gems/oxidized-0.29.1/lib/oxidized/core.rb:4:in `new'
	from /usr/local/lib/ruby/gems/3.2/gems/oxidized-0.29.1/lib/oxidized/cli.rb:13:in `run'
	from /usr/local/lib/ruby/gems/3.2/gems/oxidized-0.29.1/bin/oxidized:8:in `<top (required)>'
	from /usr/local/bin/oxidized:25:in `load'
	from /usr/local/bin/oxidized:25:in `<main>'



The problem seems to be: "Unable to activate oxidized-web-0.13.1, because sinatra-4.0.0 conflicts with sinatra (~> 3.0, >= 3.0.6) (Gem::ConflictError)"
Comment 1 Einar Bjarni Halldórsson 2024-02-29 10:58:56 UTC
Created attachment 248825 [details]
Updates gemspec requirements to allow for sinatra 4.0

Updates the existing patch to allow for updated versions of rubygem-sinatra and rubygem-sinatra-contrib in ports.

Tested building in poudriere and updating on running server. UI now starts up and no errors found yet.
Comment 2 Einar Bjarni Halldórsson 2024-03-05 15:47:20 UTC
Fails to start, probably broken by https://cgit.freebsd.org/ports/commit/?id=d86e4213df64cb407a2ccf2ba5ddc6a2e15b9c20

Error now, with my patch is:

/usr/local/lib/ruby/site_ruby/3.2/rubygems/dependency.rb:313:in `to_specs': Could not find 'rack-test' (~> 0.7.0) among 37 total gem(s) (Gem::MissingSpecError)
Checked in 'GEM_PATH=/var/db/oxidized/.local/share/gem/ruby/3.2:/usr/local/lib/ruby/gems/3.2' , execute `gem env` for more information
	from /usr/local/lib/ruby/site_ruby/3.2/rubygems/specification.rb:1478:in `block in activate_dependencies'
	from /usr/local/lib/ruby/site_ruby/3.2/rubygems/specification.rb:1466:in `each'
	from /usr/local/lib/ruby/site_ruby/3.2/rubygems/specification.rb:1466:in `activate_dependencies'
	from /usr/local/lib/ruby/site_ruby/3.2/rubygems/specification.rb:1448:in `activate'
	from /usr/local/lib/ruby/site_ruby/3.2/rubygems.rb:199:in `try_activate'
	from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:139:in `block in require'
	from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:139:in `synchronize'
	from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:139:in `rescue in require'
	from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:135:in `require'
	from /usr/local/lib/ruby/gems/3.2/gems/oxidized-0.29.1/lib/oxidized/core.rb:21:in `initialize'
	from /usr/local/lib/ruby/gems/3.2/gems/oxidized-0.29.1/lib/oxidized/core.rb:4:in `new'
	from /usr/local/lib/ruby/gems/3.2/gems/oxidized-0.29.1/lib/oxidized/core.rb:4:in `new'
	from /usr/local/lib/ruby/gems/3.2/gems/oxidized-0.29.1/lib/oxidized/cli.rb:13:in `run'
	from /usr/local/lib/ruby/gems/3.2/gems/oxidized-0.29.1/bin/oxidized:8:in `<top (required)>'
	from /usr/local/bin/oxidized:25:in `load'
	from /usr/local/bin/oxidized:25:in `<main>'
<internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:136:in `require': cannot load such file -- oxidized/web (LoadError)
	from <internal:/usr/local/lib/ruby/site_ruby/3.2/rubygems/core_ext/kernel_require.rb>:136:in `require'
	from /usr/local/lib/ruby/gems/3.2/gems/oxidized-0.29.1/lib/oxidized/core.rb:21:in `initialize'
	from /usr/local/lib/ruby/gems/3.2/gems/oxidized-0.29.1/lib/oxidized/core.rb:4:in `new'
	from /usr/local/lib/ruby/gems/3.2/gems/oxidized-0.29.1/lib/oxidized/core.rb:4:in `new'
	from /usr/local/lib/ruby/gems/3.2/gems/oxidized-0.29.1/lib/oxidized/cli.rb:13:in `run'
	from /usr/local/lib/ruby/gems/3.2/gems/oxidized-0.29.1/bin/oxidized:8:in `<top (required)>'
	from /usr/local/bin/oxidized:25:in `load'
	from /usr/local/bin/oxidized:25:in `<main>'
Comment 3 Nick Hilliard 2024-03-05 15:57:23 UTC
eh that's not great. Would turning www/rubygem-rack-test into an explicit dependency fix this, or is there a bigger systemic problem with commit #d86e4213?
Comment 4 Einar Bjarni Halldórsson 2024-03-06 08:48:56 UTC
(In reply to Nick Hilliard from comment #3)

I have very little experience with ruby, but given that this wasn't a problem before, I think the problem is that commit #d86e4213 added .freeze to all gem dependencies.

I'm going to try patching the gemspec for rack-test and see where it goes
Comment 5 Einar Bjarni Halldórsson 2024-03-06 09:46:13 UTC
Created attachment 248964 [details]
Patch oxidized-web.gemspec

With this patch, rubygem-oxidized-web builds and runs
Comment 6 Einar Bjarni Halldórsson 2024-03-20 13:03:55 UTC
Have you had a chance to look at my updated patch?

I think that if upstream is not willing to merge, than we should just patch the gemspec to accept all major versions, so instead of `~> 3.0` we put `>= 3.0`.

If a major version update breaks the dependency, we'll have to address that anyway, if upstream is not actively maintaining dependencies.
Comment 7 Nick Hilliard 2024-03-31 19:13:42 UTC
Created attachment 249603 [details]
updated einar's patch with Makefile diffs

lgtm. i've added some makefile updates, but otherwise looks good to commit.