Enable null safety asserts for web debug mode. This induces runtime asserts at the boundaries between null safe and non-null safe libraries. Adds integration test that validates assertion error is thrown.
#61042
Skip unnecessary parsing of chrome URI. Ensure stack traces are initialized in web server. Disclaimer on web server that it does not support debugging and remove help message. Fix generated entrypoint to check for main(List<String> args)
- Fixes#59643
- Fixes#55084
- Fixes#60417
Made flutter tools serve metadata produced by the frontend server:
pass --experimental-emit-metadata flag to flutter engine
store and serve metadata from web asset server
store and serve merged metadata from web asset server
add tests to verify that metadata is served from memory
update dwds version so it can read metadata
configure dwds to read metadata from file
Prerequisite changes (landed):
sdk: https://dart-review.googlesource.com/c/sdk/+/150181
flutter engine: flutter/engine#19168
webdev:dart-lang/webdev#1064
We have too many loggers, and the logger construction rules are too complicated to be untested. Capture these in a LoggerFactory and test that construction is correct.
Fixes#45075Fixes#57210
If an asset was included directly from the project root directory, then the same asset when copied to various output or ephemeral directories would also be picked up as an asset variant. This could cause assets to be recursively copied into asset/build/ephemeral directories, as each time it would run it would pick up all of the previous "variants".
The solution is to include project ephemeral directories, in addition to the build directory.
update flutter precache --force to delete all stamp files. In the event that a user is hitting a cache issue, this should be easier than re-downloading all artifacts or manually blowing away the cache.
This is probably how it should have worked in the first place
Remove globals from flutter_tester device and cleanup test case. Not completely gone since the Kernel Builder will still use them, but a good incremental improvement.
* First pass at CMake files; untested
* First pass of adding CMake generation logic on Windows
* Misc fixes
* Get bundling working, start incoprorating CMake build into tool
* Fix debug, exe name.
* Add resources
* Move cmake.dart
* Rip out all the vcxproj/solution plumbing
* Fix plugin cmake generation
* Build with cmake rather than calling VS directly
* Adjust Windows plugin template to match standard header directory structure
* Pass config selection when building
* Partially fix multi-config handling
* Rev template version
* Share the CMake generation instead of splitting it out
* VS build/run cycle works, with slightly awkward requirement to always build all
* Update manifest
* Plugin template fixes
* Minor adjustments
* Build install as part of build command, instead of separately
* Test cleanup
* Update Linux test for adjusted generated CMake approach
* Plugin test typo fix
* Add missing stub file for project test
* Add a constant for VS generator
initialize from dill does not handle changing null-safety flags and will incorrectly use the nullability mode of the last compile. Add all extra frontend options to the unique name prefix for the flutter run dill cache to avoid this situation.
In web debug mode, infer sound null safety by default. When sound null safety is enabled, provide a separate dill and precompiled Dart SDK. Release builds do not need this setting since we run dart2js from source.
Fixes#59873
The flutter daemon unconditionally waits for the appFinished signal, even if startup failed. Ensure this future is correctly completed if there is a failure in ResidentRunner.run and not just ResidentRunner.attach. Adds regression tests for run release, debug, debug web, and release web. Adds missing try catch in cold runner startup.
Manually tested with release/debug on Android and release/debug on web.
Fixes#60613
The global packages path could cause tests to fail when it would be overriden to unexpected (in test setup) values. Remove most usage and make it a configuration on buildInfo, along with most other build information. Cleanup the asset builder to require the .packages path and the resident runners to no longer require it, since they already have the information in build_info.
It needs to stick around for the fuchsia deps we do not control.
Filled #60232 for remaining work.
First pass at fixing #57985 and implementing #59602
This doesn't have enough metadata to be useful for IDEs yet, but it prevents the issue from getting worse while we iterate on it.
WebAssetServer could fail if some of the global statics it depended on were initialized in a different order. Fix this by removing globals.
Delete dwds startup test that needs to spawn a real server.
Remove the version checking and associated warnings. The Linux template
and build process will now be subject to more typical Flutter breaking
change policy, and should no longer require regularly deleting and
recreating the platform directory.
This rolls the engine from:
965fbbed1776545ee681cb57f3fb1d0c2000bbcb to
b5f5e6332cb4987e9e38ffaa267733ec0a8705ba. A Dart SDK roll in this range
changed the format of the compileExpression RPC VMService endpoint,
necessitating a tool patch.
In google3, the Linux device is always available, and it has confused
people who run the Flutter doctor and see
"• Linux • Linux • linux-x64 • Linux" listed.
Rename the Linux device name to "Linux desktop" and the device ID to
be "linux". Make similar changes to the Windows and macOS
devices for consistency. This is also consistent with the web
devices.
The device ID change shouldn't be break -d usage since that does a
case-insensitive prefix match.
On Windows, Process.run assumes the output uses the system codepage by default. This allows specifying it in our wrapper, and sets the encoding for vswhere to UTF-8 since we're passing a flag that forces it to use UTF-8 output.
Fixes#53515
Some of the null-safety commands were missing - plumb them through. Ensure that verbose mode shows their output, and clean up the messaging around sound-null-safety.
Fixes#59769
Adds a test that validate each of the null safety supporting build commands has everything plumbed through.
https://github.com/dart-lang/coverage - 0.14.0 added the ability to be able to ignore coverage depending on comments.
// coverage:ignore-line to ignore one line.
// coverage:ignore-start and // coverage:ignore-end to ignore range of lines inclusive.
// coverage:ignore-file to ignore the whole file.
Refactors KernelCompiler and ResidentCompiler to no longer use globals (except as a fallback for g3 migration). Improves the compilation error when running flutter test on a package without a flutter_test dependency.
Updates machine mode to output trace text to stderr
A frequent request from the last Flutter developer survey was for an easier method of testing light/dark mode changes. Currently, a user needs to manually change the theme settings or adjust phone settings to see the difference. Instead we should add a toggle from the CLI, and eventually devtools/Intellij/Vscode that allows developers to override the current setting.
Fixes#59495
Adds flutter.ext.brightnessOverride service protocol which either queries the current platform brightness, or overrides it to a new value. This accepts either Brightness.light or Brightness.dark as a value.
Adds a CLI toggle b which allows the setting to be toggled manually.
Requires an update to the MediaQuery, to conditionally use a debug override when not in release mode
Failing dev/integration_tests/ui/test_driver/keyboard_resize_test.dart
Also timing out on new_gallery_ios__transition_perf
This reverts commit c7a37c72c2.
Updates the tooling to use the GTK embedding, rather than the GLFW embedding:
- Adds new requirements to `doctor`
- Updates the app and plugin templates to make GTK-based runners and plugins
- Stops downloading and installing the GLFW artifacts
Final part of #54860, other than cleanup.
This command was previously used by the re-entrant build scripts in xcode_backend.sh and build.gradle. These have since been refactored to use flutter assemble.
Deprecation the command in preparation for removal in a future release of flutter. The only current use is a test on HHH
Ensure that the language version of the test/web generated entrypoint matches the language version of the test file to run, or the overall package language version if no annotation is provided.
The tool was setting the output preferences in a sub-context. Originally these were not injected before the arg parsers were created, though that was fixed by the lazy command creation. Once local engine is removed, the inner flutter_command Zone can be removed.
Support Microsoft Edge as a device for flutter run when web is enabled. Currently this only works on Windows, and does not include a validator for edge.
Fixes#55322
flutter analyze was unconditionally using the cached dart-sdk for analysis, and was not running with the built SDK during local engine. This broke when trying to update the analyzer for null safety, since it required us to wait for the dart change to roll into the framework first.
flutter analyze was unconditionally using the cached dart-sdk for analysis, and was not running with the built SDK during local engine. This broke when trying to update the analyzer for null safety, since it required us to wait for the dart change to roll into the framework first.
* Revert "Revert "Send text error in JSON and print in tools (#58284)" (#58872)"
This reverts commit c2d5e18cb2.
* Put streamListen in try/catch if extension events already listened for
instead of restricting profile/release mode based on whether the tool thinks the device is an emulator, restrict based on the device target architecture and the requested build mode. Notably, this enables release mode on x86_64 Android emulators, but not x86 emulators since we do not support that as an AOT target.
This does not add release mode support for simulators, since this requires us to build and upload artifacts for simulator/x86_64
* Send text error in JSON and print in tools
* Add test for error text
* Fix analysis issues
* Move streamListen to try/catch and use global.printStatus
* Extract print error fn and listen for events in web runner
* Add extension listen request to test
* Update packages/flutter_tools/lib/src/resident_runner.dart
Co-authored-by: Jonah Williams <jonahwilliams@google.com>
* Rename error parsing method
* Allow crash if listen for extension stream fails
* Add test for error and non-error extension events
* Fix formatting for TextTreeRenderer
* Use shorter message for second exceptions
* Specify types for map
* Add empty JSON for resident_web_runner test
* Move stream listen to vmservice and add vmservice test
* Fix stream type
* Move structured error log definition to vmservice
* Use correct test matcher isNot
Co-authored-by: Jonah Williams <jonahwilliams@google.com>
Current versions of the Windows desktop build files don't require a specific Windows 10 SDK version, but doctor still checks for one since vswhere doesn't allow for flexible queries. This has been a common source of issues for people setting up on Windows for the first time, because the current VS installer by default only includes a newer version of the SDK than what doctor is looking for.
This removes the vswhere SDK check, and instead uses a manual check for SDKs. Since this uses undocumented (although fairly widely used, so relatively unlikely to change) registry information, the check is non-fatal, so that builds can progress even if the SDK isn't found by doctor; in practice, it's very unlikely that someone would install the C++ Windows development workload but remove the selected-by-default SDK from the install.
Now that all requirements are default, the instructions when missing VS have been simplified so that they no longer list individual components, and instead just say to include default items.
Fixes#50487
Make it possible for all FlutterCommands to be global free, by moving instantiation to inside the Zone context. Additionally, provide VerboseLogger and NotifyLogger (daemon) at the top level and remove from command-specific overrides.
This allows removing a work around where web devices needed to look up directly from the context in non-test code.
Technically the output preferences are still zone injected, but these will be moved soon as they were not being used correctly by the top level command (the injection comes after ArgParser reads the overflow values, causing numerous wrap issues)
Work towards removal of package:archive and ideally more stable unzipping of artifacts. These commands are available in Powershell 5+, which we already require for windows.
Also combines experiments into extraGenSnapshot/ExtraFrontEndOptions. Allows providing --no-sound-null-safety to allow out of order migration and running.
Remove copying from the shutdown stage since that seems risky. If the tool copies the first compilation there will still be a decent dill for initialization.
If a dependency specified uses-material-design: true and the main pubspec specifies uses-material-design: false, then the MaterialIcons font would be included in the font manifest, but not in the AssetManifest or final bundle. Remove it from the FontManifest if this occurs
Work towards #16723
This is only safe to land after #58131 lands in google3. Only build NOTICES in asset manfiest, and load either LICENSE or NOTICES from pubspec dependencies.
Treats 'pluginClass: none' as equivalent to having no 'pluginClass'
entry on the desktop platforms, to satisy stable channel plugin
validation of Dart-only desktop plugin implementations. See
issue for full details.
Part of https://github.com/flutter/flutter/issues/57497
To simplify development of the in-progress GTK embedding, which will
replace the GLFW embedding on Linux, add the GTK artifacts to the unpack
list. This means that until the transition, both the GLFW and GTK
artifacts will be unpacked.
Part of #54860
The -S/-B format of specifying source and build directories wasn't added
until 3.13. For 3.10 compatibility, use the older form of having the
working directory as the build directory, and the last argument as the
source directory.
Fixes#57409
Throw a toolExit if the windows plugin logic runs on an invalid windows project. Update the supported project check to validate the existence of a Runner.sln file
Updates the Linux templates to use CMake+ninja, rather than Make, and updates the tooling to generate CMake support files rather than Make support files, and to drive the build using cmake and ninja.
Also updates doctor to check for cmake and ninja in place of make.
Note: While we could use CMake+Make rather than CMake+ninja, in testing ninja handled the tool_backend.sh call much better, calling it only once rather than once per dependent target. While it does add another dependency that people are less likely to already have, it's widely available in package managers, as well as being available as a direct download. Longer term, we could potentially switch from ninja to Make if it's an issue.
Fixes#52751