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

Console output defaults to plain on Linux starting with Gradle 8.12 #32006

Closed
britter opened this issue Jan 14, 2025 · 7 comments
Closed

Console output defaults to plain on Linux starting with Gradle 8.12 #32006

britter opened this issue Jan 14, 2025 · 7 comments
Labels
closed:invalid Not applicable to Gradle or EOL version

Comments

@britter
Copy link
Contributor

britter commented Jan 14, 2025

Current Behavior

When running a build with Gradle 8.12 on Linux the console output type is plain by default. Only if specifying --console=rich the output is rendered using the rich console.

Image

Expected Behavior

When running a build without specifying the console output type it should default to the rich console output.

Context (optional)

No response

Self-contained Reproducer Project

This is unrelated to the project. Use any project generated with gradle init and compare the output between Gradle 8.12 and 8.11.1.

Gradle version

8.12

Gradle version that used to work

8.11.1

Build scan URL (optional)

https://scans.gradle.com/s/dcoyey2rj5qf2

Your Environment (optional)

❯ uname -a
Linux pulse-14 6.6.69 #1-NixOS SMP PREEMPT_DYNAMIC Thu Jan  2 09:32:11 UTC 2025 x86_64 GNU/Linux
❯ nix run nixpkgs#fastfetch
          ▗▄▄▄       ▗▄▄▄▄    ▄▄▄▖             bene@pulse-14
          ▜███▙       ▜███▙  ▟███▛             -------------
           ▜███▙       ▜███▙▟███▛              OS: NixOS 24.11.20250105.cbd8ec4 (Vicuna) x86_64
            ▜███▙       ▜██████▛               Host: TUXEDO Pulse 14 Gen3 (Version 1.0)
     ▟█████████████████▙ ▜████▛     ▟▙         Kernel: Linux 6.6.69
    ▟███████████████████▙ ▜███▙    ▟██▙        Uptime: 16 mins
           ▄▄▄▄▖           ▜███▙  ▟███▛        Packages: 1956 (nix-system)
          ▟███▛             ▜██▛ ▟███▛         Shell: fish 3.7.1
         ▟███▛               ▜▛ ▟███▛          Display (TMA2004): 2880x1800 @ 120 Hz (as 1440x900) in 14" [Built-in]
▟███████████▛                  ▟██████████▙    Display (LG HDR 4K): 3840x2160 @ 60 Hz (as 2560x1440) in 32" [External]
▜██████████▛                  ▟███████████▛    WM: Sway (Wayland)
      ▟███▛ ▟▙               ▟███▛             Cursor: catppuccin-macchiato-dark (32px)
     ▟███▛ ▟██▙             ▟███▛              Terminal: alacritty 0.14.0
    ▟███▛  ▜███▙           ▝▀▀▀▀               Terminal Font: FiraCode Nerd Font (9pt)
    ▜██▛    ▜███▙ ▜██████████████████▛         CPU: AMD Ryzen 7 7840HS w/ Radeon 780M Graphics (16) @ 5.14 GHz
     ▜▛     ▟████▙ ▜████████████████▛          GPU: AMD Radeon 780M [Integrated]
           ▟██████▙       ▜███▙                Memory: 11.10 GiB / 25.25 GiB (44%)
          ▟███▛▜███▙       ▜███▙               Swap: 0 B / 31.98 GiB (0%)
         ▟███▛  ▜███▙       ▜███▙              Disk (/): 316.09 GiB / 899.00 GiB (35%) - btrfs
         ▝▀▀▀    ▀▀▀▀▘       ▀▀▀▘              Local IP (wlp1s0): 192.168.178.118/24
                                               Battery (SR Real Battery): 97% [AC Connected]
                                               Locale: en_US.utf-8
@britter britter added a:regression This used to work to-triage labels Jan 14, 2025
@britter britter changed the title Console output defaults to plain on Linux starting with 8.12 Console output defaults to plain on Linux starting with Gradle 8.12 Jan 14, 2025
@tbroyer
Copy link
Contributor

tbroyer commented Jan 14, 2025

Fwiw, I don't have that problem on my side ("works on my machine")

$ ./gradlew --version

------------------------------------------------------------
Gradle 8.12
------------------------------------------------------------

Build time:    2024-12-20 15:46:53 UTC
Revision:      a3cacb207fec727859be9354c1937da2e59004c1

Kotlin:        2.0.21
Groovy:        3.0.22
Ant:           Apache Ant(TM) version 1.10.15 compiled on August 25 2024
Launcher JVM:  21.0.5 (Arch Linux 21.0.5+11)
Daemon JVM:    /usr/lib/jvm/java-21-openjdk (no JDK specified, using current Java home)
OS:            Linux 6.12.9-arch1-1 amd64

@sschuberth
Copy link
Contributor

sschuberth commented Jan 14, 2025

Color output works fine here, too, with Gradle 8.12 on Fedora Linux 41 (KDE spin, Konsole application).

What's your TERM environment variable, @britter?

@ov7a ov7a added the pending:feedback Indicates that changes or additional info are required, and the issue will be closed without them label Jan 14, 2025
@britter
Copy link
Contributor Author

britter commented Jan 14, 2025

@sschuberth my TERM variable is either alacritty or tmux-256color depending on whether I'm in a tmux session. Is doesn't work for either TERM variable setting on Gradle 8.12.

@sschuberth
Copy link
Contributor

I tried both like TERM=alacritty ./gradlew tasks and I do get colored output. My regular TERM value is tmux-256color as well.

@github-actions github-actions bot removed the pending:feedback Indicates that changes or additional info are required, and the issue will be closed without them label Jan 14, 2025
@ljacomet
Copy link
Member

Given that others cannot reproduce, we need more information to understand what's causing this. Getting NixOS setup is not something we can do right now.

@ljacomet ljacomet added the pending:feedback Indicates that changes or additional info are required, and the issue will be closed without them label Jan 15, 2025
@britter
Copy link
Contributor Author

britter commented Jan 15, 2025

I tried to get to the bottom of this but had no luck analyzing the issue. I tried running builds with ./gradlew tasks --no-daemon -Dorg.gradle.debug=true and then set break point in different places.

First I set a break point in DefaultLoggingConfiguration#setConsoleOutput to see whether that is initialized the wrong way, but it's initialized with Auto.

Then I tried to figure out how Auto is process by setting a break point in ConsoleConfigureAction#execute but it never stopped there.

I tried setting a break point in the initialization of the AnsiConsole but again it never stopped there.

I don't understand why it never hits the relevant break points, so right now I don't know how to continue.

@github-actions github-actions bot removed the pending:feedback Indicates that changes or additional info are required, and the issue will be closed without them label Jan 15, 2025
@britter
Copy link
Contributor Author

britter commented Jan 15, 2025

This is a NixOS specific problem that is related to patching native libraries, see NixOS/nixpkgs#356109 (comment). It will be fixed once that PR is merged.

@britter britter closed this as not planned Won't fix, can't repro, duplicate, stale Jan 15, 2025
@ljacomet ljacomet added closed:invalid Not applicable to Gradle or EOL version and removed a:regression This used to work to-triage labels Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed:invalid Not applicable to Gradle or EOL version
Projects
None yet
Development

No branches or pull requests

5 participants