Closed esamson closed 11 months ago
I've some questions.
Do you get the same output if you run scalafmt --non-interactive
yourself? How do you run Scala Steward? Who installed that scalafmt
that Scala Steward calls? This line bash: line 1: tput: command not found
looks strange since Scala Steward does not just dump the output of external processes to its log or stdout. Is this reproducible? If yes, does running Scala Steward with TRACE
log level give more clues? Searching the internet for "tput: command not found"
yields some results. Did they help narrowing this issue or giving some clues?
Running scalafmt --non-interactive
myself doesn't output that line.
I run the docker image using podman against a gitea instance with this script:
#!/usr/bin/env bash
DIR="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
IMAGE=fthomas/scala-steward:latest
NAME="Scala Steward"
EMAIL=steward@gitea.at.home
LOGIN=me
mkdir -p "$DIR/workspace"
podman run \
--volume $DIR:/opt/scala-steward:Z \
--interactive \
--tty \
$IMAGE \
--workspace "/opt/scala-steward/workspace" \
--repos-file "/opt/scala-steward/repos.md" \
--git-author-name "${NAME}" \
--git-author-email ${EMAIL} \
--git-ask-pass "/opt/scala-steward/askpass.sh" \
--forge-type gitea \
--forge-api-host "https://gitea.at.home/api/v1" \
--forge-login ${LOGIN} \
--do-not-fork
It is reproducible. TRACE logs don't add much. I guess it does point to the scalafmt --non-interactive
invocation.
2023-07-24 03:06:23,326 INFO Executing post-update hook for org.scalameta:scalafmt-core with command 'scalafmt --non-interactive'
2023-07-24 03:06:23,328 DEBUG Execute scalafmt --non-interactive
2023-07-24 03:06:25,274 TRACE Reformatting...
bash: line 1: tput: command not found
2023-07-24 03:06:26,313 TRACE Reformatting...
2023-07-24 03:06:27,366 TRACE
My searches lead me to think it has something to do with using alpine as the base docker image and tput
not being available there.
Thanks for your investigation! I think you're spot on with tput
not being available in the Docker image. Scalafmt uses it in https://github.com/scalameta/scalafmt/blob/bf26e016f2d47e0634e0f49b699634be2e9be628/scalafmt-cli/src/main/scala/org/scalafmt/cli/TermDisplay.scala#L34.
There are a couple of options how we could handle this:
tput
to the Docker image here. (This is probably the easiest solution)tput
by removing the TERM
env var in our scalafmt invocationstput
is not installed
I noticed this bash error when there's a scalafmt update.