Without this patch clangd crashes at try to load compressed string table when zlib is not available.
Example:
- Build clangd with MinGW (zlib found)
- Build index
- Build clangd with Visual Studio compiler (zlib not found)
- Try to load index
Differential D87673
[clangd] Don't use zlib when it's unavailable. ArcsinX on Sep 15 2020, 1:00 AM. Authored by
Details Without this patch clangd crashes at try to load compressed string table when zlib is not available.
Diff Detail
Event Timeline
Comment Actions Thanks, this seems better than crashing. Agree, testing this seems hard and not that useful. Comment Actions FWIW here's how to test codepaths only reachable when zlib is not available: ./llvm/test/tools/llvm-dwp/X86/nocompress.test: REQUIRES: !zlib Comment Actions Yep, that requires a checked-in binary file, which in the case of that test is in a standard stable format, which this data is not, so we'd also need tools to regenerate it. And we don't have APIs to generate the file without compression if zlib is available (because we never want to do that), so we'd need to add those or require anyone touching the file format to build a no-zlib tree to regenerate the file. Comment Actions Ah, fair enough. Might be nice to have a flag to request the uncompressed behavior even when compression's available - for testing purposes and such, but given the current implementation, yeah, don't see a tidy way to test it. |
nit: skip { } to stay consistent with local style