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

[macos] native_assets_test.dart: flutter run hot reload and hot restart with native assets macos debug is flaky #148955

Closed
knopp opened this issue May 23, 2024 · 8 comments
Assignees
Labels
a: assets Packaging, accessing, or using assets Bot is counting down the days until it unassigns the issue P1 High-priority issues at the top of the work list platform-mac Building on or for macOS specifically t: hot reload Reloading code during "flutter run" team-tool Owned by Flutter Tool team tool Affects the "flutter" command-line tool. See also t: labels.

Comments

@knopp
Copy link
Member

knopp commented May 23, 2024

Integration test sometimes fails with

34:35 +84 ~1 -2: test/integration.shard/isolated/native_assets_test.dart: flutter run hot reload and hot restart with native assets macos debug [E]
  Expected: not contains 'Invalid argument(s): Couldn\'t resolve native function \'sum\''
    Actual: 'warning: Run script build phase \'Run Script\' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target \'Flutter Assemble\' from project \'Runner\')\n'
              'Performing hot reload...                                        \n'
              'The Flutter DevTools debugger and profiler on macOS is available at: http://127.0.0.1:9106?uri=http://127.0.0.1:53308/xYohxuqAUcQ=/\n'
              'Reloaded 0 libraries in 520ms (compile: 8 ms, reload: 0 ms, reassemble: 492 ms).\n'
              '\n'
              'Performing hot restart...                                       \n'
              'Restarted application in 5,343ms.\n'
              '\n'
              'Performing hot reload...                                        \n'
              '\n'
              '══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════\n'
              'The following ArgumentError was thrown building _FocusInheritedScope:\n'
              'Invalid argument(s): Couldn\'t resolve native function \'sum\' in\n'
              '\'package:package_with_native_assets/package_with_native_assets_bindings_generated.dart\' : Failed to\n'
              'load dynamic library \'package_with_native_assets1.framework/package_with_native_assets1\': Failed to\n'
              'load dynamic library \'package_with_native_assets1.framework/package_with_native_assets1\':\n'
              'dlopen(package_with_native_assets1.framework/package_with_native_assets1, 0x0001): tried:\n'
              '\'package_with_native_assets1.framework/package_with_native_assets1\' (no such file),\n'
              '\'/System/Volumes/Preboot/Cryptexes/OSpackage_with_native_assets1.framework/package_with_native_assets1\'\n'
              '(no such file),\n'

I'm unable to reproduce this locally.

@knopp
Copy link
Member Author

knopp commented May 23, 2024

cc @dcharkes

@huycozy huycozy added in triage Presently being triaged by the triage team tool Affects the "flutter" command-line tool. See also t: labels. platform-mac Building on or for macOS specifically t: hot reload Reloading code during "flutter run" a: assets Packaging, accessing, or using assets team-tool Owned by Flutter Tool team and removed in triage Presently being triaged by the triage team labels May 24, 2024
@dcharkes
Copy link
Contributor

I have run the test multiple times locally, but I am also unable to reproduce this.

If it's flaky, the Flutter CI should not notice and file a P0 issue and assign it to me (I'm the test owner).

@knopp
Copy link
Member Author

knopp commented May 24, 2024

I opened this in case you have any idea what this could be caused by. It looks like a potential issue with duplicate framework name prevention (package_with_native_assets1.framework), but in macos/debug there's only one architecture so I don't quite see the codepath that could be causing this.

@jmagman jmagman added the P1 High-priority issues at the top of the work list label Jun 4, 2024
@dcharkes
Copy link
Contributor

dcharkes commented Jun 5, 2024

I can't reproduce this locally, but inspecting the temp folder unit test yields:

format-version:
  - 1
  - 0
  - 0
native-assets:
  macos_arm64:
    package:package_with_native_assets/package_with_native_assets_bindings_generated.dart:
      - absolute
      - package_with_native_assets.framework/package_with_native_assets
    package:link_hook/link_hook_bindings_generated.dart:
      - absolute
      - link_hook.framework/link_hook
  macos_x64:
    package:package_with_native_assets/package_with_native_assets_bindings_generated.dart:
      - absolute
      - package_with_native_assets1.framework/package_with_native_assets1
    package:link_hook/link_hook_bindings_generated.dart:
      - absolute
      - link_hook1.framework/link_hook1

I'm thinking that somehow the order of architectures gets switched during hot reload or hot restart on the bot, causing the two different names to swap archs.

Now, these shouldn't be different names to begin with. This was recently fixed in iOS (02d5286), but not in MacOS. I've created #149761 to address this.

auto-submit bot pushed a commit that referenced this issue Jun 7, 2024
Applies 02d5286 to MacOS.

I'm hoping this will fix:

* #148955
@flutter-triage-bot flutter-triage-bot bot added the Bot is counting down the days until it unassigns the issue label Oct 9, 2024
@flutter-triage-bot
Copy link

This issue is assigned to @dcharkes but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks!

@dcharkes
Copy link
Contributor

I believe the mentioned commit fixed it, the bot is no longer red: https://ci.chromium.org/ui/p/flutter/builders/prod/Mac%20tool_integration_tests_4_4

Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: assets Packaging, accessing, or using assets Bot is counting down the days until it unassigns the issue P1 High-priority issues at the top of the work list platform-mac Building on or for macOS specifically t: hot reload Reloading code during "flutter run" team-tool Owned by Flutter Tool team tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

No branches or pull requests

4 participants