google / google-java-format

Reformats Java source code to comply with Google Java Style.
Other
5.61k stars 854 forks source link

Weird behavor when running on Windows #946

Closed Asapin closed 1 year ago

Asapin commented 1 year ago

I tried to run GJF gradle task from PowerShell on Windows, but for some reason it forced PowerShell to spawn a new processes every second until I had over 700 PowerShell processes that consumed over 24 GB of RAM before crashing.

image

(I use WezTerm to run PowerShell, but the situation is the same when I use PowerShell directly).

The project in question: https://github.com/uber/NullAway Command I used: ./gradlew googleJavaFormat OS: Windows 11 Pro, Version 22H2, OS build 22621.1848

Then I tried to run the same GJF gradle task directly from Intellij IDEA's Gradle window. This time the task finished in ~2 seconds with the message

> Task :googleJavaFormat FAILED

Detected Java syntax errors in the following files (you can exclude them from this task, see "https://github.com/sherter/google-java-format-gradle-plugin" for details):

And then it prints the list of almost every source file that exists in the project.

I also tried to run ./gradlew googleJavaFormat from WSL Ubuntu on the same system, and in Ubuntu I also got the same > Task :googleJavaFormat FAILED message with the list of all source files in the project

cushon commented 1 year ago

It looks like that project is using https://github.com/sherter/google-java-format-gradle-plugin

https://github.com/uber/NullAway/blob/1ff88b64e527cdb529f5df38ab5ade8dc01b0352/build.gradle#L38