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

[Fix] Add --[no-]shrink instruction for release builds #11022

Merged
merged 4 commits into from
Aug 20, 2024

Conversation

piedcipher
Copy link
Member

@piedcipher piedcipher commented Aug 7, 2024

Add --[no-]shrink instruction for release builds.

Fixes: #10032

Presubmit checklist

  • This PR is marked as draft with an explanation if not meant to land until a future stable release.
  • This PR doesn’t contain automatically generated corrections (Grammarly or similar).
  • This PR follows the Google Developer Documentation Style Guidelines — for example, it doesn’t use i.e. or e.g., and it avoids I and we (first person).
  • This PR uses semantic line breaks of 80 characters or fewer.

@piedcipher piedcipher changed the title [Fix] Add --[no-]shrink insurrection for release builds [Fix] Add --[no-]shrink instruction for release builds Aug 7, 2024
@flutter-website-bot
Copy link
Collaborator

flutter-website-bot commented Aug 7, 2024

Visit the preview URL for this PR (updated for commit 2557808):

https://flutter-docs-prod--pr11022-fix-10032-lovf6unv.web.app

Copy link
Member

@parlough parlough left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working to address this older issue!

It seems like instead of having a note, this section needs to be removed or rewritten to not mention --[no-]shrink at all anymore.

@gmackall Is there anything still relevant to developers for shrinking? Is it sufficient to just tell them that Flutter runs shrinking on release builds and link to the Android shrink docs?

@parlough parlough requested a review from gmackall August 8, 2024 19:46
@gmackall
Copy link
Member

Thanks for working to address this older issue!

It seems like instead of having a note, this section needs to be removed or rewritten to not mention --[no-]shrink at all anymore.

@gmackall Is there anything still relevant to developers for shrinking? Is it sufficient to just tell them that Flutter runs shrinking on release builds and link to the Android shrink docs?

Sorry for missing this ping! Yes, that is correct. From what I can tell, the flag has been ignored since
flutter/flutter@8dd0de7#diff-3c44d2e8279ea8d917b4fb942252d4649689154c36cf74227a1a2a879aaf1915L328
Use of the Gradle property was brought back in
https://github.com/flutter/flutter/pull/76192/files#diff-3c44d2e8279ea8d917b4fb942252d4649689154c36cf74227a1a2a879aaf1915R384
to disable shrinking when building with deferred components, but not the ability to set the property (so it is only modified internally).

So

  1. The flag has no effect
  2. Shrinking is always enabled on release builds, except when building with deferred components.

Copy link
Contributor

@sfshaza2 sfshaza2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@sfshaza2 sfshaza2 merged commit 900f21b into flutter:main Aug 20, 2024
9 checks passed
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Aug 23, 2024
…m code" (#153868)

Re-lands #136880, fixes #136879.

Additions to/things that are different from the original PR:
- Adds an entry to `gradle_errors.dart` that tells people when they run into the R8 bug because of using AGP 7.3.0 (https://issuetracker.google.com/issues/242308990).
- Previous PR moved templates off of AGP 7.3.0.
- Packages repo has been moved off AGP 7.3.0 (flutter/packages#7432).

Also, unrelatedly:
- Deletes an entry in `gradle_errors.dart` that informed people to build with `--no-shrink`. This flag [doesn't do anything](flutter/website#11022 (comment)), so it can't be the solution to any error.
- Uniquely lowers the priority of the `incompatibleKotlinVersionHandler`. This is necessary because the ordering of the errors doesn't fully determine the priority of which handler we decide to use, but also the order of the log lines. The kotlin error lines often print before the other error lines, so putting it last in the list of handlers isn't sufficient to lower it to be the lowest priority handler.
@piedcipher piedcipher deleted the fix/10032 branch August 24, 2024 09:11
Buchimi pushed a commit to Buchimi/flutter that referenced this pull request Sep 2, 2024
…m code" (flutter#153868)

Re-lands flutter#136880, fixes flutter#136879.

Additions to/things that are different from the original PR:
- Adds an entry to `gradle_errors.dart` that tells people when they run into the R8 bug because of using AGP 7.3.0 (https://issuetracker.google.com/issues/242308990).
- Previous PR moved templates off of AGP 7.3.0.
- Packages repo has been moved off AGP 7.3.0 (flutter/packages#7432).

Also, unrelatedly:
- Deletes an entry in `gradle_errors.dart` that informed people to build with `--no-shrink`. This flag [doesn't do anything](flutter/website#11022 (comment)), so it can't be the solution to any error.
- Uniquely lowers the priority of the `incompatibleKotlinVersionHandler`. This is necessary because the ordering of the errors doesn't fully determine the priority of which handler we decide to use, but also the order of the log lines. The kotlin error lines often print before the other error lines, so putting it last in the list of handlers isn't sufficient to lower it to be the lowest priority handler.
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

Successfully merging this pull request may close these issues.

'--no-shrink' flag documentation is out of date
6 participants