-
Notifications
You must be signed in to change notification settings - Fork 29.7k
[native_assets] Find more CCompilerConfig on Linux
#175323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sometimes the necessary
code_assetsbinaries alongsideclang++have differing names than the current code expects.
Nit: Maybe be explicit about "CCompilerConfig binaries in package:code_assets passed into build hooks". (The flutter tools passes in the config, but the code assets package defines what the possible config is.)
(Also the PR title could be something like [native_assets] Find more CCompilerConfig on Linux.)
This change is necessary on some systems with atypical installs, such as NixOS.
Maybe repeat precisely what is different. The explicit executable names.
This PR also fixes my CI using only the
llvmPackages_20.clangUseLLVMNix package, for reference
Sweet! 👍
One question that should be answered in the PR description is:
- Where in flutter tools is clang used? And does flutter tools use only clang or does it also use ld and ar? And if so, is it consistent in all places. (I think it's basically only clang and clang++ from PATH: packages/flutter_tools/lib/src/linux/build_linux.dart.)
Maybe add comments there and here to say that these should be kept consistent.
| const kArBinary = 'llvm-ar'; | ||
| const kLdBinary = 'ld.lld'; | ||
| const kClangBinaryOptions = ['clang']; | ||
| const kArBinaryOptions = ['llvm-ar', 'ar']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add comments what is the default name, and where the alternative names occur.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code_assets exec dependenciesCCompilerConfig on Linux
|
dcharkes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once the comment of how flutter_tools uses clang and friends outside of native assets is answered and cross-linked with comments so that it stays consistent.
Ahh, gotcha now--will add another commit for that later today/tomorrow |
|
@dcharkes the only relevant reference I could find to building with flutter/packages/flutter_tools/lib/src/linux/build_linux.dart Lines 170 to 190 in 2d20356
That doesn't seem like it needs a comment linking it to where it's used in Native Assets, as it won't get out of sync? Also didn't see any references to |
flutter/flutter@29a238d...8d0b31d 2025-09-16 [email protected] Roll Packages from fcd5f68 to 0255ac9 (2 revisions) (flutter/flutter#175427) 2025-09-16 [email protected] Adds a11y section locale support for iOS (flutter/flutter#175005) 2025-09-16 [email protected] Roll Skia from 4e9c86d4a6d9 to 7d160bbf9403 (3 revisions) (flutter/flutter#175404) 2025-09-16 [email protected] [native_assets] Find more `CCompilerConfig` on Linux (flutter/flutter#175323) 2025-09-16 [email protected] Roll Dart SDK from 50e61e5bff51 to 700de52f29a9 (3 revisions) (flutter/flutter#175395) 2025-09-16 [email protected] Fix default overlay color in `TabBar` (flutter/flutter#175270) 2025-09-16 [email protected] Migrate to widget state (flutter/flutter#175242) 2025-09-16 [email protected] Roll Skia from 01b0ede33ae9 to 4e9c86d4a6d9 (1 revision) (flutter/flutter#175387) 2025-09-15 [email protected] Merge the engine README into the README of the old buildroot. (flutter/flutter#175384) 2025-09-15 [email protected] Marks Mac_ios microbenchmarks_ios to be unflaky (flutter/flutter#171146) 2025-09-15 [email protected] Deprecate Objective-C plugin template (flutter/flutter#174003) 2025-09-15 [email protected] Add a gn --ccache argument (flutter/flutter#174621) 2025-09-15 [email protected] Update `build.gradle` to remove deprecation warning in `flutter\engine\src\flutter\shell\platform\android` (flutter/flutter#175305) 2025-09-15 [email protected] Show cursor after swipe only if TextField has focus (flutter/flutter#175044) 2025-09-15 [email protected] Roll Skia from f950263bb3d4 to 01b0ede33ae9 (7 revisions) (flutter/flutter#175373) 2025-09-15 [email protected] Update Chromium sysroot to pick up RISC-V support. (flutter/flutter#173671) 2025-09-15 [email protected] Set Gemini Code Assist `include_drafts` to false (flutter/flutter#175098) 2025-09-15 [email protected] Roll Packages from 15e7e89 to fcd5f68 (3 revisions) (flutter/flutter#175366) 2025-09-15 [email protected] Remove 'v' Open DevTools from help on web in profile/release mode (flutter/flutter#172829) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sometimes the necessary binaries `code_assets` expects alongside `clang++` have differing names than the current code expects (e.g., `ld` instead of `ld.lld`) on Linux. This change is necessary on some systems with atypical installs, such as NixOS. These binaries are gathered by the flutter tool and are eventually sent to the build hook for native code assets as the `CCompilerConfig`. Note that the only other reference to `clang`/`clang++` in the linux build system is where it is used to invoke `cmake`, where they are set as the values of the `CC`/`CXX` environment variables. Fixes flutter#175311 CC @dcharkes, this is take two of flutter#175312 > This PR also fixes my CI using only the `llvmPackages_20.clangUseLLVM` Nix package, for reference ## 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
Sometimes the necessary binaries `code_assets` expects alongside `clang++` have differing names than the current code expects (e.g., `ld` instead of `ld.lld`) on Linux. This change is necessary on some systems with atypical installs, such as NixOS. These binaries are gathered by the flutter tool and are eventually sent to the build hook for native code assets as the `CCompilerConfig`. Note that the only other reference to `clang`/`clang++` in the linux build system is where it is used to invoke `cmake`, where they are set as the values of the `CC`/`CXX` environment variables. Fixes flutter#175311 CC @dcharkes, this is take two of flutter#175312 > This PR also fixes my CI using only the `llvmPackages_20.clangUseLLVM` Nix package, for reference ## 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
Sometimes the necessary binaries `code_assets` expects alongside `clang++` have differing names than the current code expects (e.g., `ld` instead of `ld.lld`) on Linux. This change is necessary on some systems with atypical installs, such as NixOS. These binaries are gathered by the flutter tool and are eventually sent to the build hook for native code assets as the `CCompilerConfig`. Note that the only other reference to `clang`/`clang++` in the linux build system is where it is used to invoke `cmake`, where they are set as the values of the `CC`/`CXX` environment variables. Fixes flutter#175311 CC @dcharkes, this is take two of flutter#175312 > This PR also fixes my CI using only the `llvmPackages_20.clangUseLLVM` Nix package, for reference ## 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
Sometimes the necessary binaries `code_assets` expects alongside `clang++` have differing names than the current code expects (e.g., `ld` instead of `ld.lld`) on Linux. This change is necessary on some systems with atypical installs, such as NixOS. These binaries are gathered by the flutter tool and are eventually sent to the build hook for native code assets as the `CCompilerConfig`. Note that the only other reference to `clang`/`clang++` in the linux build system is where it is used to invoke `cmake`, where they are set as the values of the `CC`/`CXX` environment variables. Fixes flutter#175311 CC @dcharkes, this is take two of flutter#175312 > This PR also fixes my CI using only the `llvmPackages_20.clangUseLLVM` Nix package, for reference ## 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
Sometimes the necessary binaries
code_assetsexpects alongsideclang++have differing names than the current code expects (e.g.,ldinstead ofld.lld) on Linux. This change is necessary on some systems with atypical installs, such as NixOS.These binaries are gathered by the flutter tool and are eventually sent to the build hook for native code assets as the
CCompilerConfig.Note that the only other reference to
clang/clang++in the linux build system is where it is used to invokecmake, where they are set as the values of theCC/CXXenvironment variables.Fixes #175311
CC @dcharkes, this is take two of #175312
Pre-launch Checklist
///).