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

[Issue] Could not determine if Stdout is a console. Wine #323

Open
bademux opened this issue Nov 5, 2022 · 1 comment
Open

[Issue] Could not determine if Stdout is a console. Wine #323

bademux opened this issue Nov 5, 2022 · 1 comment

Comments

@bademux
Copy link

bademux commented Nov 5, 2022

Hi,
It will be great if someone can help me with the problem (fix or overcome). Initially I want to do automation of jlink\jpackage on linux with Wine's help, but unfortunately build with gradle fails in docker.

The problem:
gradle fails on build when no (?) interactive terminal.
Steps to reproduce:
create Dockerfile as above and run with docker build .:

FROM alpine:3.16
RUN apk add --no-cache --update wine gradle --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing
RUN adduser -D user
WORKDIR /home/user
RUN wget https://api.adoptium.net/v3/binary/latest/19/ga/windows/x64/jdk/hotspot/normal/eclipse -O /tmp/jdk.zip && \
    mkdir -p $HOME/jdk && \
    unzip /tmp/jdk.zip -d /tmp && rm /tmp/jdk.zip && mv /tmp/jdk*/* $HOME/jdk
RUN gradle init
RUN JAVA_HOME="$(winepath -w $HOME/jdk)" wine64 cmd /c gradlew build --no-demon --no-watch-fs --stacktrace
* Exception is:
net.rubygrapefruit.platform.NativeException: Could not determine if Stdout is a console: could not get handle file information (errno 6)
        at net.rubygrapefruit.platform.internal.WindowsTerminals.getTypeForOutput(WindowsTerminals.java:68)
        at net.rubygrapefruit.platform.internal.WindowsTerminals.isTerminal(WindowsTerminals.java:27)
        at org.gradle.internal.nativeintegration.console.NativePlatformConsoleDetector.getConsole(NativePlatformConsoleDetector.java:42)
        at org.gradle.internal.nativeintegration.console.TestOverrideConsoleDetector.getConsole(TestOverrideConsoleDetector.java:38)
        at org.gradle.internal.logging.sink.ConsoleConfigureAction.getConsoleMetaData(ConsoleConfigureAction.java:50)
        at org.gradle.internal.logging.sink.ConsoleConfigureAction.execute(ConsoleConfigureAction.java:33)
        at org.gradle.internal.logging.sink.OutputEventRenderer.attachProcessConsole(OutputEventRenderer.java:148)
        at org.gradle.internal.logging.services.DefaultLoggingManager$ProcessConsoleAttachment.run(DefaultLoggingManager.java:391)
        at org.gradle.internal.logging.services.DefaultLoggingManager$StartableLoggingRouter.addConsoleAttachement(DefaultLoggingManager.java:269)
        at org.gradle.internal.logging.services.DefaultLoggingManager$StartableLoggingRouter.attachProcessConsole(DefaultLoggingManager.java:275)
        at org.gradle.internal.logging.services.DefaultLoggingManager.attachProcessConsole(DefaultLoggingManager.java:216)
        at org.gradle.launcher.cli.NativeServicesInitializingAction.execute(NativeServicesInitializingAction.java:43)
        at org.gradle.launcher.cli.NativeServicesInitializingAction.execute(NativeServicesInitializingAction.java:26)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:41)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:26)
        at org.gradle.launcher.cli.DefaultCommandLineActionFactory$WithLogging.execute(DefaultCommandLineActionFactory.java:240)
        at org.gradle.launcher.Main.doAction(Main.java:35)
        at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:50)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
        at java.base/java.lang.reflect.Method.invoke(Method.java:578)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:60)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:37)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
        at java.base/java.lang.reflect.Method.invoke(Method.java:578)
        at org.gradle.launcher.GradleMain.main(GradleMain.java:34)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
        at java.base/java.lang.reflect.Method.invoke(Method.java:578)
        at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:35)
        at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:108)
        at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:63)

Notes:
I can't find an answer to the question why gradle have to fail when Stdout in not console.

@bademux
Copy link
Author

bademux commented Nov 6, 2022

Found ugly hackfix with script, so stil open for discussion

ENV GRADLE_OPTS="-Dorg.gradle.caching=false -Dorg.gradle.caching.debug=false -Dorg.gradle.daemon=false -Dorg.gradle.configureondemand=false -Dorg.gradle.console=plain -Dorg.gradle.vfs.watch=false -Dorg.gradle.welcome=never"
RUN script --return --quiet -c "wine64 cmd /c gradlew.bat clean" /dev/null

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

1 participant