Opened 3 years ago

Closed 3 years ago

#4905 closed defect (fixed)

build.py script failing

Reported by: pavelz Assignee:
Priority: Unknown Milestone:
Module: Adblock-Plus-for-iOS/macOS Keywords:
Cc: fhd, mario Blocked By:
Blocking: Platform: iOS
Ready: no Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

https://github.com/adblockplus/adblockplussafariios/pull/36

Description

This ticket is a re-creation of #4650 which already had a pull request attached, but meanwhile got completely obsoleted by further Xcode8 reengineering of code signing process. The reengineering was so radical that it warrants a new issue where the changes are explained and a new pull request created. Previous issue and pull request will be closed.

Environment

OSX build box

How to reproduce

  1. run build.py

Observed behaviour

Build fails on missing libpods and consequently also missing eligible signing assets

Expected behaviour

Build is successful and signed

Change History (7)

comment:1 Changed 3 years ago by pavelz

Xcode8 changed the provisioning management quite some. Two of the changes are directly relevant to build.py:

  1. provisioning profiles are not referenced by UUID anymore. Config key PROVISIONING_PROFILE is obsoleted. For referencing specific provisioning profiles there is a new key PROVISIONING_PROFILE_SPECIFIER with value of the profile's symbolic text name. But Xcode8 does not expect the users to need this normally anymore (see point 2)
  2. the preferred method of provisioning configuration is through clicking a new God Checkbox "Automatically manage signing". It cannot be used for ABP: it does not expect that a single project would want to sign with multiple development teams. ABP has one team for devbuilds (enterprise) and another for release (appstore). So ABP must not use automatism.

The signing step in xcodebuild is ultimately driven by just 4 values:

  • PRODUCT_BUNDLE_IDENTIFIER the app id
    • e.g. org.adblockplus.AdblockPlusSafari
  • DEVELOPMENT_TEAM the short team code
    • e.g. GRYYZR985A
  • CODE_SIGN_IDENTITY certificate type, holder name, and optionally the team id again
    • e.g. iPhone Distribution: Eyeo GmbH (GRYYZR985A)
  • PROVISIONING_PROFILE_SPECIFIER the new reference to profile by name
    • e.g. Adblock Plus Extension App Store (without quotes!)

These are normally scattered throughout pbxproj, separated by targets and schemes. There is a better way to do it: xcconfig file, which is essentially a listing of pbxproj values, assignable to targets and schemes centrally. Writing a value in xcconfig and assigning the xcconfig to a target has the same effect as modifying the value in the huge project file editor for that specific target.

The advantage is ultimate: contrary to obscure format of the huge UUID-filled pbxproj, xcconfig is just a simple key-value file, in editability and comprehension comparable to a shell script. Scheme/target specific configuration can be removed from the shell script.

So the patch introduces 4 separate xcconfigs: for devbuild vs. release, and for adblock main app vs. extension. All values which are now in xcconfig were removed from pbxproj, wherever it was specified explicitly. Xcode project editor is so clever that it immediately shows the values drawn from xcconfig instead, so its validity can be verified. It should show the same value, obviously.

SAD DISCLAIMER: assignment of xcconfigs to schemes/targets is hijacked by CocoaPods. Pod is detecting whether Pods xcconfigs are assigned to the project, and is refusing to continue building if it finds some other xcconfig. For that reason, only global level xcconfig could be assigned to AdblockPlus target. xcconfigs for Extension target cannot be applied, so the values in relevant xcconfigs are still configured also in pbxproj. This duplication can be removed once ABP drops CocoaPods integration.

Version 0, edited 3 years ago by pavelz (next)

comment:2 Changed 3 years ago by pavelz

  • Cc fhd added

comment:4 Changed 3 years ago by mario

  • Cc mario added

comment:5 Changed 3 years ago by fhd

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:7 Changed 3 years ago by fhd

  • Resolution set to fixed
  • Status changed from reviewing to closed

Build works again :)

Note: See TracTickets for help on using tickets.