Skip to content

Conversation

@jmagman
Copy link
Member

@jmagman jmagman commented Sep 2, 2020

Description

xcode_backend.sh supported pre-Flutter v0.0.7 created apps that were missing a post-compilation build phase. #64988 reland will require this build phase hook to change the bundled app's Info.plist.

Stop supporting the pre-v0.0.7 Xcode projects missing build phase. Generate a build error on the slim chance these still exist in the wild:
Screen Shot 2020-09-02 at 1 31 16 PM

Related Issues

#7913
#64988

Tests

I added the following tests:

Update the benchmark integration test Xcode projects that were created pre-v0.0.7.
#64988 postsubmit failed on the devicelab:

2020-09-02T11:44:03.947711: stdout:             ♦ codesign --force --verbose --sign A5CFF7959BD4B17F97127C518E8504F2D9562490 -- /Users/flutter/.cocoon/flutter/dev/benchmarks/complex_layout/build/ios/Profile-iphoneos/Runner.app/Frameworks/Flutter.framework/Flutter
stdout:             /Users/flutter/.cocoon/flutter/dev/benchmarks/complex_layout/build/ios/Profile-iphoneos/Runner.app/Frameworks/Flutter.framework/Flutter: signed bundle with Mach-O universal (armv7 x86_64 arm64) [io.flutter.flutter]
stdout:             /Users/flutter/.cocoon/flutter/dev/benchmarks/complex_layout/build/ios/Profile-iphoneos/Runner.app/Info.plist: file does not exist or is not readable or is not a regular file (Error Domain=NSCocoaErrorDomain Code=260 "The file “Info.plist” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/Users/flutter/.cocoon/flutter/dev/benchmarks/complex_layout/build/ios/Profile-iphoneos/Runner.app/Info.plist, NSUnderlyingError=0x7fe71440c460 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}})
stdout:             ♦ plutil -insert NSBonjourServices -json ["_dartobservatory._tcp"] /Users/flutter/.cocoon/flutter/dev/benchmarks/complex_layout/build/ios/Profile-iphoneos/Runner.app/Info.plist
stdout:             /Users/flutter/.cocoon/flutter/dev/benchmarks/complex_layout/build/ios/Profile-iphoneos/Runner.app/Info.plist: file does not exist or is not readable or is not a regular file (Error Domain=NSCocoaErrorDomain Code=260 "The file “Info.plist” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/Users/flutter/.cocoon/flutter/dev/benchmarks/complex_layout/build/ios/Profile-iphoneos/Runner.app/Info.plist, NSUnderlyingError=0x7fc1a7c0ce70 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}})
stdout:             Command PhaseScriptExecution failed with a nonzero exit code

These tests now pass.

Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I signed the [CLA].
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

  • No, no existing tests failed, so this is not a breaking change.
  • Yes, this is a breaking change. If not, delete the remainder of this section.

@jmagman jmagman added c: contributor-productivity Team-specific productivity, code health, technical debt. platform-ios iOS applications specifically tool Affects the "flutter" command-line tool. See also t: labels. t: xcode "xcodebuild" on iOS and general Xcode project management labels Sep 2, 2020
@jmagman jmagman self-assigned this Sep 2, 2020
@jmagman jmagman requested review from dnfield and xster September 2, 2020 21:48
Comment on lines 318 to 320
# Named entry points were introduced in Flutter v0.0.7.
echo "error: Your Xcode project is incompatible with this version of Flutter. Run \"rm -rf ios/Runner.xcodeproj\" and \"flutter create .\" to regenerate."
exit -1
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the actual change. The rest of the PR updates the benchmark Xcode projects.

Copy link
Contributor

Choose a reason for hiding this comment

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

Wow!

);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh $FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh";
Copy link
Member Author

Choose a reason for hiding this comment

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

This was what caused the devicelab errors on #64988 post-submit. xcode_backend.sh without any args was building, thinning, and embedding. However, at this point the generated Info.plist that we will need to edit for #64988 doesn't exist, so it was failing.

Copy link
Contributor

@dnfield dnfield left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@xster xster left a comment

Choose a reason for hiding this comment

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

LGTM

BuildApp
EmbedFlutterFrameworks
# Named entry points were introduced in Flutter v0.0.7.
EchoError "error: Your Xcode project is incompatible with this version of Flutter. Run \"rm -rf ios/Runner.xcodeproj\" and \"flutter create .\" to regenerate."
Copy link
Member

Choose a reason for hiding this comment

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

ultra nit / optional: "Consider source controlling your project before regenerating to inspect the difference."

@jmagman
Copy link
Member Author

jmagman commented Sep 3, 2020

Boo, missed macrobenchmarks...

@jmagman
Copy link
Member Author

jmagman commented Sep 3, 2020

Boo, missed macrobenchmarks...

Never mind these tests are flaky.

@liyuqian
Copy link
Contributor

liyuqian commented Sep 16, 2020

Some compile time regression is detected after this commit. I'd like to confirm that this is expected due to build changes. I'd also like to know a little more about why it's increase significantly, and if there's any hope to make the compile a little faster. (The compile time became even slower when I introduced e2e in #65602). CC @jmagman @kf6gpe

@jmagman
Copy link
Member Author

jmagman commented Sep 16, 2020

Some compile time regression is detected after this commit. I'd like to confirm that this is expected due to build changes. I'd also like to know a little more about why it's increase significantly, and if there's any hope to make the compile a little faster. (The compile time became even slower when I introduced e2e in #65602). CC @jmagman @kf6gpe

@liyuqian Before this PR the benchmarks were not thinning the Flutter frameworks to the targeted architecture because the Xcode projects were created (or copied from) pre-v0.0.7. https://github.com/flutter/flutter/pull/65124/files#diff-0d00f38df3883291f23cee8074ac075dL319-L320
They were calling:

BuildApp
EmbedFlutterFrameworks

instead of:

BuildApp
EmbedFlutterFrameworks
ThinAppFrameworks

The test benchmark app being transferred to the device should be much smaller now, which is a tradeoff we make in exchange for build time. I'd have to look at the logs before and after to confirm that's the cause. However as long as there isn't a compilation regression in a newly created/post v1.0 Flutter app, I'm not sure it's worth investigating too closely...

@liyuqian
Copy link
Contributor

Sounds good. Thanks for the detailed explanation! We can move on as is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c: contributor-productivity Team-specific productivity, code health, technical debt. platform-ios iOS applications specifically t: xcode "xcodebuild" on iOS and general Xcode project management tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants