Skip to content

Linux build hooks: Read compiler config from CMakeCache.txt#181004

Merged
auto-submit[bot] merged 4 commits into
flutter:masterfrom
simolus3:linux-compiler-from-cmake
Feb 27, 2026
Merged

Linux build hooks: Read compiler config from CMakeCache.txt#181004
auto-submit[bot] merged 4 commits into
flutter:masterfrom
simolus3:linux-compiler-from-cmake

Conversation

@simolus3

@simolus3 simolus3 commented Jan 14, 2026

Copy link
Copy Markdown
Contributor

When running native assets as part of an app build, the Flutter tool tries to infer clang, archiver and linker executables from PATH. That logic doesn't handle builds where clang is used with a GNU linker.

To fix this, this PR changes the logic to read CMakeCache.txt from the Linux build directory, which contains all tools to be used in the build.
While Windows also uses CMake, we don't need to adopt this for Windows since MSVC is the only supported toolchain for that target anyway.

Closes #180770. cc @dcharkes

Pre-launch Checklist

@simolus3 simolus3 requested review from a team as code owners January 14, 2026 21:13
@github-actions github-actions Bot added tool Affects the "flutter" command-line tool. See also t: labels. a: desktop Running on desktop team-ios Owned by iOS platform team labels Jan 14, 2026
@simolus3 simolus3 changed the title Linux: Read compiler config from CMakeCache.txt Linux build hooks: Read compiler config from CMakeCache.txt Jan 14, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the logic for discovering C compiler configurations on Linux for native assets. Instead of inferring toolchain paths from the system PATH, it now reads the CMakeCache.txt file from the Linux build directory. This change makes the toolchain discovery more robust, especially for non-standard configurations like using clang with a GNU linker. The changes are well-contained and include necessary updates to tests. I've found one critical issue in the implementation that should be addressed.

Comment thread packages/flutter_tools/lib/src/isolated/native_assets/linux/native_assets.dart Outdated

@dcharkes dcharkes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️ Thanks @simolus3!

I believe the data assets failure is because it's the flutter run that runs some of the data assets hooks instead of flutter assemble. Flutter run invokes cmake, which invokes flutter assemble. On the first run, there is no cmake build directory yet. I believe we should make it so that we don't try to look up the ccompiler config at all if we're not trying to run the build for the code assets. When looking at the stack trace we might actually be running the build for the code assets twice now? Once in flutter run and once in flutter assemble? Code assets should only be built in flutter assemble.

cc @mosuem who last touched this code. Actually, doing data assets during flutter run also means data assets won't work at all if the flutter app is embedded in another app? Because then flutter run isn't run. It would just be another xcodebuild invoking another xcodebuild, or another cmake invoking the flutter cmake.

Edit: relevant part of the stack trace:

[ 18.2s] stdout:            #3      FlutterNativeAssetsBuildRunnerImpl.setCCompilerConfig (package:flutter_tools/src/isolated/native_assets/native_assets.dart:282:75)
-> this is followed by `_runDartHooks` which _also_ builds the code assets.

[ 18.2s] stdout:            #4      runFlutterSpecificHooks (package:flutter_tools/src/isolated/native_assets/native_assets.dart:106:23)
[ 18.2s] stdout:            <asynchronous suspension>
[ 18.2s] stdout:            #5      DartBuild.build (package:flutter_tools/src/build_system/targets/native_assets.dart:76:14)
[ 18.2s] stdout:            <asynchronous suspension>
[ 18.2s] stdout:            #6      _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:937:9)
[ 18.2s] stdout:            <asynchronous suspension>
[ 18.2s] stdout:            #7      FlutterBuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:684:16)
[ 18.2s] stdout:            <asynchronous suspension>
[ 18.2s] stdout:            #8      FlutterHookRunnerNative.runHooks (package:flutter_tools/src/build_system/targets/hook_runner_native.dart:45:35)
[ 18.2s] stdout:            <asynchronous suspension>
[ 18.2s] stdout:            #9      HotRunner._updateDevFS (package:flutter_tools/src/run_hot.dart:502:30)
[ 18.2s] stdout:            <asynchronous suspension>
[ 18.2s] stdout:            #10     HotRunner._attach (package:flutter_tools/src/run_hot.dart:309:40)
[ 18.2s] stdout:            <asynchronous suspension>
[ 18.2s] stdout:            #11     RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:904:26)
-> we are in `flutter run`, not `flutter assemble`

@dcharkes

Copy link
Copy Markdown
Contributor

@simolus3 We can investigate why the build hooks are run in flutter run after the data assets experiment was added later, if you can simply pass a bool somewhere to prevent the code-assets hooks from running in flutter run and prevent looking up the ccompiler in flutter run, then that's good enough for this PR.

@dcharkes

Copy link
Copy Markdown
Contributor

And also, maybe add to the PR description we don't need the same for Windows, because Flutter mandates MSVC and we don't support the cmake on Windows targeting clang.

@simolus3 simolus3 force-pushed the linux-compiler-from-cmake branch from 724c5b4 to f9bc9f3 Compare January 23, 2026 15:35
@simolus3

simolus3 commented Jan 23, 2026

Copy link
Copy Markdown
Contributor Author

if you can simply pass a bool somewhere to prevent the code-assets hooks from running in flutter run and prevent looking up the ccompiler in flutter run, then that's good enough for this PR.

Do you have a suggestion on where to put that? It's not like the run command invokes that directly. We could add a flag to FlutterHookRunner.runHooks to describe whether code assets should be built, but we'd have to pass that through both HotRunner and ColdRunner. We could also make RunCommand pass a wrapper of the default FlutterHookRunner that would inject a flag to disable building code assets.

None of these solutions feels particularly clean, do you see another option?

And also, maybe add to the PR description we don't need the same for Windows, because Flutter mandates MSVC and we don't support the cmake on Windows targeting clang.

Done 👍

@dcharkes

Copy link
Copy Markdown
Contributor

if you can simply pass a bool somewhere to prevent the code-assets hooks from running in flutter run and prevent looking up the ccompiler in flutter run, then that's good enough for this PR.

Do you have a suggestion on where to put that? It's not like the run command invokes that directly. We could add a flag to FlutterHookRunner.runHooks to describe whether code assets should be built, but we'd have to pass that through both HotRunner and ColdRunner. We could also make RunCommand pass a wrapper of the default FlutterHookRunner that would inject a flag to disable building code assets.

None of these solutions feels particularly clean, do you see another option?

Yeah, I don't understand why it is setup the way it is.

@mosuem and @bkonyi Could you elaborate on why #174685 introduced running hooks from the flutter run process. For code assets, flutter run invokes xcodebuild/gradle which then invokes flutter assemble. Only the flutter assemble should be running hooks for code assets.

If the data assets must be run in flutter run instead of flutter assemble for some architectural reason, there might be, because the bundling logic is likely completely different, Then the way the the HooksRunner is set up now with

/// Build the list of [AssetBuildTarget]s for a given [TargetPlatform].
///
/// It needs access to other parameters such as the [fileSystem] or
/// [environmentDefines] to retrieve options for some of the targets.
static List<AssetBuildTarget> targetsFor({
required TargetPlatform targetPlatform,
required Map<String, String> environmentDefines,
required FileSystem fileSystem,
required List<SupportedAssetTypes> supportedAssetTypes,
}) {
switch (targetPlatform) {
case TargetPlatform.windows_x64:
return _windowsTarget(supportedAssetTypes, Architecture.x64);
case TargetPlatform.linux_x64:
return _linuxTarget(supportedAssetTypes, Architecture.x64);
case TargetPlatform.linux_arm64:
return _linuxTarget(supportedAssetTypes, Architecture.arm64);
case TargetPlatform.linux_riscv64:
return _linuxTarget(supportedAssetTypes, Architecture.riscv64);
case TargetPlatform.windows_arm64:
return _windowsTarget(supportedAssetTypes, Architecture.arm64);
case TargetPlatform.darwin:
return _macTargets(environmentDefines, supportedAssetTypes);
case TargetPlatform.android:
case TargetPlatform.android_arm:
case TargetPlatform.android_arm64:
case TargetPlatform.android_x64:
return _androidTargets(targetPlatform, environmentDefines, supportedAssetTypes);
case TargetPlatform.ios:
return _iosTargets(environmentDefines, fileSystem, supportedAssetTypes);
case TargetPlatform.web_javascript:
return _webTarget(supportedAssetTypes);
case TargetPlatform.tester:
return _flutterTesterTarget(supportedAssetTypes);
case TargetPlatform.fuchsia_arm64:
case TargetPlatform.fuchsia_x64:
case TargetPlatform.unsupported:
throwToolExit('No targets defined for target platform $targetPlatform.');
}
}

makes no sense. Because then the set of targets is dependent on context - where exactly in the flutter tool we are, not only on platform.

If the data assets must not be run in flutter run but also only in flutter assemble, then why did we start running hooks in flutter run.

The PR has no description of an architectural decision here.

@dcharkes

Copy link
Copy Markdown
Contributor

@simolus3 I've prototyped a setup where I prevent running the hooks for code assets from flutter run and the hooks for data assets from flutter assemble. #181542 It's still rough. And I don't know if I'm violating some invariants (e.g. now a Target depends on an env variable, that surely messes with caching).

Could you try rebasing your PR on top of that PR and see if the data assets test starts passing for you locally?

github-merge-queue Bot pushed a commit that referenced this pull request Jan 29, 2026
Since #174685, the code assets
are wrongly invoked on in the `flutter run` process (in addition to
rightly in the `flutter assemble` process). This should not be the case:
We don't know the target architectures we want to build for, neither do
we know which native compiler is set by the native build system that is
invoking us
(#181004 (review)).

This PR changes the way the hooks are invoked:

* From `flutter run` only run for data assets. (Unblocks
#181004)
* All other remaining calls, run for both. There might be locations
where data assets could be disabled, but they are needed from the
`DartBuild` target at least in some cases.

The architecture becomes as follows:

* `FlutterNativeAssetsBuildRunner` this is basically the wrapper around
the `NativeAssetsBuildRunner` and there should be only one in a
`flutter_tools` instance, unchanged.
* `FlutterHookRunner` seems to be an interface to be able to supply
fakes, unchanged.
* `runFlutterSpecificHooks` get bool arguments whether they should build
code assets and data assets.
* The callers of these APIs know what asset types are needed in that
context. The invocations added in
#174685 should be data assets
only.
* Simplification: `FlutterHookRunnerNative.runHooks` does no longer use
`globals.buildSystem.build`. Instead, it directly calls
`runFlutterSpecificHooks`.
* This completely avoids writing to the flutter build directory, which
was the cause of #178529.
* The `ProtocolExtension`s (which determine which asset types are built)
are taken from `AssetBuildTarget`s, and take into account what asset
types to build, unchanged.

Tests:

* Code assets covered by existing integration tests such as
packages/flutter_tools/test/integration.shard/isolated/native_assets_test.dart
* Data assets covered by existing integration tests such as
packages/flutter_tools/test/integration.shard/isolated/dart_data_asset_test.dart
* This PR completely deletes
packages/flutter_tools/test/general.shard/build_system/targets/hook_runner_native_test.dart.
It was a unit test that testsed the specific workaround, not the effect
of the workaround.
* I've manually tested the steps in
#178529 (comment),
the issue does not come back.
  
> the underlying issue did involve conflict between state written by the
original run of the build system versus state written by the secondary
run executed for the data assets. If the secondary run can be avoided,
then that seems cleaner.

Yep, removed.
@LongCatIsLooong LongCatIsLooong removed the team-ios Owned by iOS platform team label Jan 29, 2026
@simolus3 simolus3 force-pushed the linux-compiler-from-cmake branch from f9bc9f3 to 7005f88 Compare February 2, 2026 21:40
@simolus3

simolus3 commented Feb 2, 2026

Copy link
Copy Markdown
Contributor Author

@dcharkes I'm lazy and waited for your PR to hit main, but I've rebased on top of that now.

I've added the option passing the build directory as a type for buildCodeAssets because it's only relevant when building code assets. Not configuring compilers on code targets when we're not building code assets seems to work.

@dcharkes

dcharkes commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

I've added the option passing the build directory as a type for buildCodeAssets because it's only relevant when building code assets. Not configuring compilers on code targets when we're not building code assets seems to work.

In #181507 I'm also changing the build output directory and making it only be used in installCodeAssets. So maybe we should wait on another land to main and then rebase again. 🙈 That PR turned out to be a huge refactor (see PR description).

LongCatIsLooong pushed a commit to LongCatIsLooong/flutter that referenced this pull request Feb 6, 2026
…er#181542)

Since flutter#174685, the code assets
are wrongly invoked on in the `flutter run` process (in addition to
rightly in the `flutter assemble` process). This should not be the case:
We don't know the target architectures we want to build for, neither do
we know which native compiler is set by the native build system that is
invoking us
(flutter#181004 (review)).

This PR changes the way the hooks are invoked:

* From `flutter run` only run for data assets. (Unblocks
flutter#181004)
* All other remaining calls, run for both. There might be locations
where data assets could be disabled, but they are needed from the
`DartBuild` target at least in some cases.

The architecture becomes as follows:

* `FlutterNativeAssetsBuildRunner` this is basically the wrapper around
the `NativeAssetsBuildRunner` and there should be only one in a
`flutter_tools` instance, unchanged.
* `FlutterHookRunner` seems to be an interface to be able to supply
fakes, unchanged.
* `runFlutterSpecificHooks` get bool arguments whether they should build
code assets and data assets.
* The callers of these APIs know what asset types are needed in that
context. The invocations added in
flutter#174685 should be data assets
only.
* Simplification: `FlutterHookRunnerNative.runHooks` does no longer use
`globals.buildSystem.build`. Instead, it directly calls
`runFlutterSpecificHooks`.
* This completely avoids writing to the flutter build directory, which
was the cause of flutter#178529.
* The `ProtocolExtension`s (which determine which asset types are built)
are taken from `AssetBuildTarget`s, and take into account what asset
types to build, unchanged.

Tests:

* Code assets covered by existing integration tests such as
packages/flutter_tools/test/integration.shard/isolated/native_assets_test.dart
* Data assets covered by existing integration tests such as
packages/flutter_tools/test/integration.shard/isolated/dart_data_asset_test.dart
* This PR completely deletes
packages/flutter_tools/test/general.shard/build_system/targets/hook_runner_native_test.dart.
It was a unit test that testsed the specific workaround, not the effect
of the workaround.
* I've manually tested the steps in
flutter#178529 (comment),
the issue does not come back.
  
> the underlying issue did involve conflict between state written by the
original run of the build system versus state written by the secondary
run executed for the data assets. If the secondary run can be avoided,
then that seems cleaner.

Yep, removed.
flutter-zl pushed a commit to flutter-zl/flutter that referenced this pull request Feb 10, 2026
…er#181542)

Since flutter#174685, the code assets
are wrongly invoked on in the `flutter run` process (in addition to
rightly in the `flutter assemble` process). This should not be the case:
We don't know the target architectures we want to build for, neither do
we know which native compiler is set by the native build system that is
invoking us
(flutter#181004 (review)).

This PR changes the way the hooks are invoked:

* From `flutter run` only run for data assets. (Unblocks
flutter#181004)
* All other remaining calls, run for both. There might be locations
where data assets could be disabled, but they are needed from the
`DartBuild` target at least in some cases.

The architecture becomes as follows:

* `FlutterNativeAssetsBuildRunner` this is basically the wrapper around
the `NativeAssetsBuildRunner` and there should be only one in a
`flutter_tools` instance, unchanged.
* `FlutterHookRunner` seems to be an interface to be able to supply
fakes, unchanged.
* `runFlutterSpecificHooks` get bool arguments whether they should build
code assets and data assets.
* The callers of these APIs know what asset types are needed in that
context. The invocations added in
flutter#174685 should be data assets
only.
* Simplification: `FlutterHookRunnerNative.runHooks` does no longer use
`globals.buildSystem.build`. Instead, it directly calls
`runFlutterSpecificHooks`.
* This completely avoids writing to the flutter build directory, which
was the cause of flutter#178529.
* The `ProtocolExtension`s (which determine which asset types are built)
are taken from `AssetBuildTarget`s, and take into account what asset
types to build, unchanged.

Tests:

* Code assets covered by existing integration tests such as
packages/flutter_tools/test/integration.shard/isolated/native_assets_test.dart
* Data assets covered by existing integration tests such as
packages/flutter_tools/test/integration.shard/isolated/dart_data_asset_test.dart
* This PR completely deletes
packages/flutter_tools/test/general.shard/build_system/targets/hook_runner_native_test.dart.
It was a unit test that testsed the specific workaround, not the effect
of the workaround.
* I've manually tested the steps in
flutter#178529 (comment),
the issue does not come back.
  
> the underlying issue did involve conflict between state written by the
original run of the build system versus state written by the secondary
run executed for the data assets. If the secondary run can be avoided,
then that seems cleaner.

Yep, removed.
@simolus3 simolus3 force-pushed the linux-compiler-from-cmake branch from d7109be to 325530e Compare February 12, 2026 16:49
@github-actions github-actions Bot added the team-ios Owned by iOS platform team label Feb 12, 2026
rickhohler pushed a commit to rickhohler/flutter that referenced this pull request Feb 19, 2026
…er#181542)

Since flutter#174685, the code assets
are wrongly invoked on in the `flutter run` process (in addition to
rightly in the `flutter assemble` process). This should not be the case:
We don't know the target architectures we want to build for, neither do
we know which native compiler is set by the native build system that is
invoking us
(flutter#181004 (review)).

This PR changes the way the hooks are invoked:

* From `flutter run` only run for data assets. (Unblocks
flutter#181004)
* All other remaining calls, run for both. There might be locations
where data assets could be disabled, but they are needed from the
`DartBuild` target at least in some cases.

The architecture becomes as follows:

* `FlutterNativeAssetsBuildRunner` this is basically the wrapper around
the `NativeAssetsBuildRunner` and there should be only one in a
`flutter_tools` instance, unchanged.
* `FlutterHookRunner` seems to be an interface to be able to supply
fakes, unchanged.
* `runFlutterSpecificHooks` get bool arguments whether they should build
code assets and data assets.
* The callers of these APIs know what asset types are needed in that
context. The invocations added in
flutter#174685 should be data assets
only.
* Simplification: `FlutterHookRunnerNative.runHooks` does no longer use
`globals.buildSystem.build`. Instead, it directly calls
`runFlutterSpecificHooks`.
* This completely avoids writing to the flutter build directory, which
was the cause of flutter#178529.
* The `ProtocolExtension`s (which determine which asset types are built)
are taken from `AssetBuildTarget`s, and take into account what asset
types to build, unchanged.

Tests:

* Code assets covered by existing integration tests such as
packages/flutter_tools/test/integration.shard/isolated/native_assets_test.dart
* Data assets covered by existing integration tests such as
packages/flutter_tools/test/integration.shard/isolated/dart_data_asset_test.dart
* This PR completely deletes
packages/flutter_tools/test/general.shard/build_system/targets/hook_runner_native_test.dart.
It was a unit test that testsed the specific workaround, not the effect
of the workaround.
* I've manually tested the steps in
flutter#178529 (comment),
the issue does not come back.
  
> the underlying issue did involve conflict between state written by the
original run of the build system versus state written by the secondary
run executed for the data assets. If the secondary run can be avoided,
then that seems cleaner.

Yep, removed.
@hellohuanlin hellohuanlin removed the request for review from a team February 19, 2026 22:32

@dcharkes dcharkes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry! This fell off my radar! LGTM with some small comments.

Comment thread packages/flutter_tools/lib/src/isolated/native_assets/native_assets.dart Outdated
@simolus3 simolus3 force-pushed the linux-compiler-from-cmake branch from 325530e to ffa140b Compare February 25, 2026 21:44
@vashworth

Copy link
Copy Markdown
Contributor

from triage: @loic-sharma @bkonyi Who's the best person to serve as a second reviewer on this?

@loic-sharma

Copy link
Copy Markdown
Member

I suspect @bkonyi and @robert-ancell might be the ideal second reviewers from the tool perspective and the Linux build system perspective respectively.

@robert-ancell robert-ancell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes make sense to me and I don't see any issues, thanks!

@dcharkes dcharkes added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 27, 2026
@auto-submit auto-submit Bot added this pull request to the merge queue Feb 27, 2026
Merged via the queue into flutter:master with commit 8cc302c Feb 27, 2026
145 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Feb 27, 2026
@simolus3 simolus3 deleted the linux-compiler-from-cmake branch February 27, 2026 08:04
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Feb 27, 2026
Roll Flutter from b31548feb941 to 1141b2bdce66 (56 revisions)

flutter/flutter@b31548f...1141b2b

2026-02-27 maxime.pontoire@me.com flutter#182361 Fix delegate copy on plugins init (flutter/flutter#182362)
2026-02-27 engine-flutter-autoroll@skia.org Roll Dart SDK from 8b036b3e63cb to 1cdb7dfd913e (1 revision) (flutter/flutter#183004)
2026-02-27 vegorov@google.com Manual roll Dart SDK to 3.12.0-192.0.dev (flutter/flutter#182883)
2026-02-27 engine-flutter-autoroll@skia.org Roll Skia from e2062707b0c0 to ed220c490eea (1 revision) (flutter/flutter#182992)
2026-02-27 engine-flutter-autoroll@skia.org Roll Skia from e5aa1ab5c59c to e2062707b0c0 (3 revisions) (flutter/flutter#182989)
2026-02-27 oss@simonbinder.eu Linux build hooks: Read compiler config from CMakeCache.txt (flutter/flutter#181004)
2026-02-27 engine-flutter-autoroll@skia.org Roll ICU from a86a32e67b8d to 7971660ba630 (3 revisions) (flutter/flutter#182986)
2026-02-27 engine-flutter-autoroll@skia.org Roll Skia from 49c2de95384e to e5aa1ab5c59c (2 revisions) (flutter/flutter#182980)
2026-02-27 flar@google.com [Impeller] Remove shared rendering data from TextFrame (flutter/flutter#182886)
2026-02-27 robert.ancell@canonical.com Add fl_view_new_sized_to_content() (flutter/flutter#182924)
2026-02-27 737941+loic-sharma@users.noreply.github.com [Shortcuts] Improve focus node debug labels (flutter/flutter#181834)
2026-02-27 34871572+gmackall@users.noreply.github.com Add a cli flag for toggling HCPP use, and enable it (flutter/flutter#182516)
2026-02-27 nate.w5687@gmail.com `SizedBox.square()` (flutter/flutter#182731)
2026-02-27 1961493+harryterkelsen@users.noreply.github.com [web] Fix stack corruption in Skwasm and harden withStackScope API (flutter/flutter#182912)
2026-02-26 jason-simmons@users.noreply.github.com Roll zlib to 7eda07b1e067 (flutter/flutter#182692)
2026-02-26 bkonyi@google.com [ CI ] Don't crash analysis when ktlint isn't on PATH (flutter/flutter#181854)
2026-02-26 34871572+gmackall@users.noreply.github.com Add calls to await `flutterDriver.waitUntilFirstFrameRasterized()` for all `android_engine_test` screenshot tests (flutter/flutter#182961)
2026-02-26 engine-flutter-autoroll@skia.org Roll Skia from f44d7db68805 to 49c2de95384e (30 revisions) (flutter/flutter#182957)
2026-02-26 robert.ancell@canonical.com Support sending window constraints in metrics events (flutter/flutter#182921)
2026-02-26 34465683+rkishan516@users.noreply.github.com Reland: remove material in context_menu_controller_test, icon_test, list_wheel_scroll_view_test, media_query_test, platform_menu_bar_test (flutter/flutter#182891)
2026-02-26 116356835+AbdeMohlbi@users.noreply.github.com Remove some instances of useMaterial3: true (flutter/flutter#182944)
2026-02-26 serhatguler@hotmail.de [Impeller] Use bilinear filtering for non-uniform scaled text (flutter/flutter#182224)
2026-02-26 chingjun@google.com Add a ResidentCompilerFactory to create ResidentCompiler instances. (flutter/flutter#182930)
2026-02-26 chingjun@google.com Add a getter in run.dart to access use-application-binary flag. (flutter/flutter#182931)
2026-02-26 mdebbar@google.com [web] Roll Firefox to 148 (flutter/flutter#182859)
2026-02-26 engine-flutter-autoroll@skia.org Roll Packages from acd9adb to e1d0169 (8 revisions) (flutter/flutter#182946)
2026-02-26 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from XI0Ax7fbtYE4XKYAQ... to G1GwOdVt5bM7GjMSY... (flutter/flutter#182942)
2026-02-26 robert.ancell@canonical.com Add test for WindowPositioner.toString (flutter/flutter#182906)
2026-02-26 robert.ancell@canonical.com Remove unused function prototype (flutter/flutter#182915)
2026-02-26 ahmedsameha1@gmail.com Resolve inconsistency with SchedulerBinding.scheduleTask usage recomm… (flutter/flutter#182531)
2026-02-26 51901607+O-Hannonen@users.noreply.github.com Fix false positives for hit test misses in flutter_test (flutter/flutter#180856)
2026-02-26 116356835+AbdeMohlbi@users.noreply.github.com Replace an instance of flutter/engine with flutter/flutter (flutter/flutter#182655)
2026-02-26 146823759+brahim-guaali@users.noreply.github.com Use null-aware elements in widgets/routes.dart (flutter/flutter#181242)
2026-02-26 37593616+itsAdityaRathore@users.noreply.github.com Fix typos in method names across multiple files (flutter/flutter#182584)
2026-02-26 brunocorona.alcantar@gmail.com Fix RawAutocomplete crash when options are hidden (flutter/flutter#182785)
2026-02-26 flar@google.com Describe implications of tree-status and Google Testing for PRs (flutter/flutter#182916)
2026-02-26 ahmedsameha1@gmail.com Make sure that a StretchingOverscrollIndicator doesn't crash when it … (flutter/flutter#182499)
2026-02-26 srawlins@google.com framework: Use a super-parameter in several missed cases (flutter/flutter#182580)
2026-02-25 nate.w5687@gmail.com `WidgetStatesConstraint` as a mixin (flutter/flutter#181704)
2026-02-25 Rusino@users.noreply.github.com Paint the paragraph as a single image (flutter/flutter#181206)
2026-02-25 rmolivares@renzo-olivares.dev Remove `ExtendSelectionByPageIntent` (flutter/flutter#182642)
2026-02-25 34465683+rkishan516@users.noreply.github.com feat: add few required properties to test widgets app (flutter/flutter#182805)
2026-02-25 prbillingsley89@gmail.com Updates MenuAnchor to respect software keyboard (flutter/flutter#180975)
2026-02-25 jason-simmons@users.noreply.github.com Roll ImGui to v1.92.6-docking (flutter/flutter#182799)
2026-02-25 jason-simmons@users.noreply.github.com Roll GoogleTest to e9907112b472 (flutter/flutter#182795)
2026-02-25 Veselblu@yandex.ru Make positionInlineChildren assert much clearer (flutter/flutter#182093)
...
xxxOVALxxx pushed a commit to xxxOVALxxx/flutter that referenced this pull request Mar 10, 2026
…181004)

When running native assets as part of an app build, the Flutter tool
tries to infer clang, archiver and linker executables from `PATH`. That
logic doesn't handle builds where clang is used with a GNU linker.

To fix this, this PR changes the logic to read `CMakeCache.txt` from the
Linux build directory, which contains all tools to be used in the build.
While Windows also uses CMake, we don't need to adopt this for Windows
since MSVC is the only supported toolchain for that target anyway.

Closes flutter#180770. cc @dcharkes 

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [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.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[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
okorohelijah pushed a commit to okorohelijah/packages that referenced this pull request Mar 26, 2026
…r#11137)

Roll Flutter from b31548feb941 to 1141b2bdce66 (56 revisions)

flutter/flutter@b31548f...1141b2b

2026-02-27 maxime.pontoire@me.com flutter#182361 Fix delegate copy on plugins init (flutter/flutter#182362)
2026-02-27 engine-flutter-autoroll@skia.org Roll Dart SDK from 8b036b3e63cb to 1cdb7dfd913e (1 revision) (flutter/flutter#183004)
2026-02-27 vegorov@google.com Manual roll Dart SDK to 3.12.0-192.0.dev (flutter/flutter#182883)
2026-02-27 engine-flutter-autoroll@skia.org Roll Skia from e2062707b0c0 to ed220c490eea (1 revision) (flutter/flutter#182992)
2026-02-27 engine-flutter-autoroll@skia.org Roll Skia from e5aa1ab5c59c to e2062707b0c0 (3 revisions) (flutter/flutter#182989)
2026-02-27 oss@simonbinder.eu Linux build hooks: Read compiler config from CMakeCache.txt (flutter/flutter#181004)
2026-02-27 engine-flutter-autoroll@skia.org Roll ICU from a86a32e67b8d to 7971660ba630 (3 revisions) (flutter/flutter#182986)
2026-02-27 engine-flutter-autoroll@skia.org Roll Skia from 49c2de95384e to e5aa1ab5c59c (2 revisions) (flutter/flutter#182980)
2026-02-27 flar@google.com [Impeller] Remove shared rendering data from TextFrame (flutter/flutter#182886)
2026-02-27 robert.ancell@canonical.com Add fl_view_new_sized_to_content() (flutter/flutter#182924)
2026-02-27 737941+loic-sharma@users.noreply.github.com [Shortcuts] Improve focus node debug labels (flutter/flutter#181834)
2026-02-27 34871572+gmackall@users.noreply.github.com Add a cli flag for toggling HCPP use, and enable it (flutter/flutter#182516)
2026-02-27 nate.w5687@gmail.com `SizedBox.square()` (flutter/flutter#182731)
2026-02-27 1961493+harryterkelsen@users.noreply.github.com [web] Fix stack corruption in Skwasm and harden withStackScope API (flutter/flutter#182912)
2026-02-26 jason-simmons@users.noreply.github.com Roll zlib to 7eda07b1e067 (flutter/flutter#182692)
2026-02-26 bkonyi@google.com [ CI ] Don't crash analysis when ktlint isn't on PATH (flutter/flutter#181854)
2026-02-26 34871572+gmackall@users.noreply.github.com Add calls to await `flutterDriver.waitUntilFirstFrameRasterized()` for all `android_engine_test` screenshot tests (flutter/flutter#182961)
2026-02-26 engine-flutter-autoroll@skia.org Roll Skia from f44d7db68805 to 49c2de95384e (30 revisions) (flutter/flutter#182957)
2026-02-26 robert.ancell@canonical.com Support sending window constraints in metrics events (flutter/flutter#182921)
2026-02-26 34465683+rkishan516@users.noreply.github.com Reland: remove material in context_menu_controller_test, icon_test, list_wheel_scroll_view_test, media_query_test, platform_menu_bar_test (flutter/flutter#182891)
2026-02-26 116356835+AbdeMohlbi@users.noreply.github.com Remove some instances of useMaterial3: true (flutter/flutter#182944)
2026-02-26 serhatguler@hotmail.de [Impeller] Use bilinear filtering for non-uniform scaled text (flutter/flutter#182224)
2026-02-26 chingjun@google.com Add a ResidentCompilerFactory to create ResidentCompiler instances. (flutter/flutter#182930)
2026-02-26 chingjun@google.com Add a getter in run.dart to access use-application-binary flag. (flutter/flutter#182931)
2026-02-26 mdebbar@google.com [web] Roll Firefox to 148 (flutter/flutter#182859)
2026-02-26 engine-flutter-autoroll@skia.org Roll Packages from acd9adb to e1d0169 (8 revisions) (flutter/flutter#182946)
2026-02-26 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from XI0Ax7fbtYE4XKYAQ... to G1GwOdVt5bM7GjMSY... (flutter/flutter#182942)
2026-02-26 robert.ancell@canonical.com Add test for WindowPositioner.toString (flutter/flutter#182906)
2026-02-26 robert.ancell@canonical.com Remove unused function prototype (flutter/flutter#182915)
2026-02-26 ahmedsameha1@gmail.com Resolve inconsistency with SchedulerBinding.scheduleTask usage recomm… (flutter/flutter#182531)
2026-02-26 51901607+O-Hannonen@users.noreply.github.com Fix false positives for hit test misses in flutter_test (flutter/flutter#180856)
2026-02-26 116356835+AbdeMohlbi@users.noreply.github.com Replace an instance of flutter/engine with flutter/flutter (flutter/flutter#182655)
2026-02-26 146823759+brahim-guaali@users.noreply.github.com Use null-aware elements in widgets/routes.dart (flutter/flutter#181242)
2026-02-26 37593616+itsAdityaRathore@users.noreply.github.com Fix typos in method names across multiple files (flutter/flutter#182584)
2026-02-26 brunocorona.alcantar@gmail.com Fix RawAutocomplete crash when options are hidden (flutter/flutter#182785)
2026-02-26 flar@google.com Describe implications of tree-status and Google Testing for PRs (flutter/flutter#182916)
2026-02-26 ahmedsameha1@gmail.com Make sure that a StretchingOverscrollIndicator doesn't crash when it … (flutter/flutter#182499)
2026-02-26 srawlins@google.com framework: Use a super-parameter in several missed cases (flutter/flutter#182580)
2026-02-25 nate.w5687@gmail.com `WidgetStatesConstraint` as a mixin (flutter/flutter#181704)
2026-02-25 Rusino@users.noreply.github.com Paint the paragraph as a single image (flutter/flutter#181206)
2026-02-25 rmolivares@renzo-olivares.dev Remove `ExtendSelectionByPageIntent` (flutter/flutter#182642)
2026-02-25 34465683+rkishan516@users.noreply.github.com feat: add few required properties to test widgets app (flutter/flutter#182805)
2026-02-25 prbillingsley89@gmail.com Updates MenuAnchor to respect software keyboard (flutter/flutter#180975)
2026-02-25 jason-simmons@users.noreply.github.com Roll ImGui to v1.92.6-docking (flutter/flutter#182799)
2026-02-25 jason-simmons@users.noreply.github.com Roll GoogleTest to e9907112b472 (flutter/flutter#182795)
2026-02-25 Veselblu@yandex.ru Make positionInlineChildren assert much clearer (flutter/flutter#182093)
...
mboetger pushed a commit to mboetger/flutter that referenced this pull request Mar 26, 2026
…181004)

When running native assets as part of an app build, the Flutter tool
tries to infer clang, archiver and linker executables from `PATH`. That
logic doesn't handle builds where clang is used with a GNU linker.

To fix this, this PR changes the logic to read `CMakeCache.txt` from the
Linux build directory, which contains all tools to be used in the build.
While Windows also uses CMake, we don't need to adopt this for Windows
since MSVC is the only supported toolchain for that target anyway.

Closes flutter#180770. cc @dcharkes 

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [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.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[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
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
…r#11137)

Roll Flutter from b31548feb941 to 1141b2bdce66 (56 revisions)

flutter/flutter@b31548f...1141b2b

2026-02-27 maxime.pontoire@me.com flutter#182361 Fix delegate copy on plugins init (flutter/flutter#182362)
2026-02-27 engine-flutter-autoroll@skia.org Roll Dart SDK from 8b036b3e63cb to 1cdb7dfd913e (1 revision) (flutter/flutter#183004)
2026-02-27 vegorov@google.com Manual roll Dart SDK to 3.12.0-192.0.dev (flutter/flutter#182883)
2026-02-27 engine-flutter-autoroll@skia.org Roll Skia from e2062707b0c0 to ed220c490eea (1 revision) (flutter/flutter#182992)
2026-02-27 engine-flutter-autoroll@skia.org Roll Skia from e5aa1ab5c59c to e2062707b0c0 (3 revisions) (flutter/flutter#182989)
2026-02-27 oss@simonbinder.eu Linux build hooks: Read compiler config from CMakeCache.txt (flutter/flutter#181004)
2026-02-27 engine-flutter-autoroll@skia.org Roll ICU from a86a32e67b8d to 7971660ba630 (3 revisions) (flutter/flutter#182986)
2026-02-27 engine-flutter-autoroll@skia.org Roll Skia from 49c2de95384e to e5aa1ab5c59c (2 revisions) (flutter/flutter#182980)
2026-02-27 flar@google.com [Impeller] Remove shared rendering data from TextFrame (flutter/flutter#182886)
2026-02-27 robert.ancell@canonical.com Add fl_view_new_sized_to_content() (flutter/flutter#182924)
2026-02-27 737941+loic-sharma@users.noreply.github.com [Shortcuts] Improve focus node debug labels (flutter/flutter#181834)
2026-02-27 34871572+gmackall@users.noreply.github.com Add a cli flag for toggling HCPP use, and enable it (flutter/flutter#182516)
2026-02-27 nate.w5687@gmail.com `SizedBox.square()` (flutter/flutter#182731)
2026-02-27 1961493+harryterkelsen@users.noreply.github.com [web] Fix stack corruption in Skwasm and harden withStackScope API (flutter/flutter#182912)
2026-02-26 jason-simmons@users.noreply.github.com Roll zlib to 7eda07b1e067 (flutter/flutter#182692)
2026-02-26 bkonyi@google.com [ CI ] Don't crash analysis when ktlint isn't on PATH (flutter/flutter#181854)
2026-02-26 34871572+gmackall@users.noreply.github.com Add calls to await `flutterDriver.waitUntilFirstFrameRasterized()` for all `android_engine_test` screenshot tests (flutter/flutter#182961)
2026-02-26 engine-flutter-autoroll@skia.org Roll Skia from f44d7db68805 to 49c2de95384e (30 revisions) (flutter/flutter#182957)
2026-02-26 robert.ancell@canonical.com Support sending window constraints in metrics events (flutter/flutter#182921)
2026-02-26 34465683+rkishan516@users.noreply.github.com Reland: remove material in context_menu_controller_test, icon_test, list_wheel_scroll_view_test, media_query_test, platform_menu_bar_test (flutter/flutter#182891)
2026-02-26 116356835+AbdeMohlbi@users.noreply.github.com Remove some instances of useMaterial3: true (flutter/flutter#182944)
2026-02-26 serhatguler@hotmail.de [Impeller] Use bilinear filtering for non-uniform scaled text (flutter/flutter#182224)
2026-02-26 chingjun@google.com Add a ResidentCompilerFactory to create ResidentCompiler instances. (flutter/flutter#182930)
2026-02-26 chingjun@google.com Add a getter in run.dart to access use-application-binary flag. (flutter/flutter#182931)
2026-02-26 mdebbar@google.com [web] Roll Firefox to 148 (flutter/flutter#182859)
2026-02-26 engine-flutter-autoroll@skia.org Roll Packages from acd9adb to e1d0169 (8 revisions) (flutter/flutter#182946)
2026-02-26 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from XI0Ax7fbtYE4XKYAQ... to G1GwOdVt5bM7GjMSY... (flutter/flutter#182942)
2026-02-26 robert.ancell@canonical.com Add test for WindowPositioner.toString (flutter/flutter#182906)
2026-02-26 robert.ancell@canonical.com Remove unused function prototype (flutter/flutter#182915)
2026-02-26 ahmedsameha1@gmail.com Resolve inconsistency with SchedulerBinding.scheduleTask usage recomm… (flutter/flutter#182531)
2026-02-26 51901607+O-Hannonen@users.noreply.github.com Fix false positives for hit test misses in flutter_test (flutter/flutter#180856)
2026-02-26 116356835+AbdeMohlbi@users.noreply.github.com Replace an instance of flutter/engine with flutter/flutter (flutter/flutter#182655)
2026-02-26 146823759+brahim-guaali@users.noreply.github.com Use null-aware elements in widgets/routes.dart (flutter/flutter#181242)
2026-02-26 37593616+itsAdityaRathore@users.noreply.github.com Fix typos in method names across multiple files (flutter/flutter#182584)
2026-02-26 brunocorona.alcantar@gmail.com Fix RawAutocomplete crash when options are hidden (flutter/flutter#182785)
2026-02-26 flar@google.com Describe implications of tree-status and Google Testing for PRs (flutter/flutter#182916)
2026-02-26 ahmedsameha1@gmail.com Make sure that a StretchingOverscrollIndicator doesn't crash when it … (flutter/flutter#182499)
2026-02-26 srawlins@google.com framework: Use a super-parameter in several missed cases (flutter/flutter#182580)
2026-02-25 nate.w5687@gmail.com `WidgetStatesConstraint` as a mixin (flutter/flutter#181704)
2026-02-25 Rusino@users.noreply.github.com Paint the paragraph as a single image (flutter/flutter#181206)
2026-02-25 rmolivares@renzo-olivares.dev Remove `ExtendSelectionByPageIntent` (flutter/flutter#182642)
2026-02-25 34465683+rkishan516@users.noreply.github.com feat: add few required properties to test widgets app (flutter/flutter#182805)
2026-02-25 prbillingsley89@gmail.com Updates MenuAnchor to respect software keyboard (flutter/flutter#180975)
2026-02-25 jason-simmons@users.noreply.github.com Roll ImGui to v1.92.6-docking (flutter/flutter#182799)
2026-02-25 jason-simmons@users.noreply.github.com Roll GoogleTest to e9907112b472 (flutter/flutter#182795)
2026-02-25 Veselblu@yandex.ru Make positionInlineChildren assert much clearer (flutter/flutter#182093)
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: desktop Running on desktop team-ios Owned by iOS platform team tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Native assets: Take GNU linkers into account when building Linux apps

6 participants