D22197: Add working directory to clang parser.

Aaron Puchert noreply at phabricator.kde.org
Thu Jul 4 00:18:15 BST 2019


aaronpuchert added inline comments.

INLINE COMMENTS

> bungeman wrote in parsesession.cpp:287-288
> No, it is the working directory for the builder for the given project item. Technically, this is not necessarily the directory from which the builder will actually invoke the compiler (the build system could do some lookup, change directories, and run the compiler from there; e.g. recursive make setups could do something like that in theory). To get a better directory, it may be possible to add another method to the IBuildSystemManager like parserDirectory(ProjectBaseItem*) to allow the build system manager to give even more accurate information (to distinguish between the directory the builder is invoked and the directory in which the parser / compiler is invoked).
> 
> That being said, the current cwd of the parser is the cwd of the kdevelop process (which is essentially random, so fixing this shouldn't break anything, unless someone is relying on the directory from which they launch kdevelop having an effect on how the parser resolves relative paths). Also, even the custommake plugin seems to try to make this sort of thing work as well as it can. However this does immediately fix an issue I am having, points out the need for this sort of information, and adds the framework for providing it.
> 
> That being said, maybe that means this should be called the parseDirectory instead of build(er)Directory.

Makes sense. This might not be perfect, but I agree it could improve some situations. We can do something more sophisticated should the need arise. I have also had cases where I needed to add include directories manually, perhaps because they were relative.

> That being said, maybe that means this should be called the parseDirectory instead of build(er)Directory.

I would go with `workingDirectory`. Since the class is called `ClangParsingEnvironment`, the `parse` should be implied.

REPOSITORY
  R32 KDevelop

REVISION DETAIL
  https://phabricator.kde.org/D22197

To: bungeman, #kdevelop
Cc: aaronpuchert, kdevelop-devel, hmitonneau, christiant, glebaccon, domson, antismap, iodelay, alexeymin, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20190703/e4f4d1bb/attachment.html>


More information about the KDevelop-devel mailing list