Subject: bug#41872: emacs-irony-mode fails to build on LLVM 10

From: Ludovic Courtès <[email-masked]>
Date: Tue, 16 Jun 2020 12:13:52 +0200

Hi,

Jakub Kądziołka <[email-masked]> skribis:

> The ClangTargets.cmake file for LLVM 10 gained ApplyReplacements in a
> list of libraries provided by clang, but Guix removes these libraries:
>
> ========================================================================
> ;; Remove MiBs of .a files coming from
> ;; 'clang-tools-extra'.
> (for-each (lambda (component)
>             (delete-file
>              (string-append lib "/libclang"
>                             component ".a")))
>           '("ApplyReplacements"
>             "ChangeNamespace"
>             "Daemon"
>             "DaemonTweaks"
>             "Doc"
>             "IncludeFixer"
>             "IncludeFixerPlugin"
>             "Move"))
> ========================================================================

I think these libraries come from clang-tools-extra, not plain clang.  I
came up with the list above by comparing the lib/ directory of clang
without clang-tools-extra and clang with clang-tools-extra.  I was
pretty sure these libraries were only used by the clang-tools-extra
binaries.

> CMake Error at /gnu/store/4ml806jam2af7f8i8sg8xi7b4mw81x9g-clang-10.0.0/lib/cmake/clang/ClangTargets.cmake:627 (message):
>   The imported target "clangApplyReplacements" references the file
> 
>      "/gnu/store/4ml806jam2af7f8i8sg8xi7b4mw81x9g-clang-10.0.0/lib/libclangApplyReplacements.a"
> 
>   but this file does not exist.  Possible reasons include:

Does it work to comment out in that file all the lines like:

--8<---------------cut here---------------start------------->8---
list(APPEND _IMPORT_CHECK_TARGETS clangApplyReplacements )
list(APPEND _IMPORT_CHECK_FILES_FOR_clangApplyReplacements "${_IMPORT_PREFIX}/lib/libclangApplyReplacements.a" )
--8<---------------cut here---------------end--------------->8---

?

Alternatively, we can try building clang@10 with the flags Pierre
mentioned recently on this list so that we’re only building shared
libraries; that should take up less space.

HTH,
Ludo’.