Fix no op host debug builds doing work (#178077)
Fixes https://github.com/flutter/flutter/issues/176667
I don't really know what I'm doing here, but as far as I can tell from:
https://github.com/swiftlang/swift/blob/main/docs/Driver.md#output-file-maps
the swift dependencies file is only output for incremental builds, not
builds with whole module optimization enabled.
> "swift-dependencies" entries are required to perform incremental
builds (see below).
This would align with the logs from that issue saying the file is
missing every time (because it is never output in the first place). So
try simply removing it? Fixes the issue for me locally
## 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].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [ ] 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.
- [ ] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
**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
[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
---------
Co-authored-by: Gray Mackall <mackall@google.com>
diff --git a/engine/src/build/toolchain/darwin/swiftc.py b/engine/src/build/toolchain/darwin/swiftc.py
index d2123f0..d4769d2 100755
--- a/engine/src/build/toolchain/darwin/swiftc.py
+++ b/engine/src/build/toolchain/darwin/swiftc.py
@@ -249,10 +249,12 @@
if args.whole_module_optimization:
fragment = {
+ # In WMO, the Swift driver does not emit reference-dependencies (.swiftdeps).
+ # Do not declare them in the OutputFileMap to avoid Ninja expecting a file
+ # that will never be produced.
'const-values': f'{out_name}.swiftconstvalues',
'dependencies': f'{out_name}.d',
'diagnostics': f'{out_name}.dia',
- 'swift-dependencies': f'{out_name}.swiftdeps',
}
else:
fragment = {
diff --git a/engine/src/build/toolchain/mac/BUILD.gn b/engine/src/build/toolchain/mac/BUILD.gn
index d882a79..a3dfd6f 100644
--- a/engine/src/build/toolchain/mac/BUILD.gn
+++ b/engine/src/build/toolchain/mac/BUILD.gn
@@ -227,7 +227,6 @@
if (swift_whole_module_optimization) {
outputs += [
"$_output_dir/{{module_name}}.swiftconstvalues",
- "$_output_dir/{{module_name}}.swiftdeps",
]
} else {
outputs += [ "$_output_dir/{{module_name}}.priors" ]