KDevelop can't load project: "too large document"?

Matthew Woehlke mwoehlke.floss at gmail.com
Wed Dec 6 17:26:26 GMT 2017

On 2017-12-05 17:38, René J.V. Bertin wrote:
> Maybe you can simply do
>         connect(job, &CMakeServerImportJob::result, this, [this, job](){
>             if (job->error() == 0) {
>                 manager->integrateData(job->projectData(), job->project());
>             } else {
>                 failedConnection(job->error());
>             }
>         });

No luck. It appears that failing to parse the JSON is an unrecoverable
error. That is, I see no code to cope with that occurrence, and indeed,
it would normally trip an assert (I'm building RelWithDebInfo, so I
assume and expect asserts are not enabled). The correct fix seems to be
to modify the response handler to handle failing to parse the response.
See attached patch.

The above doesn't *seem* to be necessary with this patch, but I might be
wrong about that.

>> Indeed. At the very least, it shouldn't just quit trying to import the
>> project, leaving KDevelop in a weird state :-).
> From the looks of it the cmake importer doesn't do anything in terms of error handling.

Handling an error from the *server* appears to be handled. The patch
hijacks this by synthesizing a response that looks like a server error,
and passing that back up the stack instead of the "real" response which
could not be parsed.

At any rate, see also
https://gitlab.kitware.com/cmake/cmake/issues/17502, especially Brad
King's most recent comment. The plan is to revert cmake!992 for CMake
3.10.1. I still think KDevelop should handle this more gracefully,
though; failing to load the project *and* getting stuck in a state that
the load can't even be canceled is... less than optimal :-).

-------------- next part --------------
A non-text attachment was scrubbed...
Name: kdev-cmake-server.patch
Type: text/x-patch
Size: 710 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kdevelop/attachments/20171206/6cfb4b27/attachment.bin>

More information about the KDevelop mailing list