GNU bug report logs - #41872
emacs-irony-mode fails to build on LLVM 10

Previous Next

Package: guix;

Reported by: Jakub Kądziołka <kuba <at> kadziolka.net>

Date: Mon, 15 Jun 2020 15:42:01 UTC

Severity: normal

To reply to this bug, email your comments to 41872 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#41872; Package guix. (Mon, 15 Jun 2020 15:42:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jakub Kądziołka <kuba <at> kadziolka.net>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Mon, 15 Jun 2020 15:42:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jakub Kądziołka <kuba <at> kadziolka.net>
To: bug-guix <at> gnu.org
Cc: ludo <at> gnu.org
Subject: emacs-irony-mode fails to build on LLVM 10
Date: Mon, 15 Jun 2020 17:41:11 +0200
[Message part 1 (text/plain, inline)]
I was trying to update the default LLVM.

========================================================================
diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index 11e4cfbe4c..b0e80507f4 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -527,10 +527,10 @@ output), and Binutils.")
   (make-clang-toolchain clang-9))

 ;; Default LLVM and Clang version.
-(define-public llvm llvm-9)
-(define-public clang-runtime clang-runtime-9)
-(define-public clang clang-9)
-(define-public clang-toolchain clang-toolchain-9)
+(define-public llvm llvm-10)
+(define-public clang-runtime clang-runtime-10)
+(define-public clang clang-10)
+(define-public clang-toolchain clang-toolchain-10)

 (define-public llvm-8
   (package
========================================================================

With the help of `guix refresh', I have identified all packages that
depended on LLVM 9 and will now potentially be using LLVM 10. Among
those is emacs-irony-mode-server, which fails to build with the
following error:

========================================================================
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:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "/gnu/store/4ml806jam2af7f8i8sg8xi7b4mw81x9g-clang-10.0.0/lib/cmake/clang/ClangTargets.cmake"

  but not all the files it references.

Call Stack (most recent call first):
  /gnu/store/4ml806jam2af7f8i8sg8xi7b4mw81x9g-clang-10.0.0/lib/cmake/clang/ClangConfig.cmake:18 (include)
  src/CMakeLists.txt:4 (find_package)


-- Configuring incomplete, errors occurred!
See also "/tmp/guix-build-emacs-irony-mode-server-1.4.0.drv-0/source/CMakeFiles/CMakeOutput.log".
command "cmake" "server" "-DCMAKE_INSTALL_PREFIX=/gnu/store/5clyjcgw8g9jhryhk8bhljg950ijmwm4-emacs-irony-mode-server-1.4.0" failed with status 1
builder for `/gnu/store/qiiqbbzpigs7lnywplbwjdsh4qc2ic94-emacs-irony-mode-server-1.4.0.drv' failed with exit code 1
========================================================================

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"))
========================================================================

The code was introduced in this commit:

commit 77a87ad4aceed9d89d615540e0fd147e3a8b2f64
Author: Ludovic Courtès <ludo <at> gnu.org>
Date:   Thu May 28 11:46:59 2020 +0200

    gnu: clang: Build 'clang-tools-extra'.

    * gnu/packages/llvm.scm (clang-from-llvm): Add #:tools-extra.
    Add 'output' field.  In 'inputs', add TOOLS-EXTRA when it's given.
    In 'arguments', add 'add-tools-extra' and 'move-extra-tools' phases when
    TOOLS-EXTRA is given.

I don't know cmake nearly well enough to fix this.

Regards,
Jakub Kądziołka
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#41872; Package guix. (Tue, 16 Jun 2020 10:14:02 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Jakub Kądziołka <kuba <at> kadziolka.net>
Cc: bug-guix <at> gnu.org
Subject: Re: emacs-irony-mode fails to build on LLVM 10
Date: Tue, 16 Jun 2020 12:13:52 +0200
Hi,

Jakub Kądziołka <kuba <at> kadziolka.net> 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 <at> 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’.




Information forwarded to bug-guix <at> gnu.org:
bug#41872; Package guix. (Sat, 20 Jun 2020 01:28:01 GMT) Full text and rfc822 format available.

Message #11 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jakub Kądziołka <kuba <at> kadziolka.net>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: bug-guix <at> gnu.org
Subject: Re: emacs-irony-mode fails to build on LLVM 10
Date: Sat, 20 Jun 2020 03:27:43 +0200
[Message part 1 (text/plain, inline)]
On Tue, Jun 16, 2020 at 12:13:52PM +0200, Ludovic Courtès wrote:
> Hi,
> 
> Alternatively, we can try building clang <at> 10 with the flags Pierre
> mentioned recently on this list so that we’re only building shared
> libraries; that should take up less space.

I'm currently building clang <at> 10 with -DCLANG_LINK_CLANG_DYLIB=ON, but
unfortunately this flag requires -DLLVM_LINK_LLVM_DYLIB=ON, and it
doesn't work if LLVM wasn't build with that same flag.

Unfortunately, LLVM is a reverse-dep to the entire mesa mess, so this
approach would require a trip through staging (unless we create a
separate llvm-for-mesa package - would that be reasonable?).

Thoughts?

Regards,
Jakub Kądziołka
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#41872; Package guix. (Sat, 20 Jun 2020 14:08:01 GMT) Full text and rfc822 format available.

Message #14 received at 41872 <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <marius <at> gnu.org>
To: Jakub Kądziołka <kuba <at> kadziolka.net>, Ludovic
 Courtès <ludo <at> gnu.org>
Cc: 41872 <at> debbugs.gnu.org
Subject: Re: bug#41872: emacs-irony-mode fails to build on LLVM 10
Date: Sat, 20 Jun 2020 16:07:02 +0200
[Message part 1 (text/plain, inline)]
Jakub Kądziołka <kuba <at> kadziolka.net> writes:

> Unfortunately, LLVM is a reverse-dep to the entire mesa mess, so this
> approach would require a trip through staging (unless we create a
> separate llvm-for-mesa package - would that be reasonable?).

Sounds good to me.

On a mostly unrelated note, I wonder if we should make 'llvm-for-mesa' a
permanent thing in the long term, and build only the subset of LLVM that
Mesa uses.
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 3 years and 309 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.