-
Notifications
You must be signed in to change notification settings - Fork 460
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
GIT_ATTRIBUTES massive slowdown in Spotless 6.6.0+ #1527
Comments
Wow! Thanks a lot for this trace, super useful. I bet that this will workaround your issue https://github.com/diffplug/spotless/tree/main/plugin-gradle#dependency-resolution-modes But the issue stands. Can you try |
Hi @nedtwigg , thanks for quick response. When I test recommended workaround: https://github.com/diffplug/spotless/tree/main/plugin-gradle#dependency-resolution-modes againts module with spotless 6.11 and defined
and root build.gradle like this:
I receive
which is weird to me as I defined ktlint in spotlessPredeclare. |
Hmm... SpotlessPredeclare definitely works, and it is possible that we'll need to make it mandatory for multimodule projects in the future. I'm not positive that it will fix the performance problem you have right now, but there's a decent chance that it will, so I think it's worth getting to the bottom of this. The issue about Like I said, decent chance that this will solve your performance problem, and working through this is useful for us because we need to make the error messages work well enough for people to figure out. The |
Thanks @nedtwigg . Tested on following command:
So predeclare doesn't seem to help much. Is there anything else I can provide or the bug is ready for your resolution? |
Thanks very much for the info! I'm pretty sure the problem is
Can you please run one last test? Change the line endings to one of spotless {
lineEndings 'PLATFORM_NATIVE'
... If that works, then we can justify putting a lot of work in to rewriting the way we handle |
We have the same issue on M1 Macbooks when applying spotless on our multi module project. Just performing a gradle sync takes more than 3 minutes when spotless is applied. Below 20 seconds if not. But it does not happen for all our developers. With a fresh setup and a new repo clone this does not happen. Maybe this has a different cause but the symptom is comparable. |
I can confirm that adding
is fixing the issue for us |
Git has opinions about line endings, and fighting that is a battle. That's why the default line endings are GIT_ATTRIBUTES. But a The fix is to do something similar to what we did with Such a massive slowdown is a high-priority thing to fix, I hope to solve this by next week. |
I was waiting for a reply from my collegue with Win notebook. He confirmed that Thanks @nedtwigg and @mlilienberg . |
Hello @nedtwigg , any updates on this? |
Hi @nedtwigg, do you have any estimate of the fix, please? |
// using idea found at // <diffplug/spotless#1527 (comment)>.
I believe this is now fixed in |
We have a custom Gradle plugin for spotless, bellow is a shortened (with relevant parts) version.
We use this custom plugin in other gradle projects. Once we upgraded spotless plugin to the version 6.6.0 onwards (including the latest 6.13.0) it causes us problems during build on Windows 11 platform. With the version 6.5.2 it works all right.
For example following command takes 1-5 seconds to finish (once all libraries are cached)
./gradlew buildEnvironment
But once we switch to Spotless version 6.6.0+ it takes 1-2 minutes to finish (even on repeated runs with everything cached)
The same happens with all build tasks like
./gradlew build -x test
Using:
Gradle 7.5.1 and Java 11
Windows 11 Pro - 22H2 (OS build: 22621.525), but happens on any Windows laptop (tested on 5 different Windows machines using Win 11)
NOTE1:
Now I found out that there is a delay even on Linux when switchnig from 5.5.2 to 6.6.0 version, but it is from 1 second to 7 seconds for the following task. On Windows however it takes minutes.
./gradlew buildEnvironment
NOTE2:
I was not able to see a big difference while running spotlessApply tasks.
NOTE3:
I tried to change jgit version versions (betweem 5.10 to latest) and it didn't help
I tried to inspect the gradle tasks using --debug option with spotless 6.6.0+ and bellow are some critical slow parts (there are big jumps between some of the log output):
The text was updated successfully, but these errors were encountered: