Skip to content

Conversation

@temeddix
Copy link
Contributor

@temeddix temeddix commented Jul 23, 2023

image

In most cases, a FFI plugin doesn't need its own specific Android NDK version. Just following the Flutter app project's NDK version is enough.

If a Flutter app project depends on multiple FFI plugins that use different Android NDK versions, it can be quite wasteful and use excessive disk space due to multiple NDK installations.

Using Flutter app project's NDK version is also less error-prone because upgrading the Flutter SDK would be enough when upgrading FFI plugins(If project's ndkVersion is flutter.ndkVersion), without messing with Android NDK installations.

This problem was discussed in some actual FFI plugin repositories, and they are striving to find their own solutions:

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

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

@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 to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on 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.

@github-actions github-actions bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Jul 23, 2023
@Hixie
Copy link
Contributor

Hixie commented Jul 23, 2023

test-exempt: configuration change

@temeddix temeddix changed the title Use Flutter project's NDK version from FFI plugin Use Flutter app project's NDK version from FFI plugin Jul 23, 2023
@christopherfujino
Copy link
Contributor

@dcharkes is this a safe change to make?

@dcharkes
Copy link
Contributor

dcharkes commented Jul 28, 2023

Here is all the discussion on it when landing support for FFI plugins: NDK versioning doc.

Reading the doc and comments, we went for specifying the value in the plugin so that the plugins specify a lower bound and added logic to check that the app NDK version as at least as new as the plugins. If plugin authors still need a lower bound they can follow the comment that is added to the template.

In most cases, a FFI plugin doesn't need its own specific Android NDK version.

In the mentioned doc we note the same.

I believe this change to be safe. (Plugin authors who do need an NDK lower bound, need to read that comment and manually put in an NDK version, or their example app will immediately fail if it lists a too low NDK version.)

@dcharkes dcharkes added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 28, 2023
@auto-submit
Copy link
Contributor

auto-submit bot commented Jul 28, 2023

auto label is removed for flutter/flutter, pr: 131141, due to This PR has not met approval requirements for merging. You are not a member of flutter-hackers and need 1 more review(s) in order to merge this PR.

  • Merge guidelines: You need at least one approved review if you are already part of flutter-hackers or two member reviews if you are not a flutter-hacker before re-applying the autosubmit label. Reviewers: If you left a comment approving, please use the "approve" review action instead.

@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jul 28, 2023
@christopherfujino
Copy link
Contributor

Here is all the discussion on it when landing support for FFI plugins: NDK versioning doc.

Reading the doc and comments, we went for specifying the value in the plugin so that the plugins specify a lower bound and added logic to check that the app NDK version as at least as new as the plugins. If plugin authors still need a lower bound they can follow the comment that is added to the template.

In most cases, a FFI plugin doesn't need its own specific Android NDK version.

In the mentioned doc we note the same.

I believe this change to be safe. (Plugin authors who do need an NDK lower bound, need to read that comment and manually put in an NDK version, or their example app will immediately fail if it lists a too low NDK version.)

Thanks

Copy link
Contributor

@christopherfujino christopherfujino left a comment

Choose a reason for hiding this comment

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

LGTM

@christopherfujino christopherfujino added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 28, 2023
@auto-submit
Copy link
Contributor

auto-submit bot commented Jul 28, 2023

auto label is removed for flutter/flutter, pr: 131141, due to - The status or check suite Mac framework_tests_libraries has failed. Please fix the issues identified (or deflake) before re-applying this label.

@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jul 28, 2023
@temeddix
Copy link
Contributor Author

@christopherfujino It looks like auto label was remove due to this error #131141 (comment). Would you mind handling this again?

@dcharkes dcharkes added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 31, 2023
@auto-submit auto-submit bot merged commit c05c3d3 into flutter:master Jul 31, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 31, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 31, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 31, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 31, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 31, 2023
LouiseHsu pushed a commit to LouiseHsu/flutter that referenced this pull request Jul 31, 2023
<img width="1119" alt="image" src="https://github.com/flutter/flutter/assets/66480156/e2e8eed1-3bef-436c-b21f-3891bdbe05bb">

In most cases, a FFI plugin doesn't need its own specific Android NDK version. Just following the Flutter app project's NDK version is enough.

If a Flutter app project depends on multiple FFI plugins that use different Android NDK versions, it can be quite wasteful and use excessive disk space due to multiple NDK installations.

Using Flutter app project's NDK version is also less error-prone because upgrading the Flutter SDK would be enough when upgrading FFI plugins(If project's `ndkVersion` is `flutter.ndkVersion`), without messing with Android NDK installations.

This problem was discussed in some actual FFI plugin repositories, and they are striving to find their own solutions:
- superlistapp/super_native_extensions#143 (comment)
- cunarist/rinf#60 (comment)
- rive-app/rive-flutter#320
- juicycleff/flutter-unity-view-widget#832
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 31, 2023
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Aug 1, 2023
Manual roll requested by [email protected]

flutter/flutter@1d44fbd...1d59196

2023-07-31 [email protected] Appended period remove & Uri parsing fix. (flutter/flutter#131293)
2023-07-31 [email protected] Fixed regex to show missing assets file error (flutter/flutter#131160)
2023-07-31 [email protected] Update `CheckboxListTile` and `CalendarDatePicker` tests for M2/M3 (flutter/flutter#131363)
2023-07-31 [email protected] Reland --omit-type-checks for benchmarks. (flutter/flutter#131493)
2023-07-31 [email protected] Update the cirrus key jul-31-2023 (flutter/flutter#131624)
2023-07-31 [email protected] Add Expanded/Collapsed State for Semantics (flutter/flutter#131233)
2023-07-31 [email protected] Reland - "Update Unit Tests for M2/M3" (flutter/flutter#131504)
2023-07-31 [email protected] Roll Flutter Engine from ae6d1d60df95 to b83172a4e995 (4 revisions) (flutter/flutter#131614)
2023-07-31 [email protected] Upgrade compile and target sdk versions in tests and benchmarks (flutter/flutter#131428)
2023-07-31 [email protected] Roll Flutter Engine from b11a832ea7d4 to ae6d1d60df95 (1 revision) (flutter/flutter#131611)
2023-07-31 [email protected] Roll Packages from 10aab44 to 60e9a54 (6 revisions) (flutter/flutter#131607)
2023-07-31 [email protected] Fix dartdoc for `ButtonSegment` constructor (flutter/flutter#131400)
2023-07-31 [email protected] [flutter_tools/dap] Improve rendering of structured errors via DAP (flutter/flutter#131251)
2023-07-31 [email protected] [doc] Fix module_test_ios comments (flutter/flutter#131470)
2023-07-31 [email protected] Use Flutter app project's NDK version from FFI plugin (flutter/flutter#131141)
2023-07-31 [email protected] Roll Flutter Engine from 22f9aad5aba5 to b11a832ea7d4 (2 revisions) (flutter/flutter#131597)
2023-07-31 [email protected] Roll Flutter Engine from b84c93601684 to 22f9aad5aba5 (3 revisions) (flutter/flutter#131592)
2023-07-31 [email protected] Roll Flutter Engine from d95adb9c8bc6 to b84c93601684 (1 revision) (flutter/flutter#131585)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
vashworth pushed a commit to vashworth/flutter that referenced this pull request Aug 2, 2023
<img width="1119" alt="image" src="https://github.com/flutter/flutter/assets/66480156/e2e8eed1-3bef-436c-b21f-3891bdbe05bb">

In most cases, a FFI plugin doesn't need its own specific Android NDK version. Just following the Flutter app project's NDK version is enough.

If a Flutter app project depends on multiple FFI plugins that use different Android NDK versions, it can be quite wasteful and use excessive disk space due to multiple NDK installations.

Using Flutter app project's NDK version is also less error-prone because upgrading the Flutter SDK would be enough when upgrading FFI plugins(If project's `ndkVersion` is `flutter.ndkVersion`), without messing with Android NDK installations.

This problem was discussed in some actual FFI plugin repositories, and they are striving to find their own solutions:
- superlistapp/super_native_extensions#143 (comment)
- cunarist/rinf#60 (comment)
- rive-app/rive-flutter#320
- juicycleff/flutter-unity-view-widget#832
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants