* [flutter_tools] [dap] Ensure DAP sends app.stop/app.detach during terminate
Fixes an issue where the flutter_tester device may not be cleaned up correctly if we just terminate the Flutter process.
* Update integration test expectations
* Revert accidental commit
Since 02d9c3e6a5 this flag does absolutely nothing. The behaviour it controlled is now automatic and the flag is not required.
The flag will be removed from the Dart SDK in the future after Flutter is no longer using it.
Fuchsia will soon remove all support for Component Framework version 1
components (recognized by component manifests ending in `.cmx`).
Notably, some of the `flutter` tool commands for Fuchsia devices--
notably, but not limited to, those related to CFv1--are outdated, and
either do not work today or soon won't work.
This PR removes the outdated components and commands, replacing some
with the newer version, or simply removing the non-working features,
in some cases.
* Check for bad characters in path on Windows build
* Doc comments
* Fix formatting
* Commenting/formatting
* Link to issue in comment
* Comments, formatting
* Global var rename
Speedup coverage test runs by using (new) coverage handle with caching.
On a `flutter test --coverage` run on `packages/flutter` the runtime goes from ~828 seconds to ~617 seconds, or a ~25% reduction in time spent (testing without coverage takes ~236 seconds so the overhead of `--coverage` in this case goes from ~592 seconds to ~381 seconds, or a ~35% reduction).
* [flutter_tools] [dap] Add support for passing env variables to spawned processes
* Use named args
* Use in-memory fs and FakePlatform
* Pass filesystem style to MemoryFileSystem
* Remove periods from pub --help command descriptions
* Add trailing period consistently
* Remove added period from PackagesInteractiveGetCommand description
* Verify line ending for first line of command description
* Update _allowedTrailingPatterns to validate that lines end with only one period, bang, or colon
* Ensure build is done in incremental mode.
This allows for faster bootstrapping of the compiler from previously created dill file.
Fixes https://github.com/flutter/flutter/issues/107183
* Avoid initializeFromDill in aot mode
* Update tests
The `flutter doctor` command uses `vswhere.exe` to verify the Visual Studio installation. This `vswhere.exe` is known to encode its output incorrectly. This is problematic as the `description` property is localized, and in certain languages this results in invalid JSON due to the incorrect encoding.
This change introduces a fallback to our `vswhere.exe` output parsing logic: if parsing JSON fails, remove the `description` property and retry parsing the JSON.
This fix was also tested on the outputs provided here: https://github.com/flutter/flutter/issues/106601#issuecomment-1170138123
Addresses https://github.com/flutter/flutter/issues/106601
Previously developers had to edit their `Runner.rc` file to update their executable's version information. Now, version information will automatically be set from `flutter build`'s arguments or the `pubspec.yaml` file for new projects.
Addresses https://github.com/flutter/flutter/issues/73652
* 9508a368d Roll Dart SDK from 692562354d6d to d3b8091c30f0 (1 revision) (flutter/engine#34273)
* a2985c034 Roll Fuchsia Linux SDK from F1U6IH2Nf... to aRT7s0Yct... (flutter/engine#34251)
* 54867f360 Roll Skia from bdd0205ae470 to 4345a2ea731a (1 revision) (flutter/engine#34268)
* 98221a22d Clean up text input configuration in clearTextInputClient (flutter/engine#34209)
* b9e02cc83 Adds a license check shard to CI (flutter/engine#34274)
* 1daf7ba98 [Impeller] Metal:Reset Encoder viewport and scissor rect in case the command specifies no opinion (flutter/engine#34252)
* 83b9a591a [Linux] remove duplicate clone_string() in favor of g_strdup() (flutter/engine#34031)
* Don't use .packages
* Another attempt
Co-authored-by: engine-flutter-autoroll <engine-flutter-autoroll@skia.org>
Currently CMake is tested entirely through `build_linux_test.dart`. However, CMake is also used for Windows builds. This adds additional "generic" tests:
1. Parsing CMake files
2. Generating CMake config files.
In the future, this will be used to test that generated CMake config files contain the expected version information, which will be used to flow version information to Windows executables.
Part of https://github.com/flutter/flutter/issues/73652.
This PR adds extra timings for a hot reload.
As an example, before a user might see
> Performing hot reload...
> Reloaded 1 of 788 libraries in 554ms.
With this PR it would instead be something like
> Performing hot reload...
> Reloaded 1 of 788 libraries in 554ms (compile: 33 ms, reload: 153 ms, reassemble: 310 ms).
In https://github.com/flutter/flutter/pull/103771, we rolled
dependencies in Flutter, which triggered an update of package:coverage
to v1.3.1. The new version includes
https://github.com/dart-lang/coverage/pull/370 in which two deprecations
landed:
* The `Resolver` default constructor was deprecated and replaced with
the `Resolver.create` static factory method, which unfortunately
happens to be async.
* The `packagesPath` parameter to `HitMap.parseJson`, which takes the
path to the `.packages` file of the package for which coverage is to
be collected, was deprecated. This parameter was replaced with
`packagePath` in https://github.com/dart-lang/coverage/pull/370 which
was part of the overall deprecation of the .packages file in Dart
itself https://github.com/dart-lang/sdk/issues/48272. The overall goal
being that end-user code shouldn't need to know about implementation
details such as whether dependency information is stored in a
.packages file or a package_info.json file, but rather use the
package_config package to obtain the package metadata and perform
other functions such as resolving its dependencies to filesystem
paths. packagesPath was replaced by packagePath, which takes the path
to the package directory itself. Internally, package:coverage then
uses package_config to do the rest of the package/script URI
resolution to filesystem paths.
This migrates off the deprecated `packagesPath` parameter to the
replacement `packagePath` paramter.
Issue: https://github.com/flutter/flutter/issues/103830
* Fix issues running integration tests through DAP
These adapters were incorrectly trying to connect a DDS instance even when Flutter would create its own. This change disables DDS in the DAP layer and leaves it to Flutter (although it passes `--no-dds` on to Flutter if provided to the DAP process).
Also fixes an issue where we would unnecessarily connect the VM Service for tests even in 'noDebug' mode because of a change/fix that now includes a 'vmServiceUri' in the `test.startedProcess` event.
Flutter uses `vswhere.exe` to find Visual Studio installations and determine if they satisfy Flutter's requirements. However, `vswhere.exe`'s JSON output is known to contain bad UTF-8. This change ignores bad UTF-8 as long as they affect JSON properties that are either unused, or, used only for display purposes by Flutter.
Fixes: https://github.com/flutter/flutter/issues/102451
`VisualStudio` calls `vswhere.exe` to find Visual Studio installations and determine if they satisfy Flutter's requirements. Previously, `VisualStudio` stored the JSON output from `vswhere.exe` as `Map`s, resulting in duplicated logic to read the JSON output (once to validate values, second to expose values). Also, `VisualStudio` stored two copies of the JSON output (the latest valid installation as well as the latest VS installation).
This change simplifies `VisualStudio` by introducing a new `VswhereDetails`. This type contains the logic to read `vswhere.exe`'s JSON output, and, understand whether an installation is usable by Flutter. In the future, this `VswhereDetails` type will be used to make Flutter doctor resilient to bad UTF-8 output from `vswhere.exe`.
Part of https://github.com/flutter/flutter/issues/102451.
* Use libraryFilters flag to speed up coverage collection
* Allow libraryNames to be null
* Unconditionally enable the reportLines flag
* Fix analysis errors
Roll dependendencies
This rolls depdendencies to latest using
flutter update-packages --force-upgrade
This change includes three code changes:
* Removes charcode from the dependencies allowlist since it no longer
appears in the transitive closure of dependencies of the flutter,
flutter_test, flutter_driver, flutter_localizations, and
integration_test packages.
* Uses Resolver.create instead of the deprecated Resolver constructor.
The default Resolver constructor has been deprecated in favour of the
static Resolver.create() factory function, which unfortunately happens
to be async. Propagated the async-ness up the chain.
This change was partially reverted and the deprecation ignored in this
patch until package:coverage can be rolled internally at Google.
* Eliminates the use of the deprecated packagesPath parameter to
HitMap.parseJson. This parameter was deprecated and replaced with
packagePath in https://github.com/dart-lang/coverage/pull/370 which
was part of the overall deprecation of the .packages file in Dart
itself https://github.com/dart-lang/sdk/issues/48272. The overall goal
being that end-user code shouldn't need to know about implementation
details such as whether dependency information is stored in a
.packages file or a package_info.json file, but rather use the
package_config package to obtain the package metadata and perform
other functions such as resolving its dependencies to filesystem
paths. packagesPath was replaced by packagePath, which takes the path
to the package directory itself. Internally, package:coverage then
uses package_config to do the rest of the package/script URI
resolution to filesystem paths.
This change was partially reverted and the deprecation ignored in this
patch until package:coverage can be rolled internally at Google.
This is a pre-update prior to updating flutter_template_images in
https://github.com/flutter/flutter/pull/103739
Issue: https://github.com/flutter/flutter/issues/103371
Issue: https://github.com/flutter/flutter/issues/103775
Issue: https://github.com/flutter/flutter/issues/103830
When re-applying the partially-reverted changes to code coverage,
we'll need to patch host_entrypoint.dart internally to await the Future
that we'll be returning rather than a non-async value.
Point users of boolArgDeprecated to boolArg rather than to
boolArgDeprecated in order to avoid losing users to infinite loops or
stack overflows depending on their implementation.
* c4b899f63 Roll dart sdk to 7b24ff4d92e2d2136020fc5bedadfe7025861510 (flutter/engine#33309)
* 7956603cc [web] Migrate Flutter Web DOM usage to JS static interop - 12. (flutter/engine#33241)
* 1d0c2ae6f Roll Skia from 1e43dce386c9 to f6e31bf1dcfb (6 revisions) (flutter/engine#33320)
* ed5a2fef0 Roll Skia from f6e31bf1dcfb to 69fecd6c2d85 (1 revision) (flutter/engine#33322)
* 10e0e1534 Revert "[web] Migrate Flutter Web DOM usage to JS static interop - 12. (#33241)" (flutter/engine#33321)
* fix local tests
Co-authored-by: Jonah Williams <jonahwilliams@google.com>
* Provide flutter sdk kernel files to dwds launcher instead of dart ones
* Update log test to report all warnings
* Update licences for new files
* Addressed CR comments
* Addressed CR comments
* Added a bool that allows us to limit debugProfileBuildsEnabled to user
created widgets.
* made it turned on by default
* switched to hashmap
* Cleaned everything up and added tests
* fixed an odd test where it wants to be able to add asserts and run in profile mode
* hixie feedback
* hixie2
* made it default to false
* updated docstring as per dans request
* Don't terminate Dart process pids from VM Service
These processes may be on another device, and in the case of attach the debugee should not be terminated anyway.
Previously, https://github.com/flutter/flutter/pull/100271 enabled
building universal macOS binaries by default, but included a bug causing
the arm64 App.framework to be built such that the TEXT section
containing the app instructions built by gen_snapshot incorrectly
contained x86_64 instructions rather than arm64 instructions.
When building macOS (and iOS) apps, Flutter builds them in three
components:
* The Runner application: built by Xcode
* The bundled App.framework: built from assembly code generated by
gen_snapshot from the application's Dart sources.
* The bundled FlutterMacOS.framework: built as part of the engine build
and packaged by copying the distributed binary framework from our
artifacts cache.
Building App.framework consists of the following steps:
* For each architecture, invoke gen_snapshot to generate
architecture-specific assembly code, which is then built to object
code and linked into an architecture-specific App.framework.
* Use the `lipo` tool to generate a universal binary that includes both
x86_64 and arm64 architectures.
Previously, we were building architecture specific App.framework
binaries. However, for all architectures we were (mistakenly) invoking
the general `gen_snapshot` tool (which emitted x64 instructions, and
which is now deprecated) instead of the architecture-specific
`gen_snapshot_x86` and `gen_snapshot_arm64` builds which emit
instructions for the correct architecture.
This change introduces a small refactoring, which is to split the
`getNameForDarwinArch` function into two functions:
* `getDartNameForDarwinArch`: the name for the specified architecture as
used in the Dart SDK, for example as the suffix of `gen_snapshot`.
* `getNameForDarwinArch`: the name for the specified architecture
as used in Apple tools, for example as an argument to `lipo`. For
consistency, and to match developer expectations on Darwin platforms,
this is also the name used in Flutter's build outputs.
Issue: https://github.com/flutter/flutter/issues/100348
This changes the default build architectures for Flutter macOS apps to
x86_64 and arm64. Previously, we manually excluded arm64 builds via the
EXCLUDE_ARCHS Xcode setting in Flutter's generated xcconfig file. This
eliminates setting EXCLUDE_ARCHS during the build and updates the
default architectures in the tool and in the macos_assemble.sh wrapper.
Issue: https://github.com/flutter/flutter/issues/97681
Umbrella issue: https://github.com/flutter/flutter/issues/60113
* Starts using the `--source` flag to compile the dart registrant.
* updated general.shard tests
* Fixed the resident compiler flow
* added integration test
* made the integration test self contained
* renamed generated_main to dart_plugin_registrant
* cleaned up for review
* added task runner for ci
* added bringup and TESTOWNERS
* updated failure message
* Update flutter_tools to look for new VM service message
The Dart SDK will soon move away from the current Observatory message:
"Observatory listening on ..."
To a new message that no longer references Observatory:
"Dart VM Service listening on ..."
This change updates all tests with mocks to check for the new message
and also adds support for the new message in ProtocolDiscovery.
See https://github.com/dart-lang/sdk/issues/46756
* Fix some parsing locations
* Fix analysis failures
* Update message
* Remove extra comment
* Update message
* Add globals prefix
* Add support for attachRequest in DAP, which runs "flutter attach"
* Update DAP docs for attachRequest
* Improve doc comments
* Fix comments
* Remove noDebug from attach + create a getter for `debug`
* Fix indent
The code to generate platform files used to use the presence of an
'example' folder to determine whether or not a project was a plugin (in
which case that generation is bypassed). Later, robust detection was
added based on the pubspec.yaml `plugin` key, but the old check was left
in place. This creates false positives where people who add an example
folder to their app project start getting mysterious failures.
Since the pubspec check is definitive, there's no reason to continue to
use the presence of `example` as an indicator at all.
Fixes https://github.com/flutter/flutter/issues/87007
When desktop support is not present in an existing project, certain
flutter tool commands raise an error that direct the user to
documentation on how to add desktop support to an existing Flutter
project. In a recent revamp of the webside, the URL was very slightly
changed (flutter.dev -> docs.flutter.dev).
This updates the error message to output the new URL.
Issue: https://github.com/flutter/flutter/issues/94398
* Building shared C source code as part of the native build for platforms Android, iOS, Linux desktop, MacOS desktop, and Windows desktop.
* Sample code doing a synchronous FFI call.
* Sample code doing a long running synchronous FFI call on a helper isolate.
* Use of `package:ffigen` to generate the bindings.
* Add an option for flutter daemon to listen on a TCP port
Added a new class DaemonConnection to reuse the connection handling
between daemon server and client, and handle connection with different
medium (stdio, socket).
Added a new option `listen-on-tcp-port` to the flutter daemon command,
when passed, the daemon will accept commands on a port instead of stdio.
* Review feedback and add test for TcpDaemonStreams
* Review feedbacks