Skip to content

Commit c24099c

Browse files
committed
[sourcekit] Add the version to the XPC service identifier so that it can be distinct amongst multiple toolchains.
rdar://24292112
1 parent e70d772 commit c24099c

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

tools/SourceKit/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ macro(add_sourcekit_xpc_service name framework_target)
388388
endif()
389389

390390
set(XPCSERVICE_NAME ${name})
391-
set(XPCSERVICE_IDENTIFIER "com.apple.${name}")
391+
set(XPCSERVICE_IDENTIFIER "${name}.${SOURCEKIT_VERSION_STRING}")
392392
set(XPCSERVICE_BUNDLE_VERSION "${SOURCEKIT_VERSION_STRING}")
393393
set(XPCSERVICE_SHORT_VERSION_STRING "1.0")
394394
configure_file(

tools/SourceKit/tools/sourcekitd/bin/XPC/Client/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ add_sourcekit_framework(sourcekitd
1616
INSTALL_IN_COMPONENT sourcekit-xpc-service
1717
)
1818

19+
add_definitions(-DSOURCEKIT_XPCSERVICE_IDENTIFIER="SourceKitService.${SOURCEKIT_VERSION_STRING}")
20+
1921
if (SOURCEKIT_BUILT_STANDALONE)
2022
# Create the symlink necessary to find the swift stdlib.
2123
add_custom_command(TARGET sourcekitd POST_BUILD

tools/SourceKit/tools/sourcekitd/bin/XPC/Client/sourcekitd.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ void sourcekitd::initialize() {
251251
initializeTracing();
252252

253253
assert(!GlobalConn);
254-
GlobalConn = xpc_connection_create("com.apple.SourceKitService", NULL);
254+
GlobalConn = xpc_connection_create(SOURCEKIT_XPCSERVICE_IDENTIFIER, NULL);
255255

256256
xpc_connection_set_event_handler(GlobalConn, ^(xpc_object_t event) {
257257
xpc_type_t type = xpc_get_type(event);

0 commit comments

Comments
 (0)