Skip to content

Commit ab7c1db

Browse files
authored
Update FlutterNativeAssetsBuildRunnerImpl to add ".exe" suffix to its _dartExecutable for Windows (flutter#190761)
This fixes the windows_engine_integration_golden_test on CI, which is currently failing (but not blocking the tree because it is still `bringup: true`). This dart executable path is passed into the `NativeAssetsBuildRunner` constructor, part of `package:hooks`. The `NativeAssetsBuildRunner` code on Windows either runs the executable directly (if it ends in .exe), or runs the executable via `cmd` (if it does not end in .exe). On Windows, the dart executable ends in .exe, but it was not passed in with the .exe suffix. This resulted in trying to run it with `cmd`, which does not work properly in some situations. Run before this change: https://ci.chromium.org/ui/p/flutter/builders/try.shadow/Windows%20windows_engine_integration_golden_test/2/overview Run after this change: https://ci.chromium.org/ui/p/flutter/builders/try.shadow/Windows%20windows_engine_integration_golden_test/3/overview Part of flutter#190301 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
1 parent 55e4f9c commit ab7c1db

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

‎packages/flutter_tools/lib/src/build_system/targets/native_assets.dart‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,7 @@ Future<FlutterNativeAssetsBuildRunner> createFlutterNativeAssetsBuildRunner(
419419
packageConfig,
420420
fileSystem,
421421
environment.logger,
422+
environment.platform,
422423
runPackageName,
423424
includeDevDependencies: includeDevDependencies,
424425
pubspecPath,

‎packages/flutter_tools/lib/src/isolated/native_assets/native_assets.dart‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,7 @@ class FlutterNativeAssetsBuildRunnerImpl implements FlutterNativeAssetsBuildRunn
544544
this.packageConfig,
545545
this.fileSystem,
546546
this.logger,
547+
this.platform,
547548
this.runPackageName,
548549
this.pubspecPath, {
549550
required this.includeDevDependencies,
@@ -554,6 +555,7 @@ class FlutterNativeAssetsBuildRunnerImpl implements FlutterNativeAssetsBuildRunn
554555
final PackageConfig packageConfig;
555556
final FileSystem fileSystem;
556557
final Logger logger;
558+
final Platform platform;
557559
final String runPackageName;
558560

559561
/// Include the dev dependencies of [runPackageName].
@@ -582,7 +584,7 @@ class FlutterNativeAssetsBuildRunnerImpl implements FlutterNativeAssetsBuildRunn
582584
late final Uri _dartExecutable = fileSystem
583585
.directory(Cache.flutterRoot)
584586
.uri
585-
.resolve('bin/cache/dart-sdk/bin/dart');
587+
.resolve('bin/cache/dart-sdk/bin/dart${platform.isWindows ? '.exe' : ''}');
586588

587589
late final packageLayout = PackageLayout.fromPackageConfig(
588590
fileSystem,

‎packages/flutter_tools/lib/src/isolated/native_assets/test/native_assets.dart‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Future<Uri?> testCompilerBuildNativeAssets(BuildInfo buildInfo) async {
4444
buildInfo.packageConfig,
4545
globals.fs,
4646
globals.logger,
47+
globals.platform,
4748
runPackageName,
4849
includeDevDependencies: true,
4950
pubspecPath,

0 commit comments

Comments
 (0)