-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
Fix IDE Gradle sync being slow because of lockfile generation #147837
base: master
Are you sure you want to change the base?
Fix IDE Gradle sync being slow because of lockfile generation #147837
Conversation
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
Some notes/questions:
cc gradle gurus @GaryQian @gmackall @reidbaker |
I don't know the answer to most of these off the top of my head. IIRC flutter 2.* used a beta gradle feature to generateLockfiles which has since been made stable but the activation might have a different name than the preview feature. @jwren could you point me towards the code that run in Intellij when we sync gradle files? If so then I can dig into the differences between the IDE behavior and the command line behavior and give a command line equivalent. |
Is this ready for review? Happy to take a look if so, but just want to be sure because the PR is still in draft |
Added you for the discussion on #147837 (comment) |
@reidbaker we have a dart cli which calls gradle on our behalf, cli tool is here: https://github.com/flutter/flutter-intellij/tree/master/tool/plugin |
Thank you @jwren! @bartekpacia let me dig in this week and give you better answers. |
Thanks a ton, this looks like a good starting point. @reidbaker thanks! If you're busy though, don't bother really, I'll do it myself and if I fail, then I'll ping you back:) |
We've found that this actually gets into an infinite loop if we have a plugin added in an init script in the gradle home directory, the Flutter plugin gets applied to the |
I can confirm that your fix fixes the infinite loop problem too. Additional interesting find is that the task
I'd say no?
Yes, exactly what we're seeing |
After further digging, I've found that our plugin evaluates the project's tasks, which triggers the
Just run |
I just talked with @runningcode, a Gradle engineer, on droidcon Berlin and asked him how we can trigger Gradle Sync without an IDE (so we can actually test that our fix will work). He suggested using https://github.com/gradle/gradle-profiler. It has a lot of various config options, some of the ones we might wanna take a look at are Thanks a lot @runningcode! :) |
(PR Triage): Hey @bartekpacia do you have plans to continue with this PR? Thanks! |
Hey @Piinks! Yes I do! |
977fa26
to
59119a5
Compare
Some notesWill likely have to create a scenario file. gradle-profiler --benchmark --scenario-file performance.scenarios clean_build See also |
I lost way too much time waiting for Gradle syncs to finish because of this problem, so I decided to take a stab at it.
This PR attempts to fix #110559
Revival of #112723
Pre-launch Checklist
///
).