Commit Graph

2837 Commits

Author SHA1 Message Date
Polina Cherkasova
f7b24fa525
Revert "Add a warning/additional handlers for parsingsynthetic-package." (#158078)
Reverts flutter/flutter#157934 to unblock https://github.com/flutter/flutter/pull/158076 and then flutter roll.

Reason: b/377107864
2024-11-03 17:12:20 +00:00
Matan Lurey
d77d7c3f36
Add a warning/additional handlers for parsingsynthetic-package. (#157934)
Closes https://github.com/flutter/flutter/issues/157928.
Closes https://github.com/flutter/flutter/issues/157929.

| Condition | Expectation |
| --------- | ------------ |
| `synthetic-packages: true` && `--implicit-pubpsec-resolution` | Generates `flutter_gen` with warning.
| `<no synthetic-packages key>` && `--implicit-pubspec-resolution` | Generates `flutter_gen` with warning.
| `synthetic-packages: false` && `--implicit-pubpsec-resolution` | Does not generate `flutter_gen`.
| `synthetic-packages: true` && `--no-implicit-pubpsec-resolution` | Error.
| `<no synthetic-packages key>` && `--no-implicit-pubspec-resolution` | Does not generate `flutter_gen`.
| `synthetic-packages: false` && `--no-implicit-pubpsec-resolution` | Generates `flutter_gen` with warning.
2024-11-01 00:45:07 +00:00
Matan Lurey
fb022290ff
Add and plumb useImplicitPubspecResolution across flutter_tools. (#157879)
Work towards https://github.com/flutter/flutter/issues/157819. **No behavior changes as a result of this PR**.

Based on a proof of concept by @jonahwilliams (https://github.com/flutter/flutter/pull/157818).

The existence of this flag (which for the time being, defaults to `true`) implies the following:

1. The (legacy, deprecated) `.flutter-plugins` file is not generated:
    https://docs.flutter.dev/release/breaking-changes/flutter-plugins-configuration
    
2. The (legacy, deprecated) `package:flutter_gen` is not synthetically generated:
    https://github.com/flutter/website/pull/11343
    (awaiting website approvers, but owners approve this change)

This change creates `useImplicitPubspecResolution` and plumbs it through as a required variable, parsing it from a `FlutterCommand.globalResults` where able. In tests, I've defaulted the value to `true` 100% of the time - except for places where the value itself is acted on directly, in which case there are true and false test-cases (e.g. localization and i10n based classes and functions).

I'm not extremely happy this needed to change 50+ files, but is sort of a result of how inter-connected many of the elements of the tools are. I believe keeping this as an explicit (flagged) argument will be our best way to ensure the default behavior changes consistently and that tests are running as expected.
2024-10-31 10:43:25 +00:00
Matan Lurey
e6c9fce313
Add hidden --no-implicit-pubspec-resolution flag for one stable release. (#157635)
Closes https://github.com/flutter/flutter/issues/157532.

Work towards https://github.com/flutter/flutter/issues/157819.

Because this flag is checked in `FlutterCommand.verifyAndRun`, it seemed cleaner to just make it a global flag - particularly because this flag's longevity is unlikely to be longer than a single stable release.
2024-10-30 17:00:32 +00:00
Matan Lurey
3af8b0a4df
Tighten up throwToolExit, explain when to use it. (#157561)
Documents when to use `throwToolExit` and how to use it.

Replaces every invocation of `throw ToolExit` with `throwToolExit` and makes the former impossible; this is so that every user will at least (hypothetically) have the chance to read the documentation attached to `throwToolExit` (and if we change parameters in the future they will all flow through one place).
2024-10-26 03:17:24 +00:00
LouiseHsu
bade5591bf
Prevent flutter build ios-framework --xcframework from copying Flutter.xcframework.dSYM into the App.framework folder. (#157394)
Fixes https://github.com/flutter/flutter/issues/157359

Prevents Flutter.xcframework.dSYM from being copied into the App.framework folder. I am not 100% positive if there are cases where it's valid to have multiple dSYMs in that folder, so I'm just string matching and filtering out `Flutter.xcframework.dSYM`
2024-10-23 23:35:10 +00:00
Jason Simmons
8b4d48715b
Ensure that the build system checks for updates of locally built flutter_web_sdk artifacts (#156534)
The SourceVisitor uses the engineVersion parameter to determine whether it needs to check for changes to artifacts or if it can assume that artifacts are unmodified from a versioned build of the engine.  engineVersion is set based on whether the Artifacts instance sets the isLocalEngine property.

CachedLocalWebSdkArtifacts (instantiated when the --local-web-sdk flag is used) was only setting isLocalEngine if --local-engine was also used.  This caused the build system to ignore changes to the files in the locally built flutter_web_sdk when using --local-web-sdk alone.

This PR renames Artifacts.isLocalEngine to usesLocalArtifacts in order to clarify what it means.  It also changes CachedLocalWebSdkArtifacts to always enable usesLocalArtifacts.
2024-10-21 22:52:29 +00:00
Jackson Gardner
e19d352fc9
Add support for flutter build web --debug. (#157186)
There have been various requests for this for a while. See https://github.com/flutter/flutter/issues/96283 for an example. This has become more important with dart2wasm builds in the mix, as the profiling versions of the dart2wasm builds are a lot less debuggable than the debug versions. Most of this is already wired up so it just requires taking out a few explicit checks for it and making sure that we compile with the right optimization levels when compiling debug.
2024-10-21 15:35:11 +00:00
David Iglesias
d744da18e5
[tool] Emit a deprecation warning for some values of --web-renderer. (#156376)
This PR emits a blue warning text when using `flutter ... --web-renderer=html|auto`.

(The message is similar to the one that we emit at run-time)

## Issues

Fixes https://github.com/flutter/flutter/issues/154878
See also: https://github.com/flutter/engine/pull/55709
2024-10-08 01:39:06 +00:00
Andrew Kolos
e96c47f953
handle any RPCError due to vm service disconnection in flutter run (#156346)
Follow-up to https://github.com/flutter/flutter/pull/153714. While reading through run.dart, I noticed we missed a case.
2024-10-07 18:48:22 +00:00
Jenn Magder
22247cd55c
Add deprecation warning for "flutter create --ios-language" (#155867)
The Objective-C  `flutter create --ios-language objc` template will be removed in https://github.com/flutter/flutter/issues/148586.

Add a deprecation warning when this flag is passed.  Add an additional warning when Objective-C is specified requesting the user's use-case.

Do not show the warning when creating the module, as Swift is not supported for it yet https://github.com/flutter/flutter/issues/23955

![Screenshot 2024-09-27 at 8 54 16 PM](https://github.com/user-attachments/assets/112be47f-a5bd-4f57-9a9d-c96c7bbc8ac3)

Part of https://github.com/flutter/flutter/issues/148586
2024-10-02 16:13:25 +00:00
Mikhail Novoseltsev
0975e612c0
[tool][android] Allow --target-platform work properly with --debug mode (#154476)
This PR addresses an issue where the `--target-platform` flag was not being respected when building APKs in debug mode. Previously, debug builds would always include `x86` and `x64` architectures, regardless of the specified target platform. This change ensures that the `--target-platform` flag is honored across all build modes, including debug.

To achieve this, `BuildApkCommand` has been slightly changed to become responsible for list of archs that should be built in the current run,rather than just parsing arguments. Previously, this responsibility was distributed to gradle, which could be frustrating (in my opinion)

Fixes #153359
2024-10-01 15:24:53 +00:00
Ian Hickson
20bc0a9cb8
Fix line-wrapping in flutter create error message. (#150325) 2024-09-26 17:04:03 +00:00
Tess Strickland
c50b3fea32
Extend 'flutter symbolize' to handle deferred loading units. (#149315)
Adds `-u`/`--unit-id-debug-info` arguments to `flutter symbolize` to pass paths to DWARF information for deferred loading units. The argument passed via `-u` should be of the form `N:P`, where `N` is the loading unit ID (an integer) and `P` is the path to the debug information for loading unit `N`. The DWARF information for the root loading unit can either be passed by `-d`/`--debug-info` as before or by `--unit-id-debug-info 1:<path>`.

Partial fix for https://github.com/flutter/flutter/issues/137527. Additional work is needed to adjust tools built on top of `flutter symbolize` to store and pass along this additional information appropriately when there are deferred loading units.
2024-09-16 17:55:05 +00:00
Shashwat Pathak
0a9148870a
Fix flutter create warning regarding Java compatibility (#152836)
This PR modifies the warning message regarding Java compatibility to make it consistent with the Flutter style guide.

**Current message looks like this**
```
[RECOMMENDED] If so, to keep the default AGP version 8.1.0, make
sure to download a compatible Java version
(Java 17 <= compatible Java version < Java 21).
You may configure this compatible Java version by running:
`flutter config --jdk-dir=<JDK_DIRECTORY>`
Note that this is a global configuration for Flutter.

Alternatively, to continue using your configured Java version, update the AGP
version specified in the following files to a compatible AGP
version (minimum compatible AGP version: 7.0) as necessary:
    -   /home/user/project/testproj/android/build.gradle

See
https://developer.android.com/build/releases/gradle-plugin for details on
compatible Java/AGP versions.
```

**After Modification**

```
To keep the default AGP version 8.1.0, download a compatible Java version 
(Java 17 <= compatible Java version < Java 21). Configure this Java version 
globally for Flutter by running:

  flutter config --jdk-dir=<JDK_DIRECTORY>

Alternatively, to continue using your current Java version, update the AGP 
version in the following file(s) to a compatible version (minimum AGP version: 7.0):

  /home/user/project/testproj/android/build.gradle

For details on compatible Java and AGP versions, see
https://developer.android.com/build/releases/gradle-plugin
```

Fixes #152460
2024-09-11 16:21:16 +00:00
Loïc Sharma
3bda455f4e
Improve 'flutter downgrade' error message (#154434)
`flutter downgrade` fails if you haven't used `flutter upgrade`:

```
$ flutter downgrade
There is no previously recorded version for channel "stable".
```

It's not clear what actions a user should take from this error message. Here's the new error message:

```
$ flutter downgrade
It looks like you haven't run "flutter upgrade" on channel "stable".

"flutter downgrade" undoes the last "flutter upgrade".

To switch to a specific Flutter version, see: https://flutter.dev/to/switch-flutter-version
```

Depends on https://github.com/flutter/website/pull/11098
2024-09-04 22:06:31 +00:00
Gabriel Terwesten
f0860d83f5
[native assets] Rewrite install names for relocated native libraries (#153054)
Native libraries that are contributed by native asset builders can depend on each other. For macOS and iOS, native libraries are repackaged into Frameworks, which renders install names that have been written into dependent libraries invalid. 

With this change, a mapping between old and new install names is maintained, and install names in dependent libraries are rewritten as a final step.

Related to https://github.com/dart-lang/native/issues/190
2024-08-29 14:51:23 +00:00
Reid Baker
114dd89bbb
Update flutter build apk -h to indicate that target arch is not supported in debug mode. (#154111)
Part of #153359
2024-08-26 19:48:46 +00:00
chunhtai
dde2328185
Android analyze command should run pub (#153953)
The android command will build the android project partially and thus will need to run pub
2024-08-23 17:57:07 +00:00
Matan Lurey
a9e94d9045
Do not silently fail pub get even if output-mode is "none" (#153596)
I am making an assumption `OutputMode.none` should _really_ mean
`OutputMode.failuresOnly`, that is, if we ever get a non-zero exit code,
we still want to know why. If I've somehow misunderstood that, LMK and
I'm happy to revert this PR or make adjustments.

This fixes the bug where if you were to do:

```sh
git clone https://github.com/myuser/fork-of-flutter
cd fork-of-flutter
./bin/flutter update-packages
```

You now get:

1. An actual error message, versus no output at all.
2. A warning that a common reason is not tracking a remote, with
instructions to fix it.

Closes https://github.com/flutter/flutter/issues/148569.
2024-08-22 09:12:54 -07:00
Sigurd Meldgaard
dfdd5f80f2
Fix flutter test in workspace (#153919)
Follow-up to #153754.
2024-08-22 15:34:47 +02:00
Andrew Kolos
4a03b76c68
Handle "Service connection disposed" error from VmService disconnecting while requests are outstanding (#153714)
Fixes umbrella issue https://github.com/flutter/flutter/issues/153471, including its children: https://github.com/flutter/flutter/issues/153472, https://github.com/flutter/flutter/issues/153473, and https://github.com/flutter/flutter/issues/153474.

The VM service can be disposed at any time during requests (e.g. the user closes the app or stops debugging in VSCode)[^1]. a479f91e80 and a7d8707a59 updated package:vm_service to throw new `RPCError`s when the service disconnects while requests are inflight. Therefore, we need to handle these exceptions in the tool. See umbrella issue for more details.

I plan on cherry-picking this change to the stable channel.

[^1]: https://github.com/flutter/flutter/issues/153471#issuecomment-2296294221
2024-08-20 16:39:19 +00:00
Sigurd Meldgaard
a9daf58829
Reland "Load parent package config" (#153754)
Reverts flutter/flutter#153752
Relands https://github.com/flutter/flutter/pull/150850

Now with attached g3fix
2024-08-20 15:30:46 +02:00
Sigurd Meldgaard
276674e760
Revert "Load parent package config" (#153752)
Reverts flutter/flutter#150850

Seems we need a G3Fix
2024-08-20 12:49:42 +02:00
Sigurd Meldgaard
1a2e25c2d8
Load parent package config (#150850)
Fixes #150196
2024-08-20 09:34:35 +02:00
Jason Simmons
d23be7a07d
[web] Fix reading of the --local-web-sdk flag and remove the copy of useLocalWebSdk in DebuggingOptions (#152642) 2024-08-08 16:27:21 +00:00
LouiseHsu
51606f99a4
Fix flutter build ipa --export-method not accepting enterprise flag (#153047)
When implementing the fix for https://github.com/flutter/flutter/issues/149369, I missed accounting for the `enterprise` flag for `flutter build ipa` 😬

Fixes https://github.com/flutter/flutter/issues/153000
2024-08-08 16:07:27 +00:00
Matan Lurey
40d9fcf767
Document that flutter drive --test-arguments can opt-in to dart test (#152410)
Closes https://github.com/flutter/flutter/issues/51135.
Closes https://github.com/flutter/flutter/issues/145499.

Making this the _default_, or better discoverable, is tracked in
https://github.com/flutter/flutter/issues/152409.

You'll notice I also removed `-rexpanded`; @jonahwilliams believes that
was accidentally copied over from else-where, and never did anything
(someone I guess could have parsed it in `void main(...)`, but given
https://github.com/flutter/flutter/issues/51135 &
https://github.com/flutter/flutter/issues/145499 that seems unlikely.
2024-07-26 18:25:58 -07:00
Ben Konyi
33b402d24c
Reland "Launch DDS from Dart SDK and prepare to serve DevTools from DDS (#146593)" (#152386)
This reverts commit 7cdc23b3e1.

The failure in the `native_assets_test` integration test on Windows was caused by the DevTools process not being shutdown by the `ColdRunner` when running the profile mode portion of the test. This resulted in the test being unable to clean up the project created by the test as DevTools was still holding onto a handle within the directory. This PR adds back the mistakenly removed DevTools shutdown logic in the `ColdRunner`.
2024-07-26 20:51:19 +00:00
Jenn Magder
f33ffc00ea
Use Xcode build setting PRODUCT_NAME to find app and archive paths (#140242)
1. Instead of getting the `FULL_PRODUCT_NAME` Xcode build setting (`Runner.app`) instead use `PRODUCT_NAME` since most places really want the product name, and the extension stripping wasn't correct when the name contained periods.
2. Don't instruct the user to open the `xcarchive` in Xcode if it doesn't exist.

Fixes https://github.com/flutter/flutter/issues/140212
2024-07-22 23:54:24 +00:00
auto-submit[bot]
7cdc23b3e1
Reverts "Launch DDS from Dart SDK and prepare to serve DevTools from DDS (#146593)" (#151781)
Reverts: flutter/flutter#146593
Initiated by: zanderso
Reason for reverting: Consistently failing `Windows_android native_assets_android` as in https://ci.chromium.org/ui/p/flutter/builders/prod/Windows_android%20native_assets_android/2533/overview 
Original PR Author: bkonyi

Reviewed By: {christopherfujino, kenzieschmoll}

This change reverts the following previous change:
This change is a major step towards moving away from shipping DDS via Pub.

The first component of this PR is the move away from importing package:dds to launch DDS. Instead, DDS is launched out of process using the `dart development-service` command shipped with the Dart SDK. This makes Flutter's handling of DDS consistent with the standalone Dart VM.

The second component of this PR is the initial work to prepare for the removal of instances of DevTools being served manually by the flutter_tool, instead relying on DDS to serve DevTools. This will be consistent with how the standalone Dart VM serves DevTools, tying the DevTools lifecycle to a live DDS instance. This will allow for the removal of much of the logic needed to properly manage the lifecycle of the DevTools server in a future PR. Also, by serving DevTools from DDS, users will no longer need to forward a secondary port in remote workflows as DevTools will be available on the DDS port.

There's two remaining circumstances that will prevent us from removing DevtoolsRunner completely:

 - The daemon's `devtools.serve` endpoint
 - `flutter drive`'s `--profile-memory` flag used for recording memory profiles

This PR also includes some refactoring around `DebuggingOptions` to reduce the number of debugging related arguments being passed as parameters adjacent to a `DebuggingOptions` instance.
2024-07-15 19:55:18 +00:00
Ben Konyi
f023430859
Launch DDS from Dart SDK and prepare to serve DevTools from DDS (#146593)
This change is a major step towards moving away from shipping DDS via
Pub.

The first component of this PR is the move away from importing
package:dds to launch DDS. Instead, DDS is launched out of process using
the `dart development-service` command shipped with the Dart SDK. This
makes Flutter's handling of DDS consistent with the standalone Dart VM.

The second component of this PR is the initial work to prepare for the
removal of instances of DevTools being served manually by the
flutter_tool, instead relying on DDS to serve DevTools. This will be
consistent with how the standalone Dart VM serves DevTools, tying the
DevTools lifecycle to a live DDS instance. This will allow for the
removal of much of the logic needed to properly manage the lifecycle of
the DevTools server in a future PR. Also, by serving DevTools from DDS,
users will no longer need to forward a secondary port in remote
workflows as DevTools will be available on the DDS port. This code is currently 
commented out and will be enabled in a future PR.

There's two remaining circumstances that will prevent us from removing
DevtoolsRunner completely:

 - The daemon's `devtools.serve` endpoint
- `flutter drive`'s `--profile-memory` flag used for recording memory
profiles

This PR also includes some refactoring around `DebuggingOptions` to
reduce the number of debugging related arguments being passed as
parameters adjacent to a `DebuggingOptions` instance.
2024-07-15 14:08:31 -04:00
Kevin Moore
ec16c86972
tool/build/web: move source-maps CLI flag to "general" web section (#151722)
...now that wasm supports source maps (see https://github.com/flutter/flutter/pull/151643)
2024-07-15 14:17:39 +00:00
Martin Kustermann
ee7e5ec275
Emit source maps for wasm in flutter build web --wasm (#151643)
This will make

* `flutter run` have source maps enabled by default
* `flutter build` have source maps disabled by default

which mirrors what happens already today with the js compilers.

For local development this works quite well - even better than with
dart2js (see dart2js issues in [0]).
We do have some follow-up items for source maps in dart2wasm compiler,
see [1]

[0]
[flutter/flutter/issues/151641](https://github.com/flutter/flutter/issues/151641)
[1]
[dart-lang/sdk/issues/56232](https://github.com/dart-lang/sdk/issues/56232)
2024-07-13 10:24:16 +02:00
Andrew Kolos
5103d75743
[tool] Remove some usages of deprecated usage package (#151359)
Partially addresses https://github.com/flutter/flutter/issues/150575 and https://github.com/flutter/flutter/issues/150665

Will require a g3fix.
2024-07-09 18:17:21 +00:00
Kenzie Davisson
5ebc993dff
Write the package config location to the test bootstrap. (#150440)
Work towards. This is the Flutter companion to
https://github.com/dart-lang/test/pull/2245. Work towards
https://github.com/dart-lang/test/issues/2246.
2024-07-09 09:36:19 -07:00
Navaron Bracke
ab8bc00e2c
Fix project name fallback (#150614)
This PR changes the project name logic for `flutter create` to look for the name in the pubspec.yaml `name` field,
before falling back to the directory name.

Fixes https://github.com/flutter/flutter/issues/53106 

*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
2024-07-03 16:28:27 +00:00
Sigurd Meldgaard
21d996929b
Refactor BuildInfo to always require packageConfigPath (#150559)
Refactor warming up to #150196
2024-07-02 11:19:31 +02:00
John McDole
33be93b210
Read AndroidManifest.xml and emit manifest-aar-impeller-(enabled|disabled) analytics (#150970)
Same as #150791 except with AARs (`flutter build module`)
2024-07-01 18:50:24 +00:00
Alejandro Santiago
47e65e806f
Use caret syntax with flutter create command (#150920)
The Pull Request changes the `dartSdkVersionBounds` value, which gets templated into the `pubspec.yaml` from the `flutter create`:

ffdeaa1995/packages/flutter_tools/templates/app/pubspec.yaml.tmpl (L8)

As from the Dart dependencies ["Best practices"](https://dart.dev/tools/pub/dependencies#use-caret-syntax) section of the documentation:

> Use caret syntax
Specify dependencies using the [caret syntax](https://dart.dev/tools/pub/dependencies#caret-syntax). This allows the pub tool to select newer versions of the package when they become available. Further, it places an upper bound on the allowed version.

To learn more about the Caret syntax, refer to the [Caret syntax documentation](ffdeaa1995/packages/flutter_tools/templates/app/pubspec.yaml.tmpl (L8)).

**Additional context**
- https://github.com/VGVentures/io_crossword/pull/592#event-13304953743 (cc: @kevmoo)
- [Very Good Templates](https://github.com/VeryGoodOpenSource/very_good_templates) relies on the Caret syntax when templating the Dart SDK
2024-06-28 16:46:34 +00:00
Jackson Gardner
74688cea3d
Have flutter.js load local canvaskit instead of the CDN when appropriate (#150806)
If the user specifies the `--no-web-resources-cdn` or `--local-web-sdk`, we should use the local version of CanvasKit. `flutter.js` now has a flag that can be specified in the build configuration that tells it to load locally instead.

Also, added a link to the relevant docs in the web template warnings.

This addresses https://github.com/flutter/flutter/issues/148713
Also fixes https://github.com/flutter/flutter/issues/145559
2024-06-27 18:44:04 +00:00
LouiseHsu
9a673175ab
Fixes flutter build ipa failure: Command line name "app-store" is deprecated. Use "app-store-connect" (#150407)
Fixes https://github.com/flutter/flutter/issues/149369
2024-06-27 07:42:21 +00:00
Parker Lougheed
c946a5a526
Switch to more reliable flutter.dev link destinations in the tool (#150587)
Contributes to https://github.com/flutter/website/issues/10363.
2024-06-26 23:30:39 +00:00
Matan Lurey
a6a8caaa73
Read AndroidManifest.xml and emit manifest-impeller-(enabled|disabled) analytics (#150791)
Work towards https://github.com/flutter/flutter/issues/132712.

After this PR, after a completed `flutter build apk` command, we:

- Emit a `manifest-impeller-disabled` command if `io.flutter.embedding.android.EnableImpeller` is `'false'`.
- Emit a `manifest-impeller-disabled` command if `io.flutter.embedding.android.EnableImpeller` is _missing_.
- Emit a `manifest-impeller-enabled` command if `io.flutter.embedding.android.EnableImpeller` is `'true'`.

We will need to change the default (see `_impellerEnabledByDefault` in `project.dart`) before releasing, otherwise we will misreport `manifest-impeller-disabled` at a much higher rate than actual. If there is a way to instead compute the default instead of hard-coding, that would have been good.

See <https://docs.flutter.dev/perf/impeller#android> for details on the key-value pair.

---

I also did a tad of TLC, by removing the (now-defunct) `Usage` events for `flutter build ios`, so they are consistent.

/cc @zanderso, @chinmaygarde, @jonahwilliams
2024-06-25 22:41:23 +00:00
Sigurd Meldgaard
6629df635b
Remove dubious comment (#150608)
Follow-up to
https://github.com/flutter/flutter/pull/150349#discussion_r1648050036

I don't see how the code is preparing a union of anything here. I think
the comment is just broken.

This comment seems to have appeared in
https://github.com/flutter/flutter/pull/6093
It might have been mistakenly copied from
[here](a0227cab15 (diff-a6e4bf25b45ecb000db25d7343a44f018ff5302d4695eaa1277d804d2252c1f5R148))
(where it makes a lot more sense).
2024-06-25 09:46:28 +02:00
Sigurd Meldgaard
16e7adedd4
Stop looking for .packages when analyzing (#150349)
Not sure exactly what this was supposed to do, but pub no longer writes
".packages" and has not done since:
https://github.com/dart-lang/pub/pull/3413. So this check would never
find a '.packages'.

Not sure if this code was doing anything useful - but it does not seem
to have been missed for a couple of years.

This is a warm-up for: https://github.com/flutter/flutter/issues/150196

It was added in https://github.com/flutter/flutter/pull/6093 seemingly
without tests of this functionality.
2024-06-21 10:29:27 +02:00
Andrew Kolos
8e4f704abc
[CLI tool] in flutter test, consider --flavor when validating the cached asset bundle (#150461)
Fixes https://github.com/flutter/flutter/issues/150296

**Context.** `flutter test` has its own code path for writing flutter app [assets](https://docs.flutter.dev/ui/assets/assets-and-images). https://github.com/flutter/flutter/pull/132985 introduced [flavor-conditional asset bundling ](https://docs.flutter.dev/deployment/flavors#conditionally-bundling-assets-based-on-flavor), which lets users control which assets get bundled based on `--flavor`. `--flavor` is supported in `flutter test`.

**Bug and fix.** `--flavor` isn't considered when deciding whether we need to rebuild this asset bundle:

5e448f4ce5/packages/flutter_tools/lib/src/commands/test.dart (L709)

This PR address this by writing the value of `--flavor` to a file in the build directory and checking that when validating the cached asset bundle.
2024-06-20 17:45:09 +00:00
Lexycon
0287c22564
Add 'fail-fast' argument to flutter test (#149587)
This adds the 'fail-fast' argument to flutter test, since dart test already supports this feature. Tests can now be stopped after first failure. 

Fixes #124406
2024-06-17 22:06:07 +00:00
Mouad Debbar
ee10d2fc3a
[web] Change --web-renderer default from auto to canvaskit (#149773)
- When `--web-renderer` is omitted, keep the value `null` until it later materializes to either `canvaskit` or `skwasm`.
- No more hardcoded defaults anywhere. We use `WebRendererMode.defaultForJs/defaultForWasm` instead.
- When in `--wasm` mode, the JS fallback is now `canvaskit` instead of `auto`.
- Add test for defaulting to `skwasm` when `--wasm` is enabled.

Fixes https://github.com/flutter/flutter/issues/149826
2024-06-10 16:38:09 +00:00
Victoria Ashworth
529a4d2bac
Disable sandboxing for macOS apps and tests in CI (#149618)
macOS 14 added new requirements that un-codesigned sandbox apps must be granted access when changed. Waiting for this UI caused macOS tests to fail on macOS 14 because the test runner forced codesigning off. Additionally, adding codesigning is not sufficient, since it must still be approved before codesigning is enough to pass the check. As a workaround, this PR disables sandboxing for macOS apps/tests in CI.

![Screenshot 2024-05-30 at 2 41 33 PM](https://github.com/flutter/flutter/assets/682784/1bc32620-5edb-420a-866c-5cc529b2ac55)

https://developer.apple.com/documentation/updates/security#June-2023)
> App Sandbox now associates your macOS app with its sandbox container using its code signature. The operating system asks the person using your app to grant permission if it tries to access a sandbox container associated with a different app. For more information, see [Accessing files from the macOS App Sandbox](https://developer.apple.com/documentation/security/app_sandbox/accessing_files_from_the_macos_app_sandbox).

And that link explains why this is happening on a macOS 14 update:

> In macOS 14 and later, the operating system uses your app’s code signature to associate it with its sandbox container. If your app tries to access the sandbox container owned by another app, the system asks the person using your app whether to grant access. If the person denies access and your app is already running, then it can’t read or write the files in the other app’s sandbox container. If the person denies access while your app is launching and trying to enter the other app’s sandbox container, your app fails to launch.
> 
> The operating system also tracks the association between an app’s code signing identity and its sandbox container for helper tools, including launch agents. If a person denies permission for a launch agent to enter its sandbox container and the app fails to start, launchd starts the launch agent again and the operating system re-requests access.

Fixes https://github.com/flutter/flutter/issues/149268.
Fixes framework part of https://github.com/flutter/flutter/issues/149264.
Might fix packages issue: https://github.com/flutter/flutter/issues/149329.

Verified framework tests:
https://ci.chromium.org/ui/p/flutter/builders/staging.shadow/Mac%20plugin_test_macos/9/overview
https://ci.chromium.org/ui/p/flutter/builders/staging.shadow/Mac%20run_debug_test_macos/2/overview
https://ci.chromium.org/ui/p/flutter/builders/staging.shadow/Mac%20tool_integration_tests_4_4/2/overview
https://ci.chromium.org/ui/p/flutter/builders/staging.shadow/Mac%20integration_ui_test_test_macos/3/overview
https://ci.chromium.org/ui/p/flutter/builders/staging.shadow/Mac%20flavors_test_macos/3/overview
https://ci.chromium.org/ui/p/flutter/builders/staging.shadow/Mac_benchmark%20complex_layout_scroll_perf_macos__timeline_summary/6/overview
2024-06-04 21:51:19 +00:00