Bug 267327 - net-mgmt/rubygem-oxidized-web: Needs haml 5, but 6 is in ports
Summary: net-mgmt/rubygem-oxidized-web: Needs haml 5, but 6 is in ports
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Juraj Lutter
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-25 09:21 UTC by Einar Bjarni Halldórsson
Modified: 2023-02-06 21:19 UTC (History)
5 users (show)

See Also:
nick: maintainer-feedback+


Attachments
Patch views/layout.haml to work with haml 6 (368 bytes, patch)
2022-10-25 09:21 UTC, Einar Bjarni Halldórsson
einar: maintainer-approval? (nick)
Details | Diff
patch gemspec to change dependency on haml, to work with 6.x (2.34 KB, patch)
2022-10-25 09:22 UTC, Einar Bjarni Halldórsson
einar: maintainer-approval? (nick)
Details | Diff
patch rubygem-oxidized-web 0.13.1_3 to 0.13.1_4 (3.41 KB, patch)
2023-02-05 19:53 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 2022-10-25 09:21:48 UTC
Created attachment 237607 [details]
Patch views/layout.haml to work with haml 6

oxidized fails to start if using oxidized-web, with latest ports tree (rubygem-haml-6.0.5).

This patch updates dependency on haml to allow 6.0 and patches views/layout.haml because of changes between haml 5 -> 6.
Comment 1 Einar Bjarni Halldórsson 2022-10-25 09:22:42 UTC
Created attachment 237608 [details]
patch gemspec to change dependency on haml, to work with 6.x
Comment 2 Sigi 2022-11-11 21:37:02 UTC
Hi,

thanks for the patch, could reanimate oxidized. Unfortunately there seems to be another new problem with diff representation.

NoMethodError at /node/version/diffs
undefined method `escape_once' for 
#<Oxidized::API::WebApp:0x000000087f282a58 
@default_layout=:layout, @preferred_extension="haml", 
@app=nil, @template_cache=#<Tilt::Cache:0x000000084d4d5350 @cache={[:haml, :diffs, {:outvar=>"@_out_buf", :default_encoding=>"utf-8"}, "/usr/local/lib/ruby/gems/3.0/gems/oxidized-web-0.13.1/lib/oxidized/web/views"]=>#<Haml::Template:0x00000008367c6da0 @options={:outvar=>"@_out_buf"}, @line=1, @file="/usr/local/lib/ruby/gems/3.0/gems/oxidized-web-0.13.1/lib/oxidized/web/views/diffs.haml", @compiled_method={[Oxidized::API::WebApp, []]=>#<UnboundMethod: Tilt::CompiledTemplates#__tilt_3940(locals) /usr/local/lib/ruby/gems/3.0/gems/oxidized-web-0.13.1/lib/oxidized/web/views/diffs.haml:-2>},
Comment 3 Sigi 2022-11-12 10:36:15 UTC
(In reply to Sigi from comment #2)
Sorry, i am a ruby noob, but after some google sessions i simply changed all references from "escape_once" to "escape_html" in diff.haml and version.haml
This does the job for me. Seems to be a Ruby3 thing.

Only a reference for other people hitting same issue.
Comment 4 Nick Hilliard 2022-11-13 21:12:16 UTC
I'm removing maintainer feedback approval on this patch. Can you submit a patch to change the gemspec to use www/rubygem-haml5?  

oxidized probably won't work on ruby3 yet.
Comment 5 Sigi 2022-11-14 08:40:50 UTC
(In reply to Nick Hilliard from comment #4)

oxidized       44291   0.0  0.0    12848    2504  -  Ss   Sat10        0:04.60 daemon: /usr/local/bin/oxidized[44292] (daemon)
oxidized       44292   0.0  0.5   331348   81080  -  S    Sat10        2:02.75 ruby30: puma 5.6.5 (tcp://127.0.0.1:8888) [/] (ruby30)

I think it runs under Ruby 3. I did nothing to force this. 

ll /usr/local/bin/ruby*
lrwxr-xr-x  1 root  wheel     6 Oct  6 15:09 /usr/local/bin/ruby -> ruby30
-rwxr-xr-x  1 root  wheel   555 Aug 31 19:02 /usr/local/bin/ruby-parse
-rwxr-xr-x  1 root  wheel   559 Aug 31 19:02 /usr/local/bin/ruby-rewrite
-rwxr-xr-x  1 root  wheel  6304 Oct  6 15:44 /usr/local/bin/ruby27
-rwxr-xr-x  1 root  wheel  6336 Oct  6 15:09 /usr/local/bin/ruby30

and

20220421:
  AFFECTS: users of lang/ruby27
  AUTHOR: yasu@FreeBSD.org

  The default ruby version has been updated from 2.7 to 3.0.

  If you compile your own ports you may keep 2.7 as the default version by
  adding the following lines to your /etc/make.conf file:

  #
  # Keep ruby 2.7 as default version
  #
  DEFAULT_VERSIONS+=ruby=2.7
Comment 6 ruben 2023-01-23 08:46:25 UTC
A work around if you need Oxidized running would be installing the gem under the Oxidized user with

sudo -H -u oxidized gem install --user-install oxidized-web


This works with ruby30.
Of course this is an temporary solution
Comment 7 Nick Hilliard 2023-02-05 19:53:03 UTC
Created attachment 239927 [details]
patch rubygem-oxidized-web 0.13.1_3 to 0.13.1_4

depending on rubygem-haml5 seems like a better option
Comment 8 commit-hook freebsd_committer freebsd_triage 2023-02-05 20:41:40 UTC
A commit in branch main references this bug:

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

commit ad243caa7fb4460a75f16457c90a9c0ddc7b166b
Author:     Nick Hilliard <nick@foobar.org>
AuthorDate: 2023-02-05 20:33:29 +0000
Commit:     Juraj Lutter <otis@FreeBSD.org>
CommitDate: 2023-02-05 20:40:24 +0000

    net-mgmt/rubygem-oxidized-web: Adjust dependencies (rubygem-haml5)

    Adjust dependency to proper rubygem-haml5 (as rubygem-haml is 6.x now).

    PR:             267327

 net-mgmt/rubygem-oxidized-web/Makefile                                | 4 ++--
 .../files/{patch-gemspec => patch-oxidized-web.gemspec}               | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
Comment 9 Einar Bjarni Halldórsson 2023-02-05 22:13:38 UTC
When I openeded the bug I completely missed that there was a rubygem-haml5 port added on 2022-10-09.
Since upstream dormant, changing dependency to rubygem-haml5 seems the right solution. Any work to support newer versions of ruby or libraries should be worked on upstream.

For myself, I stopped using oxidized-web. Instead, oxidized pushes commits to gitlab and that's all the UI I need (for now)
Comment 10 Juraj Lutter freebsd_committer freebsd_triage 2023-02-06 21:19:34 UTC
Committed the patch by Nick Hilliard.