Closed LeonardMeyer closed 4 years ago
Hi @LeonardMeyer Thanks for your detailed report :heart_eyes:
The output of cli tools to the wrong logger is also an issue on RPM. My understanding at the time was that rpm
wrote to stderr
, which causes this and there wasn't much to do, other than just sending everything to stdout
, which felt wrong as stderr
is supposed for errors (I guess :sweat_smile: ).
Making the logger a setting could be an option, but usually folks don't like to dig down into sbt :joy: So I would go for a "fix if DOCKER_BUILDKIT" is set. I have a feeling that this going to cause a lot of trouble either way in the future and the option to check if it's enabled or not is helpful.
What would you suggest for a fix? The simplest solution would be to "if DOCKER_BUILDKIT == 1 then log everything in stderr as info"
Yes I was thinking of something similar. Just detect if the env var is set and change logger accordingly. I know sbt-release is using a custom logger for Git too, which exhibits the same behavior. I can put together a PR if you want, when I can find the time.
Sorry I don't understand. Is there a fix for this? It's still happening to me on sbt-native-packager 1.9.11
@kovacshuni If you've set the DOCKER_BUILDKIT
to 1
it should work. Either that or something changed ?
works. In my GitHub Actions I put:
- name: Push docker image to Google Artifact Registry
env:
DOCKER_BUILDKIT: 1
run: sbt Docker/publish
Expected behaviour
When BuildKit is used to build the docker images, lines are output to the proper log level.
Actual behaviour
When BuildKit is used to build the docker images, everything is logged using
log.error(...)
. The problem does not come from sbt-native-packager but from BuildKit itself, which outputs most of its stuff to stderr. See this issue.Maybe we could make the publishLocalLogger used in the publishLocal task a setting ? Or Just make the DockerPlugin supports
DOCKER_BUILDKIT
env var ?Information
rpm --version
) : 19.03.13 local and 18.03 on CI