Skip to content

Replace rlwrap with rlfe #230

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions resources/clj.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

# This script acts as a replacement for "clj" script shipped with Clojure CLI
# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script
# and provide line editing abilities. This script uses rlfe instead of rlwrap
# for the same purpose. If rlfe is not installed, run regular "clojure" script.

if type rlfe; then
exec rlfe clojure "$@"
else
exec clojure "$@"
fi
30 changes: 0 additions & 30 deletions resources/rlwrap.retry

This file was deleted.

14 changes: 6 additions & 8 deletions src/docker_clojure/dockerfile/tools_deps.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
install-distro-deps uninstall-distro-build-deps]]))

(defn prereqs [dir _variant]
(copy-resource-file! dir "rlwrap.retry" identity
(copy-resource-file! dir "clj.sh" identity
#(.setExecutable % true false)))

(def distro-deps
{:debian-slim {:build #{"curl"}
:runtime #{"rlwrap" "make" "git"}}
:runtime #{"rlfe" "make" "git"}}
:debian {:build #{"curl"}
:runtime #{"rlwrap" "make" "git"}}
:runtime #{"rlfe" "make" "git"}}
:ubuntu {:build #{}
;; install curl as a runtime dep b/c we need it at build time
;; but upstream includes it so we don't want to uninstall it
:runtime #{"rlwrap" "make" "git" "curl"}}
:runtime #{"rlfe" "make" "git" "curl"}}
:alpine {:build #{"curl"}
:runtime #{"bash" "make" "git"}}})

Expand All @@ -24,9 +24,7 @@
(def uninstall-build-deps (partial uninstall-distro-build-deps distro-deps))

(def docker-bug-notice
["# Docker bug makes rlwrap crash w/o short sleep first"
"# Bug: https://github.com/moby/moby/issues/28009"
"# As of 2021-09-10 this bug still exists, despite that issue being closed"])
["# Custom \"clj\" script that uses rlfe instead of rlwrap"])

(defn install [installer-hashes {:keys [build-tool-version] :as variant}]
(let [install-dep-cmds (install-deps variant)
Expand All @@ -47,7 +45,7 @@
"clojure -e \"(clojure-version)\""] (empty? uninstall-dep-cmds))
(concat-commands uninstall-dep-cmds :end)
(concat [""] docker-bug-notice
["COPY rlwrap.retry /usr/local/bin/rlwrap"])
["COPY clj.sh /usr/local/bin/clj"])
(->> (remove nil?)))))

(defn command [{:keys [jdk-version]}]
Expand Down
8 changes: 3 additions & 5 deletions target/debian-bookworm-11/tools-deps/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ WORKDIR /tmp

RUN \
apt-get update && \
apt-get install -y curl make git rlwrap && \
apt-get install -y curl make git rlfe && \
rm -rf /var/lib/apt/lists/* && \
curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \
sha256sum linux-install-$CLOJURE_VERSION.sh && \
Expand All @@ -21,9 +21,7 @@ rm linux-install-$CLOJURE_VERSION.sh && \
clojure -e "(clojure-version)" && \
apt-get purge -y --auto-remove curl

# Docker bug makes rlwrap crash w/o short sleep first
# Bug: https://github.com/moby/moby/issues/28009
# As of 2021-09-10 this bug still exists, despite that issue being closed
COPY rlwrap.retry /usr/local/bin/rlwrap
# Custom "clj" script that uses rlfe instead of rlwrap
COPY clj.sh /usr/local/bin/clj

CMD ["clj"]
12 changes: 12 additions & 0 deletions target/debian-bookworm-11/tools-deps/clj.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

# This script acts as a replacement for "clj" script shipped with Clojure CLI
# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script
# and provide line editing abilities. This script uses rlfe instead of rlwrap
# for the same purpose. If rlfe is not installed, run regular "clojure" script.

if type rlfe; then
exec rlfe clojure "$@"
else
exec clojure "$@"
fi
30 changes: 0 additions & 30 deletions target/debian-bookworm-11/tools-deps/rlwrap.retry

This file was deleted.

8 changes: 3 additions & 5 deletions target/debian-bookworm-17/tools-deps/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ WORKDIR /tmp

RUN \
apt-get update && \
apt-get install -y curl make git rlwrap && \
apt-get install -y curl make git rlfe && \
rm -rf /var/lib/apt/lists/* && \
curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \
sha256sum linux-install-$CLOJURE_VERSION.sh && \
Expand All @@ -21,10 +21,8 @@ rm linux-install-$CLOJURE_VERSION.sh && \
clojure -e "(clojure-version)" && \
apt-get purge -y --auto-remove curl

# Docker bug makes rlwrap crash w/o short sleep first
# Bug: https://github.com/moby/moby/issues/28009
# As of 2021-09-10 this bug still exists, despite that issue being closed
COPY rlwrap.retry /usr/local/bin/rlwrap
# Custom "clj" script that uses rlfe instead of rlwrap
COPY clj.sh /usr/local/bin/clj

COPY entrypoint /usr/local/bin/entrypoint

Expand Down
12 changes: 12 additions & 0 deletions target/debian-bookworm-17/tools-deps/clj.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

# This script acts as a replacement for "clj" script shipped with Clojure CLI
# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script
# and provide line editing abilities. This script uses rlfe instead of rlwrap
# for the same purpose. If rlfe is not installed, run regular "clojure" script.

if type rlfe; then
exec rlfe clojure "$@"
else
exec clojure "$@"
fi
30 changes: 0 additions & 30 deletions target/debian-bookworm-17/tools-deps/rlwrap.retry

This file was deleted.

8 changes: 3 additions & 5 deletions target/debian-bookworm-21/latest/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ WORKDIR /tmp

RUN \
apt-get update && \
apt-get install -y curl make git rlwrap && \
apt-get install -y curl make git rlfe && \
rm -rf /var/lib/apt/lists/* && \
curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \
sha256sum linux-install-$CLOJURE_VERSION.sh && \
Expand All @@ -61,10 +61,8 @@ rm linux-install-$CLOJURE_VERSION.sh && \
clojure -e "(clojure-version)" && \
apt-get purge -y --auto-remove curl

# Docker bug makes rlwrap crash w/o short sleep first
# Bug: https://github.com/moby/moby/issues/28009
# As of 2021-09-10 this bug still exists, despite that issue being closed
COPY rlwrap.retry /usr/local/bin/rlwrap
# Custom "clj" script that uses rlfe instead of rlwrap
COPY clj.sh /usr/local/bin/clj

COPY entrypoint /usr/local/bin/entrypoint

Expand Down
12 changes: 12 additions & 0 deletions target/debian-bookworm-21/latest/clj.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

# This script acts as a replacement for "clj" script shipped with Clojure CLI
# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script
# and provide line editing abilities. This script uses rlfe instead of rlwrap
# for the same purpose. If rlfe is not installed, run regular "clojure" script.

if type rlfe; then
exec rlfe clojure "$@"
else
exec clojure "$@"
fi
30 changes: 0 additions & 30 deletions target/debian-bookworm-21/latest/rlwrap.retry

This file was deleted.

8 changes: 3 additions & 5 deletions target/debian-bookworm-21/tools-deps/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ WORKDIR /tmp

RUN \
apt-get update && \
apt-get install -y curl make git rlwrap && \
apt-get install -y curl make git rlfe && \
rm -rf /var/lib/apt/lists/* && \
curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \
sha256sum linux-install-$CLOJURE_VERSION.sh && \
Expand All @@ -21,10 +21,8 @@ rm linux-install-$CLOJURE_VERSION.sh && \
clojure -e "(clojure-version)" && \
apt-get purge -y --auto-remove curl

# Docker bug makes rlwrap crash w/o short sleep first
# Bug: https://github.com/moby/moby/issues/28009
# As of 2021-09-10 this bug still exists, despite that issue being closed
COPY rlwrap.retry /usr/local/bin/rlwrap
# Custom "clj" script that uses rlfe instead of rlwrap
COPY clj.sh /usr/local/bin/clj

COPY entrypoint /usr/local/bin/entrypoint

Expand Down
12 changes: 12 additions & 0 deletions target/debian-bookworm-21/tools-deps/clj.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

# This script acts as a replacement for "clj" script shipped with Clojure CLI
# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script
# and provide line editing abilities. This script uses rlfe instead of rlwrap
# for the same purpose. If rlfe is not installed, run regular "clojure" script.

if type rlfe; then
exec rlfe clojure "$@"
else
exec clojure "$@"
fi
30 changes: 0 additions & 30 deletions target/debian-bookworm-21/tools-deps/rlwrap.retry

This file was deleted.

8 changes: 3 additions & 5 deletions target/debian-bookworm-22/tools-deps/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ WORKDIR /tmp

RUN \
apt-get update && \
apt-get install -y curl make git rlwrap && \
apt-get install -y curl make git rlfe && \
rm -rf /var/lib/apt/lists/* && \
curl -fsSLO https://download.clojure.org/install/linux-install-$CLOJURE_VERSION.sh && \
sha256sum linux-install-$CLOJURE_VERSION.sh && \
Expand All @@ -21,10 +21,8 @@ rm linux-install-$CLOJURE_VERSION.sh && \
clojure -e "(clojure-version)" && \
apt-get purge -y --auto-remove curl

# Docker bug makes rlwrap crash w/o short sleep first
# Bug: https://github.com/moby/moby/issues/28009
# As of 2021-09-10 this bug still exists, despite that issue being closed
COPY rlwrap.retry /usr/local/bin/rlwrap
# Custom "clj" script that uses rlfe instead of rlwrap
COPY clj.sh /usr/local/bin/clj

COPY entrypoint /usr/local/bin/entrypoint

Expand Down
12 changes: 12 additions & 0 deletions target/debian-bookworm-22/tools-deps/clj.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

# This script acts as a replacement for "clj" script shipped with Clojure CLI
# (tools.deps) installation. Original "clj" uses rlwrap to wrap "clojure" script
# and provide line editing abilities. This script uses rlfe instead of rlwrap
# for the same purpose. If rlfe is not installed, run regular "clojure" script.

if type rlfe; then
exec rlfe clojure "$@"
else
exec clojure "$@"
fi
Loading