Skip to content
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

Strange STDOUT Issue With Hooks #201

Open
jamesward opened this issue Nov 24, 2020 · 1 comment
Open

Strange STDOUT Issue With Hooks #201

jamesward opened this issue Nov 24, 2020 · 1 comment

Comments

@jamesward
Copy link
Contributor

Reproduce with:
https://github.com/jamesward/springboot-kotlin-reactive-demo/tree/repro-stdout

When the build hook command runs it stops outputting after a few seconds, like:

[ ! ] Running command: ./gradlew --no-daemon --console=plain bootBuildImage --imageName=$IMAGE_URL
+ ./gradlew --no-daemon --console=plain bootBuildImage --imageName=gcr.io/jw-demo/springboot-kotlin-reactive-demo
Downloading https://services.gradle.org/distributions/gradle-6.7-bin.zip
.........10%!(NOVERB)

If I run the same command in Cloud Shell (not via Button) I get:

./gradlew --no-daemon --console=plain bootBuildImage --imageName=gcr.io/jw-de
mo/springboot-kotlin-reactive-demo
Downloading https://services.gradle.org/distributions/gradle-6.7-bin.zip
.........10%..........20%..........30%..........40%..........50%.........60%..........70%..........80%..........90%..........100
%
Welcome to Gradle 6.7!
...
@ahmetb
Copy link
Contributor

ahmetb commented Nov 24, 2020

I think that's basically gradlew (or whatever subprocess) not detecting that the STDOUT/STDERR is not a real TTY device, but continuing to print interactive progress and control characters.

A good way to test this is to run like command 2>&1 | tee file.txt, if you are still seeing the same output in the file.txt, then I think that program is not well-written to handle this case.

We could attach a pseudo-TTY to the commands, but it's less than ideal, as they could clear the screen etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants