Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 830617 - dev-scheme/racket-8.3-r2: missing dev-libs/libedit for REPL on runtime
Summary: dev-scheme/racket-8.3-r2: missing dev-libs/libedit for REPL on runtime
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal minor (vote)
Assignee: Scheme Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-04 22:21 UTC by Alex
Modified: 2022-01-05 00:54 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge-info.txt,17.29 KB, text/plain)
2022-01-04 22:23 UTC, Alex
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex 2022-01-04 22:21:26 UTC
Small disclaimer: it is my first bug (or "bug") report, so please be gentle. :)

After the removal of readline USE flag in dev-scheme/racket-8.2, when the racket REPL is run from the shell/console, it reports following error:

; Warning: no readline support (ffi-lib: could not load foreign library
  path: libedit.so.3
  system error: libedit.so.3: cannot open shared object file: No such file or directory)

dev-libs/libedit is necessary for REPL history (unless it is already emerged manually or as dependency for other package/s).

Reproducible: Always

Steps to Reproduce:
1. Emerge dev-scheme/racket.
2. Run racket command from shell.
Actual Results:  
Following error is reported:

; Warning: no readline support (ffi-lib: could not load foreign library
  path: libedit.so.3
  system error: libedit.so.3: cannot open shared object file: No such file or directory)

Using keyboard arrow keys does not show previous REPL inputs/history.

Expected Results:  
Default installation should support history browsing, considering the relevant USE flag is missing/removed.

By manually emerging dev-libs/libedit, warning is gone and history browsing works.
Comment 1 Alex 2022-01-04 22:23:11 UTC
Created attachment 761323 [details]
emerge --info
Comment 2 Maciej Barć gentoo-dev 2022-01-04 22:31:09 UTC
Alex, could you check if you have readline support if you remove libedit and install readline (be sure to relaunch racket REPL).

And back to the point: after you emerge racket you should have a information that you should install libedit/readline if you want the readline features.
https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-scheme/racket/racket-8.3-r2.ebuild#n134
Comment 3 Alex 2022-01-04 22:37:22 UTC
(In reply to Maciej Barć from comment #2)
> Alex, could you check if you have readline support if you remove libedit and
> install readline (be sure to relaunch racket REPL).
> 
> And back to the point: after you emerge racket you should have a information
> that you should install libedit/readline if you want the readline features.


Maciej, sys-libs/readline-8.1_p1-r1 is already installed with following USE flags set:

split-usr unicode -static-libs -utils

Removing libedit reverts warning.
Comment 4 Maciej Barć gentoo-dev 2022-01-04 22:48:09 UTC
I actually use a Racket snapshot version from racket-overlay on my system and I have no problems with using readline in Racket REPL, if you want you can try installing a snapshot version from that overlay (be sure to unmask dev-scheme/racket::racket-overlay)
https://gitlab.com/src_prepare/racket/racket-overlay

OR installing a "readline-gpl" package. 
"raco pkg install readline-gpl" should do the job
https://pkgs.racket-lang.org/package/readline-gpl

Also I do not agree that we should DEPEND on libedit because 
1. it is runtime-dependeny only
2. you have 2 other (GUI) racket shells: gracket & drracket that have a REPL
3. you have readline-gpl pkg as mentioned above

Anyway it seems like we will have to change the optfeature warning to only libedit
https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-scheme/racket/racket-8.2-r2.ebuild#n160
Comment 5 Alex 2022-01-04 22:55:49 UTC
(In reply to Maciej Barć from comment #4)

> OR installing a "readline-gpl" package. 
> "raco pkg install readline-gpl" should do the job


Thank you.

Unmerged libedit and it works with "readline-gpl" from Racket's package manager. Did not try snaphsot version though.

> Also I do not agree that we should DEPEND on libedit because 
> 1. it is runtime-dependeny only
> 2. you have 2 other (GUI) racket shells: gracket & drracket that have a REPL

I personally prefer to use regular shell because of workflow, instead of g/drracket.
Comment 6 Maciej Barć gentoo-dev 2022-01-04 22:58:31 UTC
> Unmerged libedit and it works with "readline-gpl" from Racket's package
> manager. Did not try snaphsot version though.

Thanks for checking it out!

> I personally prefer to use regular shell because of workflow, instead of
> g/drracket.

I personally run Racket in Emacs via racket-mode
https://racket-mode.com/
Comment 7 Maciej Barć gentoo-dev 2022-01-04 23:00:03 UTC
> I personally run Racket in Emacs via racket-mode
> https://racket-mode.com/

so I probably would notice this even if something happened to Racket's "readlie" pkg as it is not loaded and history browsing is managed via Emacs
Comment 8 Maciej Barć gentoo-dev 2022-01-04 23:45:35 UTC
Finally found out why why readline worked for me 
even after I removed readline-gpl (because I had uninstalled it long time ago).
When installed globally the file /usr/share/racket/readline-lib.rkt does not seem to be removed after readline-gpl is, this is why readline was loading for me instead of libedit.
Comment 9 Larry the Git Cow gentoo-dev 2022-01-05 00:54:02 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5330ac4eea08764914932a4eb3bc22046acb8664

commit 5330ac4eea08764914932a4eb3bc22046acb8664
Author:     Maciej Barć <xgqt@gentoo.org>
AuthorDate: 2022-01-05 00:52:31 +0000
Commit:     Maciej Barć <xgqt@gentoo.org>
CommitDate: 2022-01-05 00:53:59 +0000

    dev-scheme/racket: resolve the libedit/readline issue
    
    Closes: https://bugs.gentoo.org/830617
    Package-Manager: Portage-3.0.28, Repoman-3.0.3
    Signed-off-by: Maciej Barć <xgqt@gentoo.org>

 dev-scheme/racket/racket-8.2-r2.ebuild | 17 ++++++++++++++---
 dev-scheme/racket/racket-8.3-r2.ebuild | 17 ++++++++++++++---
 2 files changed, 28 insertions(+), 6 deletions(-)