Skip to content

Commit

Permalink
[Xcode] Dead webkitdirs.pm code assumes all signing identities start …
Browse files Browse the repository at this point in the history
…with "iPhone Developer"

https://bugs.webkit.org/show_bug.cgi?id=263938
rdar://96538743

Reviewed by Alexey Proskuryakov.

They have been called "Apple Developer" for years now, so the code path
that disables code signing is always taken. Since it's not possible to
run open-source builds of WebKit on embedded devices, this has never
been noticed, and it can be cleaned up.

Move the code signing overrides into xcconfig variables that are only
active in open source builds. This has the nice side effect of making it
possible to build for embedded devices in Xcode, without using
build-webkit. Continue to use ad-hoc signing internally, where it is
allowed.

Works towards making webkitdirs aware of the active SDK in internal
builds (rdar://86340301).

* Source/JavaScriptCore/Configurations/DebugRelease.xcconfig:
* Source/ThirdParty/libwebrtc/Configurations/DebugRelease.xcconfig:
* Source/WebKit/Configurations/DebugRelease.xcconfig:
* Tools/DumpRenderTree/mac/Configurations/DebugRelease.xcconfig:
* Tools/MobileMiniBrowser/Configurations/DebugRelease.xcconfig:
* Tools/Scripts/webkitdirs.pm:
(XcodeOptions):
(hasIOSDevelopmentCertificate): Deleted.
* Tools/TestWebKitAPI/Configurations/DebugRelease.xcconfig:
* Tools/WebKitTestRunner/Configurations/DebugRelease.xcconfig:

Canonical link: https://commits.webkit.org/270170@main
  • Loading branch information
emw-apple committed Nov 3, 2023
1 parent c195704 commit 7c98ddb
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 19 deletions.
3 changes: 3 additions & 0 deletions Source/JavaScriptCore/Configurations/DebugRelease.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ CODE_SIGN_IDENTITY_ = $(CODE_SIGN_IDENTITY_NO);
CODE_SIGN_IDENTITY_NO = -;
CODE_SIGN_IDENTITY_YES = $(WK_ENGINEERING_CODE_SIGN_IDENTITY);

CODE_SIGN_IDENTITY[sdk=embedded] = $(CODE_SIGN_IDENTITY_EMBEDDED_$(USE_INTERNAL_SDK));
CODE_SIGN_IDENTITY_EMBEDDED_YES = -;

SDKROOT = $(SDKROOT_$(USE_INTERNAL_SDK));
SDKROOT_ = macosx;
SDKROOT_YES = macosx.internal;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@
#include "Base.xcconfig"
#include? "../../../../LocalOverrides.xcconfig"

VALID_ARCHS[sdk=watch*] = $(ARCHS_STANDARD_32_64_BIT);

CODE_SIGN_IDENTITY[sdk=embedded] = $(CODE_SIGN_IDENTITY_EMBEDDED_$(USE_INTERNAL_SDK));
CODE_SIGN_IDENTITY_EMBEDDED_YES = -;

VALID_ARCHS[sdk=watch*] = $(ARCHS_STANDARD_32_64_BIT);
ONLY_ACTIVE_ARCH = YES;

GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES;
Expand Down
11 changes: 7 additions & 4 deletions Source/WebKit/Configurations/DebugRelease.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,13 @@ SDKROOT = $(SDKROOT_$(USE_INTERNAL_SDK));
SDKROOT_ = macosx;
SDKROOT_YES = macosx.internal;

CODE_SIGN_IDENTITY[sdk=macosx*] = $(CODE_SIGN_IDENTITY_$(WK_USE_RESTRICTED_ENTITLEMENTS))
CODE_SIGN_IDENTITY_ = $(CODE_SIGN_IDENTITY_NO);
CODE_SIGN_IDENTITY_NO = -;
CODE_SIGN_IDENTITY_YES = $(WK_ENGINEERING_CODE_SIGN_IDENTITY);
CODE_SIGN_IDENTITY[sdk=macosx*] = $(CODE_SIGN_IDENTITY_RESTRICTED_$(WK_USE_RESTRICTED_ENTITLEMENTS))
CODE_SIGN_IDENTITY_RESTRICTED_ = $(CODE_SIGN_IDENTITY_RESTRICTED_NO);
CODE_SIGN_IDENTITY_RESTRICTED_NO = -;
CODE_SIGN_IDENTITY_RESTRICTED_YES = $(WK_ENGINEERING_CODE_SIGN_IDENTITY);

CODE_SIGN_IDENTITY[sdk=embedded] = $(CODE_SIGN_IDENTITY_EMBEDDED_$(USE_INTERNAL_SDK));
CODE_SIGN_IDENTITY_EMBEDDED_YES = -;

VALIDATE_DEPENDENCIES = $(VALIDATE_DEPENDENCIES_INTERNAL_$(USE_INTERNAL_SDK));
VALIDATE_DEPENDENCIES_INTERNAL_ = $(VALIDATE_DEPENDENCIES_NATIVE_TARGET_$(WK_NOT_$(WK_EMPTY_$(PRODUCT_TYPE))));
Expand Down
3 changes: 3 additions & 0 deletions Tools/DumpRenderTree/mac/Configurations/DebugRelease.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ CODE_SIGN_IDENTITY_ = $(CODE_SIGN_IDENTITY_NO);
CODE_SIGN_IDENTITY_NO = -;
CODE_SIGN_IDENTITY_YES = $(WK_ENGINEERING_CODE_SIGN_IDENTITY);

CODE_SIGN_IDENTITY[sdk=embedded] = $(CODE_SIGN_IDENTITY_EMBEDDED_$(USE_INTERNAL_SDK));
CODE_SIGN_IDENTITY_EMBEDDED_YES = -;

SDKROOT = $(SDKROOT_$(USE_INTERNAL_SDK));
SDKROOT_ = macosx;
SDKROOT_YES = macosx.internal;
Expand Down
3 changes: 3 additions & 0 deletions Tools/MobileMiniBrowser/Configurations/DebugRelease.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
#include "Base.xcconfig"
#include? "../../../LocalOverrides.xcconfig"

CODE_SIGN_IDENTITY[sdk=embedded] = $(CODE_SIGN_IDENTITY_EMBEDDED_$(USE_INTERNAL_SDK));
CODE_SIGN_IDENTITY_EMBEDDED_YES = -;

ONLY_ACTIVE_ARCH = YES;

GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES;
Expand Down
14 changes: 0 additions & 14 deletions Tools/Scripts/webkitdirs.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1189,11 +1189,6 @@ sub determineGenerateDsym()
$generateDsym = checkForArgumentAndRemoveFromARGV("--dsym");
}

sub hasIOSDevelopmentCertificate()
{
return !exitStatus(system("security find-identity -p codesigning | grep '" . IOS_DEVELOPMENT_CERTIFICATE_NAME_PREFIX . "' > /dev/null 2>&1"));
}

sub argumentsForXcode()
{
my @args = ();
Expand Down Expand Up @@ -1280,15 +1275,6 @@ sub XcodeOptions
die "Cannot enable both ASAN and TSAN at the same time\n" if $asanIsEnabled && $tsanIsEnabled;
die "Cannot enable both (ASAN or TSAN) and Coverage at this time\n" if $coverageIsEnabled && ($asanIsEnabled || $tsanIsEnabled);

if (willUseIOSDeviceSDK() || willUseWatchDeviceSDK() || willUseAppleTVDeviceSDK()) {
if (hasIOSDevelopmentCertificate()) {
# FIXME: May match more than one installed development certificate.
push @options, "CODE_SIGN_IDENTITY=" . IOS_DEVELOPMENT_CERTIFICATE_NAME_PREFIX;
} else {
push @options, "CODE_SIGN_IDENTITY="; # No identity
push @options, "CODE_SIGNING_REQUIRED=NO";
}
}
push @options, argumentsForXcode();
return @options;
}
Expand Down
3 changes: 3 additions & 0 deletions Tools/TestWebKitAPI/Configurations/DebugRelease.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
#include "Base.xcconfig"
#include? "../../../LocalOverrides.xcconfig"

CODE_SIGN_IDENTITY[sdk=embedded] = $(CODE_SIGN_IDENTITY_EMBEDDED_$(USE_INTERNAL_SDK));
CODE_SIGN_IDENTITY_EMBEDDED_YES = -;

ONLY_ACTIVE_ARCH = YES;

SDKROOT = $(SDKROOT_$(USE_INTERNAL_SDK));
Expand Down
3 changes: 3 additions & 0 deletions Tools/WebKitTestRunner/Configurations/DebugRelease.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
#include "Base.xcconfig"
#include? "../../../LocalOverrides.xcconfig"

CODE_SIGN_IDENTITY[sdk=embedded] = $(CODE_SIGN_IDENTITY_EMBEDDED_$(USE_INTERNAL_SDK));
CODE_SIGN_IDENTITY_EMBEDDED_YES = -;

ONLY_ACTIVE_ARCH = YES;

SDKROOT = $(SDKROOT_$(USE_INTERNAL_SDK));
Expand Down

0 comments on commit 7c98ddb

Please sign in to comment.