docker-clojure icon indicating copy to clipboard operation
docker-clojure copied to clipboard

Replace rlwrap with rlfe

Open alexander-yakushev opened this issue 4 months ago • 1 comments

While working on #229, I discovered the following: the installation of rlwrap on Debian and Ubuntu pulls ~80 MB of additional packages (python3 and other stuff). That sounds excessive for a mere readline wrapper. Given that, and the fact that rlwrap is bugged in Docker and requires hacks to operate, this is a proposal to replace it with another readline wrapper, rlfe. It has a much slimmer dependency tree and looks simpler. I've verified that it works, supports GNU readline's navigation commands (^A, ^E, etc.), handles ^C dorrectly.

Main points:

  1. Interactive REPL is unlikely to be the "production" usecase for a Docker image. So, as long as we continue to provide the user-facing functionality in a similar way (GNU readine is still used), small differences shouldn't be a dealbreaker.
  2. The primary way of non-interactive invoking Clojure scripts, clojure, is not affected in any way.
  3. I also discovered that the entrypoint in current Alpine images seems to be broken because we didn't install rlwrap there before. Also, rlfe is not available on Alpine and will not be installed with these changes. However, the new wrapper script invokes clojuredirectly if rlfe is not found – a better behavior than what we have now, where calling clj on Alpine fails completely.

alexander-yakushev avatar Apr 24 '24 12:04 alexander-yakushev

Drafting this for now. Entrypoint business is a mess 😞.

alexander-yakushev avatar Apr 24 '24 13:04 alexander-yakushev