Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Reland "Build iOS unittest target in unopt builds" (#44356)" #44821

Merged
merged 5 commits into from
Aug 31, 2023

Conversation

cyanglaz
Copy link
Contributor

@cyanglaz cyanglaz commented Aug 17, 2023

Relands #44301

The original PR was reverted in #44356

The assert flutter_dylib_time <= ios_test_lib_time, final_message check is reverted in 70dd9e4, so we are safe to land this again.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@cyanglaz cyanglaz requested a review from dnfield August 17, 2023 19:54
@cyanglaz cyanglaz marked this pull request as ready for review August 17, 2023 19:54
@@ -263,7 +263,6 @@ source_set("ios_test_flutter_mrc") {
}

shared_library("ios_test_flutter") {
testonly = true
Copy link
Member

Choose a reason for hiding this comment

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

Why are we getting rid of this? It seems like a useful guard against non-test targets including test TUs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When this flag is on, because flutter_framework is not testonly, it cannot depend on ios_test_flutter

Copy link
Contributor

Choose a reason for hiding this comment

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

We should not make flutter_framework depend on ios_test_flutter, we should update some higher level BUILD.gn that checks if unit tests are enabled and if so include ios_test_flutter (if ios etc.)

Copy link
Contributor

Choose a reason for hiding this comment

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

e.g. in //BUILD.gn something like

if (enable_unittests && is_ios) {
  public_deps += [ "//flutter/shell/platform/darwin/ios:ios_test_flutter" ]
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add testonly= true back now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No. Or I can make group(darwin) testonly? If that's a problem I can move the dependency to a upper level. Eventually I should be able to find a unbrella build target that is testonly up in the chain.

@chinmaygarde
Copy link
Member

LGTM with nits.

@@ -263,7 +263,6 @@ source_set("ios_test_flutter_mrc") {
}

shared_library("ios_test_flutter") {
testonly = true
Copy link
Contributor

Choose a reason for hiding this comment

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

We should not make flutter_framework depend on ios_test_flutter, we should update some higher level BUILD.gn that checks if unit tests are enabled and if so include ios_test_flutter (if ios etc.)

@cyanglaz
Copy link
Contributor Author

@chinmaygarde @dnfield Updated per review comments. PTAL

@@ -9,6 +9,9 @@ import("//flutter/shell/platform/config.gni")
group("darwin") {
if (is_ios) {
deps = [ "ios:flutter_framework" ]
if (is_debug) {
Copy link
Contributor

Choose a reason for hiding this comment

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

How about just if (enable_unittests)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

enable_unittests = current_toolchain == host_toolchain || is_fuchsia || is_mac, I will add || is_ios

@cyanglaz cyanglaz requested a review from dnfield August 22, 2023 17:08
@cyanglaz
Copy link
Contributor Author

I moved the test to the top level unittest target, now we can keep the testonly flag

@chinmaygarde
Copy link
Member

I am not sure why GitHub is confused about this. @dnfield Can you reset your review? The assert doesn't exist anymore so this is good to go.

@dnfield dnfield added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 31, 2023
@auto-submit auto-submit bot merged commit 1d703f0 into flutter:main Aug 31, 2023
@cyanglaz cyanglaz deleted the reland_unittest_target_unopt_build branch August 31, 2023 20:08
zanderso added a commit that referenced this pull request Aug 31, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Aug 31, 2023
…133810)

flutter/engine@51090e3...ca513c9

2023-08-31 [email protected] Revert "Reland "Build iOS unittest target in unopt builds" (#44356)"" (flutter/engine#45346)
2023-08-31 [email protected] Lazily allocate RasterCacheItems only when caching is enabled (flutter/engine#45211)
2023-08-31 [email protected] Roll Skia from 8ff4fd208c26 to 5d08dadd2ef4 (3 revisions) (flutter/engine#45340)
2023-08-31 [email protected] Reland "Build iOS unittest target in unopt builds" (#44356)" (flutter/engine#44821)
2023-08-31 [email protected] Update comment const_finder.dart (flutter/engine#45180)
2023-08-31 [email protected] Replace an unnecessary util function with PostSync (flutter/engine#45190)
2023-08-31 [email protected] Roll Skia from cda0cfaadfd7 to 8ff4fd208c26 (3 revisions) (flutter/engine#45337)
2023-08-31 [email protected] Roll Dart SDK from 0cea73a8d3c3 to ac3bc9f6351a (4 revisions) (flutter/engine#45336)
2023-08-31 [email protected] [macOS] Link __availability_version_check (flutter/engine#45333)
2023-08-31 [email protected] Roll Skia from 8c05d5103d6b to cda0cfaadfd7 (3 revisions) (flutter/engine#45334)
2023-08-31 [email protected] Adds an --rbe option to tools/gn that works on Linux hosts (flutter/engine#45271)
2023-08-31 [email protected] Migrate VK calls of GrBackend* (flutter/engine#45325)
2023-08-31 [email protected] Roll buildroot (flutter/engine#45329)
2023-08-31 [email protected] Revert dl split (flutter/engine#45326)
2023-08-31 [email protected] Roll Skia from d113402de2ce to 8c05d5103d6b (4 revisions) (flutter/engine#45331)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
autosubmit Merge PR when tree becomes green via auto submit App platform-ios
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants