Bug 272768 - net/gorss: Update to 0.4
Summary: net/gorss: Update to 0.4
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: Alexey Dokuchaev
URL: https://github.com/Lallassu/gorss/rel...
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-28 02:00 UTC by Yonas Yanfa
Modified: 2023-09-27 10:42 UTC (History)
2 users (show)

See Also:


Attachments
Update to 0.4 (12.18 KB, patch)
2023-08-16 07:30 UTC, Fernando Apesteguía
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yonas Yanfa 2023-07-28 02:00:36 UTC
Latest version is v0.4
Comment 1 Fernando Apesteguía freebsd_committer freebsd_triage 2023-07-28 06:46:30 UTC
Can you provide a patch?
Comment 2 Yonas Yanfa 2023-07-28 16:00:41 UTC
(In reply to Fernando Apesteguía from comment #1)

> Can you provide a patch?

Sorry, unfortunately I cannot.
Comment 3 Fernando Apesteguía freebsd_committer freebsd_triage 2023-08-16 07:30:24 UTC
Created attachment 244139 [details]
Update to 0.4

Can you try this patch?
Comment 4 Yonas Yanfa 2023-08-16 19:47:22 UTC
(In reply to Fernando Apesteguía from comment #3)

I don't have ports installed. I recommend that you commit it if it works for you.
Comment 5 Fernando Apesteguía freebsd_committer freebsd_triage 2023-08-17 06:49:21 UTC
(In reply to Yonas Yanfa from comment #4)
It doesn't.

2023/08/17 08:48:13 main.go:108: Using config: /home/fernape/.config/gorss/gorss.conf
2023/08/17 08:48:13 main.go:109: Using theme: /home/fernape/.config/gorss/themes/default.theme
2023/08/17 08:48:13 main.go:110: Using DB: /home/fernape/.local/share/gorss/gorss.db
2023/08/17 08:48:13 main.go:111: Using log file: /home/fernape/.local/share/gorss/gorss.log

That's it. Nothing shows up. If you are using the 0.3 version in the repository, it doesn't work either except by mere luck. It needs infocmp which comes with ncurses but it is not listed as a run dependency.
Comment 6 commit-hook freebsd_committer freebsd_triage 2023-09-24 17:21:37 UTC
A commit in branch main references this bug:

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

commit 6c696ba462f0fe954461370f664888f9ddaeb61c
Author:     Alexey Dokuchaev <danfe@FreeBSD.org>
AuthorDate: 2023-09-24 17:19:24 +0000
Commit:     Alexey Dokuchaev <danfe@FreeBSD.org>
CommitDate: 2023-09-24 17:19:24 +0000

    net/gorss: update to version 0.4, don't force infocmp(1) installation

    LookupTerminfo() first tries to find definitions based on the TERM
    environment variable and falls back to parsing infocmp(1) output
    only if that fails.  The latter is really a method of last resort,
    as the performance will be slow.  Do not force this dependency since
    it is rarely needed, and most likely due to incorrectly configured
    environment which should be fixed instead.

    Improve user-friendliness of the program on the first run by copying
    installed example configuration and default theme files into user's
    home directory (exact location depends on XDG configuration).

    PR:     272768

 net/gorss/Makefile                            | 16 ++---
 net/gorss/Makefile.deps                       | 44 ++++++++-----
 net/gorss/distinfo                            | 90 ++++++++++++++++-----------
 net/gorss/files/patch-cmd_gorss_main.go (new) | 28 +++++++++
 4 files changed, 115 insertions(+), 63 deletions(-)
Comment 7 Alexey Dokuchaev freebsd_committer freebsd_triage 2023-09-24 17:33:42 UTC
(In reply to Fernando Apesteguía from comment #5)
> It doesn't [work]. Nothing shows up.
Of course it does, it just needs config and theme files as it says in the log.  I've changed the port so it copies default system-wide ones under ~/.config/gorss to reduce first-time user's confusion.

> It needs infocmp which comes with ncurses but it is not listed as a run
> dependency.
No it doesn't really /need/ it, only as a last resort.  There's probably something wrong with your environment; to start with, what's the value of $TERM?
Comment 8 Fernando Apesteguía freebsd_committer freebsd_triage 2023-09-24 18:01:16 UTC
(In reply to Alexey Dokuchaev from comment #7)

> Of course it does, it just needs config and theme files as it says in the log.  > I've changed the port so it copies default system-wide ones under ~/.config
>/gorss to reduce first-time user's confusion.

It really doesn't.
And I had copied the config and the themes. By the way, the config in the example gives an error which I don't remember exactly but was something along "repeated key" or something like that. I suppose you also get it.

>No it doesn't really /need/ it, only as a last resort.  There's probably 
> something wrong with your environment; to start with, what's the value of $TERM?

Not really.

$ echo $TERM
screen-256color

I just happen to use tmux.
Comment 9 Alexey Dokuchaev freebsd_committer freebsd_triage 2023-09-24 18:23:53 UTC
(In reply to Fernando Apesteguía from comment #8)
> It really doesn't.
Been reading various feeds for the past couple of hours, works like a charm here (well, almost list a charm: I've hit two or three segfaults similar to https://github.com/Lallassu/gorss/issues/26).

> I suppose you also get ["repeated key" or something].
Hmm, didn't notice (maybe because I don't use tmux).

> TERM=screen-256color, I just happen to use tmux.
Okay, I'll check that combination.
Comment 10 Fernando Apesteguía freebsd_committer freebsd_triage 2023-09-25 06:36:01 UTC
(In reply to Alexey Dokuchaev from comment #9)

I tried the new version without the ncurses dependency:

$ gorss 
2023/09/25 08:33:35 main.go:109: Using config: /home/fernape/.config/gorss/gorss.conf
2023/09/25 08:33:35 main.go:110: Using theme: /home/fernape/.config/gorss/themes/default.theme
2023/09/25 08:33:35 main.go:111: Using DB: /home/fernape/.local/share/gorss/gorss.db
2023/09/25 08:33:35 main.go:112: Using log file: /home/fernape/.local/share/gorss/gorss.log
$

No window or anything. Installing ncurses now does not help which is weird if the fallback mechanism is in place.
The exact message about the config is in the log:

2023/09/25 08:35:01 config.go:116: Key defined more than once, key:
Comment 11 Alexey Dokuchaev freebsd_committer freebsd_triage 2023-09-27 09:53:03 UTC
(In reply to Fernando Apesteguía from comment #10)
> No window or anything. Installing ncurses now does not help which is weird
> if the fallback mechanism is in place.
This could be an indication that the problem is not TUI-related.  FWIW, it works fine for me with any combination of (known) TERM/tmux/screen regardless of doing it under X11/xterm or plain vt(4) console.

> The exact message about the config is in the log:
> 2023/09/25 08:35:01 config.go:116: Key defined more than once, key:
Could it be garbled local state, e.g. some conflict with files from the previous version?  Does wiping out ~/.config/gorss and ~/.local/share/gorss help?

You could replace default feeds with the ones which definitely work in your environment/jurisdiction, e.g.:

  "feeds" : [
    {
      "name" : "LOR",
      "url" : "https://www.linux.org.ru/section-rss.jsp?section=1"
    },
    ...
  ],

Albeit default Sweedish ones should also work just fine.
Comment 12 Fernando Apesteguía freebsd_committer freebsd_triage 2023-09-27 10:07:59 UTC
(In reply to Alexey Dokuchaev from comment #11)

> Could it be garbled local state, e.g. some conflict with files from the previous version?  Does wiping out ~/.config/gorss and ~/.local/share/gorss help?

Yep!

Removing those directories make gorss boot, thanks! I suppose there is some incompatible change in the configuration between 0.3 and 0.4 that prevents 0.4 from booting.

After booting I see the screen and some of the news sites listed in the left panel. Unfortunately pressing the down key generates a segfault:



$ gorss
2023/09/27 12:04:32 main.go:109: Using config: /home/fernape/.config/gorss/gorss.conf
2023/09/27 12:04:32 main.go:110: Using theme: /home/fernape/.config/gorss/themes/default.theme
2023/09/27 12:04:32 main.go:111: Using DB: /home/fernape/.local/share/gorss/gorss.db
2023/09/27 12:04:32 main.go:112: Using log file: /home/fernape/.local/share/gorss/gorss.log
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
        panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0xb64738]

goroutine 1 [running]:
github.com/rivo/tview.(*Application).Run.func1()
        github.com/rivo/tview/application.go:251 +0x4d
panic({0x2738a0, 0xc7a950})
        runtime/panic.go:884 +0x213
github.com/Lallassu/gorss/internal.(*DB).MarkRead(0x8542a5400?, 0x0)
        github.com/Lallassu/gorss/internal/db.go:189 +0xd8
github.com/Lallassu/gorss/internal.(*Window).MoveDown(0x8542a8be0, {0x3b7098?, 0x8541b1d40})
        github.com/Lallassu/gorss/internal/window.go:534 +0x1ed
github.com/Lallassu/gorss/internal.(*Controller).Input(0x8542a5400, 0x85407e0a0)
        github.com/Lallassu/gorss/internal/controller.go:554 +0xd9b
github.com/rivo/tview.(*Application).Run(0x8541e2540)
        github.com/rivo/tview/application.go:327 +0x42b
github.com/Lallassu/gorss/internal.(*Window).Start(0x8542a8be0)
        github.com/Lallassu/gorss/internal/window.go:183 +0x4f
github.com/Lallassu/gorss/internal.(*Controller).Init(0x8542a5400, {0x85402c360, 0x26}, {0x85402c3c0, 0x30}, {0x85402c4b0, 0x29})
        github.com/Lallassu/gorss/internal/controller.go:68 +0x518
main.main()
        github.com/Lallassu/gorss/cmd/gorss/main.go:121 +0xdb1

Just letting you know. No worries from my side. I tend to consume most of my feed from the browser.

Thanks a lot for your help.
Comment 13 Alexey Dokuchaev freebsd_committer freebsd_triage 2023-09-27 10:42:55 UTC
(In reply to Fernando Apesteguía from comment #12)
> After booting I see the screen and some of the news sites listed in the left
> panel. Unfortunately pressing the down key generates a segfault:
I've left a note about it at https://github.com/Lallassu/gorss/issues/26.

> Just letting you know. No worries from my side.
Then I guess we're done with this PR; segfaults etc. are better tracked upstream.