1. 07 Feb, 2024 1 commit
    • auto-submit[bot]'s avatar
      Reverts "Move native assets to `isolated/` directory" (#143027) · ceca6066
      auto-submit[bot] authored
      Reverts flutter/flutter#142709
      
      Initiated by: vashworth
      
      Reason for reverting: `Mac tool_tests_general` started failing on this commit: https://ci.chromium.org/ui/p/flutter/builders/prod/Mac%20tool_tests_general/15552/overview
      
      Original PR Author: dcharkes
      
      Reviewed By: {christopherfujino, chingjun, reidbaker}
      
      This change reverts the following previous change:
      Original Description:
      Native assets in other build systems are not built with `package:native_assets_builder` invoking `build.dart` scripts. Instead all packages have their own blaze rules. Therefore we'd like to not depend on `package:native_assets_builder` from flutter tools in g3 at all.
      
      This PR aims to move the imports of `native_assets_builder` and `native_assets_cli` into the `isolated/` directory and into the files with a `main` function that are not used in with other build systems.
      
      In order to be able to remove all imports in files used by other build systems, two new interfaces are added `HotRunnerNativeAssetsBuilder` and `TestCompilerNativeAssetsBuilder`. New parameters are then piped all the way through from the entry points:
      
      * bin/fuchsia_tester.dart
      * lib/executable.dart
      
      The build_system/targets dir is already excluded in other build systems.
      
      So, after this PR only the two above files and build_system/targets import from `isolated/native_assets/` and only `isolated/native_assets/` import `package:native_assets_cli` and `package:native_assets_builder`.
      
      Context:
      
      * https://github.com/flutter/flutter/issues/142041
      ceca6066
  2. 06 Feb, 2024 1 commit
    • Daco Harkes's avatar
      Move native assets to `isolated/` directory (#142709) · a069e62e
      Daco Harkes authored
      Native assets in other build systems are not built with `package:native_assets_builder` invoking `build.dart` scripts. Instead all packages have their own blaze rules. Therefore we'd like to not depend on `package:native_assets_builder` from flutter tools in g3 at all.
      
      This PR aims to move the imports of `native_assets_builder` and `native_assets_cli` into the `isolated/` directory and into the files with a `main` function that are not used in with other build systems.
      
      In order to be able to remove all imports in files used by other build systems, two new interfaces are added `HotRunnerNativeAssetsBuilder` and `TestCompilerNativeAssetsBuilder`. New parameters are then piped all the way through from the entry points:
      
      * bin/fuchsia_tester.dart
      * lib/executable.dart
      
      The build_system/targets dir is already excluded in other build systems.
      
      So, after this PR only the two above files and build_system/targets import from `isolated/native_assets/` and only `isolated/native_assets/` import `package:native_assets_cli` and `package:native_assets_builder`.
      
      Context:
      
      * https://github.com/flutter/flutter/issues/142041
      a069e62e
  3. 02 Feb, 2024 2 commits
    • Lau Ching Jun's avatar
      Avoid depending on files from build_system/targets other than from top level... · ac7879e2
      Lau Ching Jun authored
      Avoid depending on files from build_system/targets other than from top level entrypoints in flutter_tools. (#142760)
      
      Add a new `BuildTargets` class that provides commonly used build targets. And avoid importing files from `build_system/targets` except from the top level entrypoints or from top level commands.
      
      Also move `scene_importer.dart` and `shader_compiler.dart` into `build_system/tools` because they are not `Target` classes, but wrapper for certain tools.
      
      With this change, we can ignore all files in `build_system/targets` internally and make PR #142709 easier to land internally. See cl/603434066 for the corresponding internal change.
      
      Related to:
      https://github.com/flutter/flutter/pull/142709
      https://github.com/flutter/flutter/issues/142041
      
      Also note that I have opted to add a new variable in `globals.dart` for `BuildTargets` in this PR, but I know that we are trying to get rid of globals. Several alternatives that I was considering:
      
      1. Add a new field in `BuildSystem` that returns a `BuildTargets` instance. Since `BuildSystem` is already in `globals`, we can access build targets using `globals.buildSystem.buildTargets` without adding a new global variable.
      2. Properly inject the `BuildTargetsImpl` instance from the top level `executable.dart` and top level commands.
      
      Let me know if you want me to do one of the above instead. Thanks!
      ac7879e2
    • Jackson Gardner's avatar
      Wasm/JS Dual Compile with the flutter tool (#141396) · ba626dc8
      Jackson Gardner authored
      This implements dual compile via the newly available flutter.js bootstrapping APIs for intelligent build fallback.
      * Users can now use the `FlutterLoader.load` API from flutter.js
      * Flutter tool injects build info into the `index.html` of the user so that the bootstrapper knows which build variants are available to bootstrap
      * The semantics of the `--wasm` flag for `flutter build web` have changed:
        - Instead of producing a separate `build/web_wasm` directory, the output goes to the `build/web` directory like a normal web build
        - Produces a dual build that contains two build variants: dart2wasm+skwasm and dart2js+CanvasKit. The dart2wasm+skwasm will only work on Chrome in a cross-origin isolated context, all other environments will fall back to dart2js+CanvasKit.
        - `--wasm` and `--web-renderer` are now mutually exclusive. Since there are multiple build variants with `--wasm`, the web renderer cannot be expressed via a single command-line flag. For now, we are hard coding what build variants are produced with the `--wasm` flag, but I plan on making this more customizable in the future.
      * Build targets now can optionally provide a "build key" which can uniquely identify any specific parameterization of that build target. This way, the build target can invalidate itself by changing its build key. This works a bit better than just stuffing everything into the environment defines because (a) it doesn't invalidate the entire build, just the targets which are affected and (b) settings for multiple build variants don't translate well to the flat map of environment defines.
      ba626dc8
  4. 31 Jan, 2024 2 commits
  5. 29 Jan, 2024 2 commits
  6. 26 Jan, 2024 1 commit
    • Pierrick Bouvier's avatar
      Enable native compilation for windows-arm64 (#141930) · 37c3978b
      Pierrick Bouvier authored
      It's now possible to natively compile a flutter app for windows-arm64. Cross-compilation is not yet implemented.
      
      Uses arm64 artifacts now available for Dart/Flutter. Platform detection is based on Abi class, provided by Dart. Depending if Dart is an arm64 or x64 binary, the Abi is set accordingly. Initial bootstrap of dart artifacts (update_dart_sdk.ps1) is checking PROCESSOR_ARCHITECTURE environment variable, which is the way to detect host architecture on Windows.
      
      This is available only for master channel (on other channels, it fallbacks to windows-x64).
      
      On windows-x64, it produces an x64 app. On windows-arm64, it produces an arm64 app.
      37c3978b
  7. 25 Jan, 2024 1 commit
    • David Iglesias's avatar
      [ci] Adds test for web hot restart with const App. (#141824) · 703e12f5
      David Iglesias authored
      This PR adds a test that reproduces the problem described in the linked issue: hot restart on the web seems to not update if the app being run is `const`.
      
      The new test is expected to fail, until the `const` issue with hot restart in the web is resolved.
      
      Expected failure mode is a 15s timeout in the following test:
      
      ```
      02:31 +3 ~1 -1: Hot reload (index.html: Default) (with `const MyApp()`)): newly added code executes during hot restart [E]
        TimeoutException after 0:00:15.000000: Future not completed
        dart:async  _startMicrotaskLoop
        ...
      ```
      
      (And then a bunch of output that I'm not 100% sure is intended :))
      
      ## Issues
      
      * #141588
      703e12f5
  8. 22 Jan, 2024 1 commit
  9. 21 Jan, 2024 1 commit
  10. 19 Jan, 2024 2 commits
  11. 18 Jan, 2024 3 commits
    • auto-submit[bot]'s avatar
      Reverts "Enable native compilation for windows-arm64 " (#141809) · 1901d6fa
      auto-submit[bot] authored
      Reverts flutter/flutter#137618
      Initiated by: Jasguerrero
      This change reverts the following previous change:
      Original Description:
      It's now possible to natively compile a flutter app for
      windows-arm64. Cross-compilation is not yet implemented.
      
      Uses arm64 artifacts now available for Dart/Flutter.
      Platform detection is based on Abi class, provided by Dart. Depending if
      Dart is an arm64 or x64 binary, the Abi is set accordingly.
      Initial bootstrap of dart artifacts (update_dart_sdk.ps1) is checking
      PROCESSOR_ARCHITECTURE environment variable, which is the way to detect
      host architecture on Windows.
      
      This is available only for master channel (on other channels, it
      fallbacks to windows-x64).
      
      On windows-x64, it produces an x64 app. On windows-arm64, it produces an
      arm64 app.
      1901d6fa
    • Pierrick Bouvier's avatar
      Enable native compilation for windows-arm64 (#137618) · 54055920
      Pierrick Bouvier authored
      It's now possible to natively compile a flutter app for
      windows-arm64. Cross-compilation is not yet implemented.
      
      Uses arm64 artifacts now available for Dart/Flutter.
      Platform detection is based on Abi class, provided by Dart. Depending if
      Dart is an arm64 or x64 binary, the Abi is set accordingly.
      Initial bootstrap of dart artifacts (update_dart_sdk.ps1) is checking
      PROCESSOR_ARCHITECTURE environment variable, which is the way to detect
      host architecture on Windows.
      
      This is available only for master channel (on other channels, it
      fallbacks to windows-x64).
      
      On windows-x64, it produces an x64 app. On windows-arm64, it produces an
      arm64 app.
      54055920
    • Jesús S Guerrero's avatar
      Revert "Native assets: roll deps" (#141748) · 1997bec6
      Jesús S Guerrero authored
      b/320767653
      
      Reverts flutter/flutter#141684
      1997bec6
  12. 17 Jan, 2024 1 commit
    • Daco Harkes's avatar
      Native assets: roll deps (#141684) · f5442bf9
      Daco Harkes authored
      Rolls the packages from https://github.com/dart-lang/native in the native assets implementation.
      
      Most notable we're refactoring `package:native_assets_cli` for `build.dart` use.
      Therefore, all imports to that package for Flutter/Dart should be to the implementation internals that are no longer visible for `build.dart` writers. Hence all the import updates.
      
      No behavior in Flutter apps should change.
      
      This PR also updates the template to use the latests version of `package:native_assets_cli` which no longer exposes all the implementation details.
      f5442bf9
  13. 12 Jan, 2024 3 commits
  14. 05 Jan, 2024 1 commit
  15. 21 Dec, 2023 1 commit
  16. 20 Dec, 2023 1 commit
  17. 19 Dec, 2023 1 commit
  18. 14 Dec, 2023 2 commits
  19. 13 Dec, 2023 2 commits
  20. 12 Dec, 2023 1 commit
  21. 07 Dec, 2023 1 commit
    • Daco Harkes's avatar
      Native assets support for Android (#135148) · 6ad75553
      Daco Harkes authored
      Support for FFI calls with `@Native external` functions through Native assets on Android. This enables bundling native code without any build-system boilerplate code.
      
      For more info see:
      
      * https://github.com/flutter/flutter/issues/129757
      
      ### Implementation details for Android.
      
      Mainly follows the design of the previous PRs.
      
      For Android, we detect the compilers inside the NDK inside SDK.
      
      And bundling of the assets is done by the flutter.groovy file.
      
      The `minSdkVersion` is propagated from the flutter.groovy file as well.
      
      The NDK is not part of `flutter doctor`, and users can omit it if no native assets have to be build.
      However, if any native assets must be built, flutter throws a tool exit if the NDK is not installed.
      
      Add 2 app is not part of this PR yet, instead `flutter build aar` will tool exit if there are any native assets.
      6ad75553
  22. 01 Dec, 2023 1 commit
  23. 16 Nov, 2023 1 commit
  24. 14 Nov, 2023 1 commit
  25. 13 Nov, 2023 1 commit
  26. 10 Nov, 2023 1 commit
  27. 09 Nov, 2023 1 commit
  28. 03 Nov, 2023 3 commits