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
Remove unnecessary use of globals from base tests, and an android test. This changes the test to avoid bouncing through the global getters, which can lead to incorrectly cached zone values. Switches the memory filesystem implementation to the test implementation
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.
The vm_service_integration test flake is caused by trying to call the method before the framework is initialized (and the extension added). The run errors failure is caused by the error taking some time to propagate to the harness
Update all versions, specifically file which fixes some bugs that caused tests to fail if run in different orders:
- systemTemp directories created by MemoryFileSystem will allot names based on the file system instance instead of globally.
- MemoryFile.readAsLines()/readAsLinesSync() no longer treat a final newline in the file as the start of a new, empty line.
- RecordingFile.readAsLine()/readAsLinesSync() now always record a final newline.
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.
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
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.
Update the flutter and dart scripts' locking mechanism and follow_links function to be more robust and support more platforms.
This adds support for using mkdir as a fallback if the system doesn't have flock instead of using shlock, since shlock doesn't work on shared filesystems.
It also fixes a problem in the follow_links function where it failed when the link resolved to the root directory.
In #55864 a race condition was described where a done event is received before we finish connecting. This cannot happen, since async functions begin synchronously and the flag isWaitingForVm is tripped immediately, keeping onDone from exiting.
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