Bug 263213 - net-im/gomuks: missing dependency on ncurses
Summary: net-im/gomuks: missing dependency on ncurses
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: Emanuel Haupt
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-11 06:13 UTC by Duane
Modified: 2022-06-27 15:14 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (ehaupt)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Duane 2022-04-11 06:13:30 UTC
If ncurses isn't installed then the following error is received:

$ gomuks
 __________
< Oh noes! >
 ‾‾‾\‾‾‾‾‾‾
     \   ^__^
      \  (XX)\_______
         (__)\       )\/\
          U  ||----W |
             ||     ||

A fatal error has occurred.

The stack trace has been saved to /tmp/gomuks/panic-2022-04-11--16-07-46.txt

You can file an issue at https://github.com/tulir/gomuks/issues.
Please provide the contents of that file when filing an issue.

$ less /tmp/gomuks/panic-2022-04-11--16-07-46.txt
exec: "infocmp": executable file not found in $PATH
goroutine 1 [running]:
runtime/debug.Stack()
    runtime/debug/stack.go:24 +0x65
maunium.net/go/gomuks/debug.PrettyPanic({0x2b00a0, 0xc0004b8000})
    maunium.net/go/gomuks/debug/debug.go:133 +0x19a
maunium.net/go/gomuks/debug.Recover()
    maunium.net/go/gomuks/debug/debug.go:107 +0x5a
panic({0x2b00a0, 0xc0004b8000})
    runtime/panic.go:838 +0x207
main.(*Gomuks).Start(0xc00052be60)
    maunium.net/go/gomuks/gomuks.go:116 +0x151
main.main()
    maunium.net/go/gomuks/main.go:89 +0x60f

Installing ncurses fixes the issue.
Comment 1 Emanuel Haupt freebsd_committer freebsd_triage 2022-04-11 07:57:57 UTC
So far I have not been able to reproduce the issue. A default FreeBSD installation comes shipped with ncurses from base:

# ldconfig -r | grep -i curses
        36:-lncursesw.9 => /lib/libncursesw.so.9

I just created a jail, installed gomuks from pkg and was able to launch it.

Did you build your FreeBSD without nucrses?
Comment 2 Duane 2022-04-11 12:50:44 UTC
(In reply to Emanuel Haupt from comment #1)

I cannot find the issue in the source, but to reproduce you need to try and launch gomuks from a tmux session.

It seems that it calls out to the infocmp utility to retrieve terminal capabilities when running from tmux, and I assume it must have some built in settings that are sufficient for the regular console.
Comment 4 Duane 2022-04-11 14:45:11 UTC
(In reply to Duane from comment #3)

More digging...

Turns out the reason I couldn't figure out what is going on is that the author of gomuks is using a fork of the tcell library which he has modified to specifically override the TERM variable if TMUX is being used, but he overrides it to a setting which isn't compiled in to his fork (but is in the original project).

I will submit a bug with gomuks, but in the meantime if you could please add a dependency on ncurses.

Thanks.
Comment 5 Duane 2022-04-11 14:50:08 UTC
(In reply to Duane from comment #4)

Actually, better than adding the ncurses dependency, could you please just revert https://github.com/tulir/tcell/commit/aef08b141333dfbaad8a7f0c187d7ab7d2b203c9 in a patch.  This will return gomuks to using the provided TERM variable rather than overriding it, and the definitions for screen (which tmux defaults to) are included so everything works fine.
Comment 6 Emanuel Haupt freebsd_committer freebsd_triage 2022-04-12 11:28:01 UTC
Confirmed with tmux. Good digging.

I'm looking into the reverting that breaking change with a local patch.

Can you please open an issue upstream and follow up with the URL so we can track the progress and preserve history.
Comment 7 Duane 2022-04-12 11:52:02 UTC
(In reply to Emanuel Haupt from comment #6)

Upstream issue:

https://github.com/tulir/gomuks/issues/363
Comment 8 commit-hook freebsd_committer freebsd_triage 2022-04-12 13:02:21 UTC
A commit in branch main references this bug:

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

commit fa4b531894f88d21307b3e8640b197fbe99038ec
Author:     Emanuel Haupt <ehaupt@FreeBSD.org>
AuthorDate: 2022-04-12 13:01:37 +0000
Commit:     Emanuel Haupt <ehaupt@FreeBSD.org>
CommitDate: 2022-04-12 13:01:54 +0000

    net-im/gomuks: Fix runtime within a tmux session

    An upstream change [1] made it a requirement to have `infocmp` installed
    for parsing terminal capabilities within a tmux session.

    While ncurses from base works perfectly fine with gomuks, base does not
    ship with `infocmp` thus creating a hard dependency to devel/ncurses.

    Patch port to revert upstream change.

    [1] https://github.com/tulir/tcell/commit/aef08b141333dfbaad8a7f0c187d7ab7d2b203c9
        https://github.com/tulir/tcell/blob/bb9a2b9b1937b1ede6a00450b2650b7b0befe2fc/terminfo/dynamic/dynamic.go#L121

    PR:             263213
    Upstream issue: https://github.com/tulir/gomuks/issues/363
    Reported by:    parakleta@darkreality.org

 net-im/gomuks/Makefile                                 |  2 +-
 .../patch-vendor_maunium.net_go_tcell_tscreen.go (new) | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+), 1 deletion(-)
Comment 9 commit-hook freebsd_committer freebsd_triage 2022-04-12 13:07:23 UTC
A commit in branch 2022Q2 references this bug:

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

commit b5a08339f85294c93af1af5abeb68c4074e2b1d8
Author:     Emanuel Haupt <ehaupt@FreeBSD.org>
AuthorDate: 2022-04-12 13:01:37 +0000
Commit:     Emanuel Haupt <ehaupt@FreeBSD.org>
CommitDate: 2022-04-12 13:06:25 +0000

    net-im/gomuks: Fix runtime within a tmux session

    An upstream change [1] made it a requirement to have `infocmp` installed
    for parsing terminal capabilities within a tmux session.

    While ncurses from base works perfectly fine with gomuks, base does not
    ship with `infocmp` thus creating a hard dependency to devel/ncurses.

    Patch port to revert upstream change.

    [1] https://github.com/tulir/tcell/commit/aef08b141333dfbaad8a7f0c187d7ab7d2b203c9
        https://github.com/tulir/tcell/blob/bb9a2b9b1937b1ede6a00450b2650b7b0befe2fc/terminfo/dynamic/dynamic.go#L121

    PR:             263213
    Upstream issue: https://github.com/tulir/gomuks/issues/363
    Reported by:    parakleta@darkreality.org

    (cherry picked from commit fa4b531894f88d21307b3e8640b197fbe99038ec)

 net-im/gomuks/Makefile                                 |  2 +-
 .../patch-vendor_maunium.net_go_tcell_tscreen.go (new) | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+), 1 deletion(-)
Comment 10 Emanuel Haupt freebsd_committer freebsd_triage 2022-06-27 15:14:48 UTC
Committed (a while ago).