Closed Quuxplusone closed 5 years ago
Bugzilla Link | PR41569 |
Status | RESOLVED FIXED |
Importance | P enhancement |
Reported by | Nico Weber (nicolasweber@gmx.de) |
Reported on | 2019-04-23 08:02:16 -0700 |
Last modified on | 2019-05-07 00:09:31 -0700 |
Version | unspecified |
Hardware | PC All |
CC | geek4civic@gmail.com, gribozavr@gmail.com, hans@chromium.org, kadircetinkaya.06.tr@gmail.com, llvm-bugs@lists.llvm.org, sammccall@google.com |
Fixed by commit(s) | rL360115 |
Attachments | |
Blocks | |
Blocked by | |
See also |
TL;DR: I think we should skip building clangd if threads are off, I'll send a
patch.
Clangd won't work properly without threads as currently designed.
And (as a product) there isn't really any value in doing so, developers don't
use it on platforms that don't have threads available.
Am I missing something about why this configuration is important?
We do have a "run-synchronously" flag that stops threads spawning in most
situations, but it's limited: basically designed to make output deterministic
enough for lit tests. Not all features work properly in this mode, and some
threads are still spawned where effects aren't observable.
And it's not actually usable: operations that should be fast (code completion)
will get scheduled behind those that are very slow (rebuilding precompiled
preambles).
We have lots of unit tests that test threading behavior (e.g. that operations
actually are asynchronous). We could #ifdef them all. It doesn't seem worth
maintaining for a configuration we don't support.
> Check for LLVM_ENABLE_THREADS=OFF in the cmake build and omti clangd (and all
its tests) from the build completely in that case
I'll try to remember how CMake works, and send a patch :-)
It was suggested to me it would be better to disable building all of clang-
tools-extra in this configuration.
Advantages:
- simpler to describe and implement: a single CMake root governs clang-tools-extra
- less configuration space for these tools to support
Do you/we know of anyone who actually needs to build in such a configuration?
Chromium builds some things (e.g. clang) with threads off. It's a supported build configuration of LLVM. Some (most) of the tools in clang-tools-extra work fine with threads off.
Right.
There are apparently no buildbots that build CTE without threads, so I'm not
sure how supported it is for that subtree.
CTE is unfortunately set up in a pretty monolithic way where it's awkward to
enable/disable particular tools.
But this was a good excuse to split out the clangd build rules (r359424).
So:
- I'll add a flag to disable building clangd
- the rest of clang-tools-extra can stay in its ambiguously-supported state
Sounds great. Thanks much!