Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Code Signing Resource Rules Path fails on Jenkins, CODE_SIGN_RESOURCE_RULES_PATH

I am little concerned about how people treat the following issue.

Basically it sounds like "Build fails on Jenkins with the ResourceRules.plist: cannot read resources"

My circumstances are:

1) Jenkins

2) Locally I work in Xcode 7 beta (on a separate branch)

3) My teammates work in 6.4.1 and for them everything works fine

4) Jenkins slave has Xcode 6.4.1 installed

Some of you will say "this question was asked millions of times", like here, here, here, here.

But the documentation says the following:

Resource Rules

Systems before OS X Mavericks v10.9 documented a signing feature (--resource-rules) to control which files in a bundle should be sealed by a code signature. This feature has been obsoleted for Mavericks. Code signatures made in Mavericks and later always seal all files in a bundle; there is no need to specify this explicitly any more. This also means that the Code Signing Resource Rules Path build setting in Xcode should no longer be used and should be left blank.

So my question is why everybody is so quick on hand to bypass, hack, workaround this issue, when the documentation clearly says that is should be blank and it's obsolete?

What is the real problem behind this? Why the build fails on something that is not required for several years?

like image 850
Dumoko Avatar asked Sep 03 '15 08:09

Dumoko


2 Answers

I had the same problem. The solution suggested by Mr.Dan Cutting here works for me.

Just to save some time, here is what we need from the web link.

"As of Mavericks, the resource-rules option should not be included when signing apps, but for some reason the script still passes this option along to the code signing tool.

The workaround is to alter the PackageApplication script so it no longer does this (which will require sudo access). Line 155 of the script constructs the parameters to pass through to the code signer, so we can simply remove the references to resource-rules:"

//Remove - Begin
    - my @codesign_args = ("/usr/bin/codesign", "--force", "--preserve-metadata=identifier,entitlements,resource-rules",
    -   "--sign", $opt{sign},
    -   "--resource-rules=$destApp/ResourceRules.plist");
//Remove - End

//Add - Begin
    + my @codesign_args = ("/usr/bin/codesign", "--force", "--preserve-metadata=identifier,entitlements",
    +   "--sign", $opt{sign});
//Add - Starts
like image 188
Subbu Avatar answered Oct 14 '22 14:10

Subbu


If you have used Xcode version greater 6.1 then change the below line

$(SDKROOT)/ResourceRules.plist

TO CODE_SIGN_RESOURCE_RULES_PATH=$(SDKROOT)/ResourceRules.plist

like image 37
Kiran K Avatar answered Oct 14 '22 13:10

Kiran K