New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SR-1639] [SourceKit] Add in-process implementations of sourcekitd functions only defined for XPC #5268
Comments
Do these functions implementations not exist for InProc? Or am I missing something? @akyrtzi, @gribozavr, do you happen to know? |
Sent up apple/swift#2766 for the |
Sent up apple/swift#2769 for the |
The Based on the discussion in apple/swift#2704 however, I have a feeling it might not be that simple to build libdispatch first, then link it to SourceKit, all in a single build script invocation. Advice here would be appreciated! |
I searched the mailing lists, but information on building libdispatch is scarce. I sent an email to the mailing lists for advice. Depending on the state of that project, we may want to avoid depending on a Linux libdispatch build. I took a look at what SourceKit relies on libdispatch for:
For each of these, I think we might be able to use asynchronous features from C++ instead (disclaimer: I've only ever written 30 lines of C++). |
Sent up apple/swift#2769 to remove usages of libdispatch from |
Hey Cristian (JIRA User), are you actively working on this? I started taking a stab at some of this before realizing you had assigned this issue to yourself. |
I'm pretty sure @briancroom finished this work in apple/swift#3026 Thanks! |
Attachment: Download
Additional Detail from JIRA
md5: e2fa900ee64d58b2f3449789c3d4d373
Parent-Task:
blocks:
Issue Description:
Several SourceKit functions are declared in
tools/SourceKit/tools/sourcekitd/include/sourcekitd/sourcekitd.h
ortools/SourceKit/tools/sourcekitd/include/sourcekitd/Internal.h
, but only implemented intools/SourceKit/tools/sourcekitd/lib/API/sourcekitdAPI-XPC.cpp
. These need implementations that are only included in builds of SourceKit that use an in-process communication model (in other words, not XPC).Examples of missing implementations include
sourcekitd_request_array_create
andcreateErrorRequestInvalid
. There are many more.I noticed these missing implementations when attempting to build SourceKit for Linux (full output available here and as a attachment on this task).
To build SourceKit on Linux yourself, apply apple/swift#2763 and apple/swift#2704 to a branch based off the master branch of apple/swift, then run
utils/build-script -R
.Taking the unique symbols from the build output above, I think the following will need "in-process" definitions:
Declared in
SourceKit/include/SourceKit/Support/Concurrency.h
, implemented for OS X inSourceKit/lib/Support/Concurrency-Mac.cpp
:SourceKit::WorkQueue::Impl::create(SourceKit::WorkQueue::Dequeuing, SourceKit::WorkQueue::Priority, llvm::StringRef)
SourceKit::WorkQueue::Impl::dispatch(void*, SourceKit::WorkQueue::DispatchData const&)
SourceKit::WorkQueue::Impl::dispatchBarrierSync(void*, SourceKit::WorkQueue::DispatchData const&)
SourceKit::WorkQueue::Impl::dispatchConcurrent(SourceKit::WorkQueue::Priority, SourceKit::WorkQueue::DispatchData const&)
SourceKit::WorkQueue::Impl::dispatchOnMain(SourceKit::WorkQueue::DispatchData const&)
SourceKit::WorkQueue::Impl::dispatchSync(void*, SourceKit::WorkQueue::DispatchData const&)
SourceKit::WorkQueue::Impl::release(void*)
I think these need implementations for Linux.
Declared in
tools/SourceKit/tools/sourcekitd/include/sourcekitd/sourcekitd.h
, implemented for OS X intools/SourceKit/tools/sourcekitd/lib/API/sourcekitdAPI-XPC.cpp
:sourcekitd_request_array_create
sourcekitd_request_array_set_value
sourcekitd_request_dictionary_create
sourcekitd_request_dictionary_set_value
sourcekitd_request_int64_create
sourcekitd_request_release
sourcekitd_request_retain
sourcekitd_request_string_create
sourcekitd_request_uid_create
sourcekitd_response_dispose
sourcekitd_response_error_get_description
sourcekitd_response_error_get_kind
sourcekitd_response_get_value
sourcekitd_response_is_error
sourcekitd_uid_get_from_buf
sourcekitd_uid_get_length
sourcekitd_uid_get_string_ptr
I think these need implementations for Linux.
Declared in
tools/SourceKit/tools/sourcekitd/include/sourcekitd/Internal.h
, implemented for OS X intools/SourceKit/tools/sourcekitd/lib/API/sourcekitdAPI-XPC.cpp
:sourcekitd::RequestDict::dictionaryArrayApply(SourceKit::UIdent, llvm::function_ref<bool (sourcekitd::RequestDict)>)
sourcekitd::RequestDict::getDictionary(SourceKit::UIdent)
sourcekitd::RequestDict::getInt64(SourceKit::UIdent, long&, bool)
sourcekitd::RequestDict::getString(SourceKit::UIdent)
sourcekitd::RequestDict::getStringArray(SourceKit::UIdent, llvm::SmallVectorImpl<char const*>&, bool)
sourcekitd::RequestDict::getUID(SourceKit::UIdent)
sourcekitd::RequestDict::getUIDArray(SourceKit::UIdent, llvm::SmallVectorImpl<sourcekitd_uid_s*>&, bool)
sourcekitd::ResponseBuilder::Array::appendDictionary()
sourcekitd::ResponseBuilder::Dictionary::set(SourceKit::UIdent, SourceKit::UIdent)
sourcekitd::ResponseBuilder::Dictionary::set(SourceKit::UIdent, char const*)
sourcekitd::ResponseBuilder::Dictionary::set(SourceKit::UIdent, llvm::ArrayRef<llvm::StringRef>)
sourcekitd::ResponseBuilder::Dictionary::set(SourceKit::UIdent, llvm::StringRef)
sourcekitd::ResponseBuilder::Dictionary::set(SourceKit::UIdent, long)
sourcekitd::ResponseBuilder::Dictionary::set(SourceKit::UIdent, sourcekitd_uid_s*)
sourcekitd::ResponseBuilder::Dictionary::setArray(SourceKit::UIdent)
sourcekitd::ResponseBuilder::Dictionary::setBool(SourceKit::UIdent, bool)
sourcekitd::ResponseBuilder::Dictionary::setCustomBuffer(SourceKit::UIdent, sourcekitd::CustomBufferKind, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer> >)
sourcekitd::ResponseBuilder::Dictionary::setDictionary(SourceKit::UIdent)
sourcekitd::ResponseBuilder::ResponseBuilder()
sourcekitd::ResponseBuilder::createResponse()
sourcekitd::ResponseBuilder::getDictionary()
sourcekitd::ResponseBuilder::~ResponseBuilder()
sourcekitd::createErrorRequestCancelled()
sourcekitd::createErrorRequestFailed(char const*)
sourcekitd::createErrorRequestInvalid(char const*)
sourcekitd::printRequestObject(void*, llvm::raw_ostream&)
I think these need implementations for Linux.
Declared in
tools/SourceKit/include/SourceKit/Core/LangSupport.h
, implemented for all platforms intools/SourceKit/lib/SwiftLang/SwiftLangSupport.cpp
:SourceKit::LangSupport::SynthesizedUSRSeparator
SourceKit::LangSupport::createSwiftLangSupport(SourceKit::Context&)
I think
sourcekitdInProc
needs to be linked againstSourceKitSwiftLang
to resolve these symbols.The text was updated successfully, but these errors were encountered: