Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add more entry-point annotations for test-only code. #160421

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

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

sstrickl
Copy link
Contributor

This change adds entry-point annotations to methods and classes accessed by native code during Flutter tests. Currently, entry point annotations are not checked by the Dart VM when running in JIT mode, only in AOT mode. In order to also enforce entry point annotations in JIT mode, first tests in Flutter must be appropriately annotated to avoid roll failures.

Related issues:

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos f: routes Navigator, Router, and related APIs. labels Dec 17, 2024
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!).

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. The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@sstrickl
Copy link
Contributor Author

The examples where the annotations are added are used in separately written tests under examples/api/test, which is why no tests were directly touched by this commit. I've verified with a local run of dev/bots/test.dart that these pragmas allow the tests to run to completion successfully when the --verify-entry-points flag is enabled by default in JIT mode.

@sstrickl sstrickl added this pull request to the merge queue Dec 17, 2024
Merged via the queue into flutter:master with commit ddc0866 Dec 17, 2024
39 checks passed
@sstrickl sstrickl deleted the add-pragmas-redux branch December 17, 2024 11:42
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 17, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 17, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 17, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 17, 2024
copybara-service bot pushed a commit to dart-lang/sdk that referenced this pull request Dec 18, 2024
Now that Flutter tests that access entry points from native code
have been annotated[1], we can turn on entry point checking in JIT
mode.

This CL also removes the A flag category from flag_list.h and the
AOT_FLAG_MACRO definitions and uses from flags.[cc,h], as they were
created as a temporary measure until this flag could be unconditionally
defaulted to true.

[1] See the following PRs:
* flutter/engine#57158
* flutter/flutter#160158
* flutter/flutter#160421

TEST=vm/dart/entrypoints_verification_test vm/cc/IRTest
     vm/cc/StreamingFlowGraphBuilder vm/cc/STC vm/cc/TTS

Issue: #50649
Issue: flutter/flutter#118608

Cq-Include-Trybots: luci.dart.try:vm-aot-linux-product-x64-try,vm-aot-linux-debug-x64-try,vm-aot-mac-release-arm64-try,vm-aot-mac-product-arm64-try,vm-aot-dwarf-linux-product-x64-try,vm-linux-debug-x64-try,vm-linux-release-x64-try,vm-appjit-linux-product-x64-try
Change-Id: Ibe5b21bb74f1a6fb88824b71ff87b9e555216dbf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/400301
Reviewed-by: Martin Kustermann <[email protected]>
Commit-Queue: Tess Strickland <[email protected]>
copybara-service bot pushed a commit to dart-lang/sdk that referenced this pull request Dec 19, 2024
This reverts commit 982b9fa.

Reason for revert: b/385114574

Original change's description:
> [vm] Turn on entry point checking in JIT mode.
>
> Now that Flutter tests that access entry points from native code
> have been annotated[1], we can turn on entry point checking in JIT
> mode.
>
> This CL also removes the A flag category from flag_list.h and the
> AOT_FLAG_MACRO definitions and uses from flags.[cc,h], as they were
> created as a temporary measure until this flag could be unconditionally
> defaulted to true.
>
> [1] See the following PRs:
> * flutter/engine#57158
> * flutter/flutter#160158
> * flutter/flutter#160421
>
> TEST=vm/dart/entrypoints_verification_test vm/cc/IRTest
>      vm/cc/StreamingFlowGraphBuilder vm/cc/STC vm/cc/TTS
>
> Issue: #50649
> Issue: flutter/flutter#118608
>
> Cq-Include-Trybots: luci.dart.try:vm-aot-linux-product-x64-try,vm-aot-linux-debug-x64-try,vm-aot-mac-release-arm64-try,vm-aot-mac-product-arm64-try,vm-aot-dwarf-linux-product-x64-try,vm-linux-debug-x64-try,vm-linux-release-x64-try,vm-appjit-linux-product-x64-try
> Change-Id: Ibe5b21bb74f1a6fb88824b71ff87b9e555216dbf
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/400301
> Reviewed-by: Martin Kustermann <[email protected]>
> Commit-Queue: Tess Strickland <[email protected]>

Issue: #50649
Issue: flutter/flutter#118608
Change-Id: Id403cd0832807e417202e17dac57c2224cab09e7
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-product-x64-try,vm-aot-linux-debug-x64-try,vm-aot-mac-release-arm64-try,vm-aot-mac-product-arm64-try,vm-aot-dwarf-linux-product-x64-try,vm-linux-debug-x64-try,vm-linux-release-x64-try,vm-appjit-linux-product-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/401880
Bot-Commit: Rubber Stamper <[email protected]>
Reviewed-by: Martin Kustermann <[email protected]>
Commit-Queue: Ivan Inozemtsev <[email protected]>
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 6, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 6, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 6, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 7, 2025
copybara-service bot pushed a commit to dart-lang/sdk that referenced this pull request Jan 8, 2025
This is a reland of commit 982b9fa

Original change's description:
> [vm] Turn on entry point checking in JIT mode.
>
> Now that Flutter tests that access entry points from native code
> have been annotated[1], we can turn on entry point checking in JIT
> mode.
>
> This CL also removes the A flag category from flag_list.h and the
> AOT_FLAG_MACRO definitions and uses from flags.[cc,h], as they were
> created as a temporary measure until this flag could be unconditionally
> defaulted to true.
>
> [1] See the following PRs:
> * flutter/engine#57158
> * flutter/flutter#160158
> * flutter/flutter#160421
>
> TEST=vm/dart/entrypoints_verification_test vm/cc/IRTest
>      vm/cc/StreamingFlowGraphBuilder vm/cc/STC vm/cc/TTS
>
> Issue: #50649
> Issue: flutter/flutter#118608
>
> Cq-Include-Trybots: luci.dart.try:vm-aot-linux-product-x64-try,vm-aot-linux-debug-x64-try,vm-aot-mac-release-arm64-try,vm-aot-mac-product-arm64-try,vm-aot-dwarf-linux-product-x64-try,vm-linux-debug-x64-try,vm-linux-release-x64-try,vm-appjit-linux-product-x64-try
> Change-Id: Ibe5b21bb74f1a6fb88824b71ff87b9e555216dbf
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/400301
> Reviewed-by: Martin Kustermann <[email protected]>
> Commit-Queue: Tess Strickland <[email protected]>

TEST=vm/dart/entrypoints_verification_test vm/cc/IRTest
     vm/cc/StreamingFlowGraphBuilder vm/cc/STC vm/cc/TTS

Change-Id: Ibd5f362f908b4aaa68cda870a387c081537bbc16
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-product-x64-try,vm-aot-linux-debug-x64-try,vm-aot-mac-release-arm64-try,vm-aot-mac-product-arm64-try,vm-aot-dwarf-linux-product-x64-try,vm-linux-debug-x64-try,vm-linux-release-x64-try,vm-appjit-linux-product-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/403360
Auto-Submit: Ivan Inozemtsev <[email protected]>
Commit-Queue: Ivan Inozemtsev <[email protected]>
Reviewed-by: Martin Kustermann <[email protected]>
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 8, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 8, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 8, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 8, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 12, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 13, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 13, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 6, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos f: routes Navigator, Router, and related APIs. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants