New issue
Advanced search Search tips

Issue 635302 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 1
Type: Bug



Sign in to add a comment

GN: simplify //build/config/ios/rules.gni

Project Member Reported by sdefresne@chromium.org, Aug 7 2016

Issue description

There is lots of complications to deal with fat build and code signature. This should be refactored by introducing helper template, and always using code signing script (with an option to disable code signature) and using lipo (even for thin builds).
 
Project Member

Comment 1 by bugdroid1@chromium.org, Aug 9 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f0d4ca9d29bb81e3477ddd76fea73721f63fa4a3

commit f0d4ca9d29bb81e3477ddd76fea73721f63fa4a3
Author: sdefresne <sdefresne@chromium.org>
Date: Tue Aug 09 04:24:10 2016

Refactor code signing script and template.

As code signing is enabled for simulator builds, refactor script and
template to eventually always code sign the bundles created on iOS
with either a adhoc signature (when no code signature identity is
available or for simulator builds) or a real code signature (when a
code signature identity is selected for device builds).

BUG= 635302 

Review-Url: https://codereview.chromium.org/2224553002
Cr-Commit-Position: refs/heads/master@{#410573}

[modify] https://crrev.com/f0d4ca9d29bb81e3477ddd76fea73721f63fa4a3/build/config/ios/codesign.py
[modify] https://crrev.com/f0d4ca9d29bb81e3477ddd76fea73721f63fa4a3/build/config/ios/rules.gni
[modify] https://crrev.com/f0d4ca9d29bb81e3477ddd76fea73721f63fa4a3/components/cronet/ios/BUILD.gn

Project Member

Comment 2 by bugdroid1@chromium.org, Aug 9 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/feec21644aabe22f613b822489d71f305ebe2895

commit feec21644aabe22f613b822489d71f305ebe2895
Author: sdefresne <sdefresne@chromium.org>
Date: Tue Aug 09 06:06:33 2016

[iOS] Simplify bundle creation by always calling codesign.py script.

Simplify the creation of bundle on iOS by always using the codesign.py
script to copy the bundle binary as only one configuration was using a
different code path: device build with no valid code signing identity.

Add a --disable-code-signature argument to codesign.py to disable the
creation of the code signature (though it is usually recommended to
just enable adhoc code signature by setting ios_code_signing_identity
to "-").

BUG= 635302 

Review-Url: https://codereview.chromium.org/2221773002
Cr-Commit-Position: refs/heads/master@{#410594}

[modify] https://crrev.com/feec21644aabe22f613b822489d71f305ebe2895/build/config/ios/codesign.py
[modify] https://crrev.com/feec21644aabe22f613b822489d71f305ebe2895/build/config/ios/rules.gni

Project Member

Comment 3 by bugdroid1@chromium.org, Aug 9 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c7091801f98c82e3a1a0aa5c89feed19738c713c

commit c7091801f98c82e3a1a0aa5c89feed19738c713c
Author: sdefresne <sdefresne@chromium.org>
Date: Tue Aug 09 07:05:55 2016

[iOS] Always generate the final binaries using lipo.

To simplify the creation of binary bundles on iOS, always use lipo
to create the final binary, even when not generating fat binaries
(in that case the lipo invocation is just a simple copy unless dSYM
generation or code stripping are enabled).

BUG= 635302 

Review-Url: https://codereview.chromium.org/2222753003
Cr-Commit-Position: refs/heads/master@{#410600}

[modify] https://crrev.com/c7091801f98c82e3a1a0aa5c89feed19738c713c/build/config/ios/rules.gni
[modify] https://crrev.com/c7091801f98c82e3a1a0aa5c89feed19738c713c/build/config/mac/BUILD.gn
[modify] https://crrev.com/c7091801f98c82e3a1a0aa5c89feed19738c713c/build/toolchain/mac/BUILD.gn

Looks like this breaks cronet compile and is blocking the downstream autoroller.

It seems like frameworks need --deep, maybe?  https://codereview.chromium.org/2229613003/
I'm not sure the --deep is required. I'm able to build locally all the targets and thus do not really know what is happening on the bots. I was unable to debug yesterday due to the XCode 7 -> Xcode 8 migration.
When building the framework by itself in Xcode, nothing gets signed.

Once the framework is placed inside a host app, then it gets signed.

Maybe we should disable signing for .frameworks?

Comment 7 by gch...@chromium.org, Aug 10 2016

Labels: -Pri-3 Pri-1
This is now blocking the Chromium roll, as https://chromereviews.googleplex.com/488647014/ cannot land with the cronet code signing error. 
Project Member

Comment 8 by bugdroid1@chromium.org, Aug 10 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3cbe1a432673431822494cca4b8d662eca112d72

commit 3cbe1a432673431822494cca4b8d662eca112d72
Author: sdefresne <sdefresne@chromium.org>
Date: Wed Aug 10 06:45:13 2016

Fix the location of resources in iOS frameworks.

On iOS, the resources for an application and a framework bundle are
located in the root of the bundle (as opposed to macOS where they
are located in the Resources sub-directory).

The incorrect location caused code signature failure (when code
signature is enabled, which is only the case on downstream iOS
bots).

BUG= 635302 

Review-Url: https://codereview.chromium.org/2233663002
Cr-Commit-Position: refs/heads/master@{#410984}

[modify] https://crrev.com/3cbe1a432673431822494cca4b8d662eca112d72/build/config/ios/rules.gni

Project Member

Comment 9 by bugdroid1@chromium.org, Aug 12 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/17a812f225abd54e84dbe4f74c9619d4bdab3cbf

commit 17a812f225abd54e84dbe4f74c9619d4bdab3cbf
Author: sdefresne <sdefresne@chromium.org>
Date: Fri Aug 12 00:22:44 2016

[iOS] Refactor build/config/ios/rules.gni.

Add new template lipo_binary that invokes lipo to create a fat binary
from multiple single architecture binaries (supports thin builds too).

Add new template create_signed_bundle that wraps create_bundle and add
the required parameters to create a signed bundle (supports building
with code signature disabled).

Refactor ios_app_bundle, ios_framework_bundle and ios_xctest targets
to use those two templates and reduce the code duplication. Introduce
intermediate source_set target to reduce dependencies on entitlements
generation for simulator builds.

BUG= 635302 

Review-Url: https://codereview.chromium.org/2219323002
Cr-Commit-Position: refs/heads/master@{#411471}

[modify] https://crrev.com/17a812f225abd54e84dbe4f74c9619d4bdab3cbf/build/config/ios/rules.gni

Status: Fixed (was: Started)

Sign in to add a comment