emacs-irony-mode fails to build on LLVM 10

OpenSubmitted by Jakub Kądziołka.
Details
3 participants
  • Jakub Kądziołka
  • Ludovic Courtès
  • Marius Bakke
Owner
unassigned
Severity
normal
J
J
Jakub Kądziołka wrote on 15 Jun 2020 17:41
(address . bug-guix@gnu.org)(address . ludo@gnu.org)
20200615154111.m5ls5s3znv7rqpxk@gravity
I was trying to update the default LLVM.
========================================================================
Toggle diff (92 lines)diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scmindex 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 thatdepended on LLVM 9 and will now potentially be using LLVM 10. Amongthose is emacs-irony-mode-server, which fails to build with thefollowing 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 1builder 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 alist 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 77a87ad4aceed9d89d615540e0fd147e3a8b2f64Author: Ludovic Courtès <ludo@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
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEE5Xa/ss9usT31cTO54xWnWEYTFWQFAl7nlpcACgkQ4xWnWEYTFWTQqxAAsRRVmhjb6oniGcRIoeeyZ+Z8xLOYdoHPp0loz92SJ8/B6+5hEPnYVo3YCXlHAuflk1zjyJ2OBb7TbOdhssCE5Vxw8h0ZA3oPlnCy4JqrG6xJ0QGcOs9ISvHJgNwT7hEUUyERep2b3JCZ94TCnLfSHOMiAWvqdLXMRBEoTaqthOZppR7OKgMPuh/WP9YfylY3/nqIH8VhKnPPvS4rT0UvWzyY8oaL8HvoQQAy9CPto5gP8aOJKrszoTQmliT8Hxd+HgsPZBoCXQmOgHeQfVyU9HbThScqN14ry0C4v54GHj104vXONf8CkPATHhvsLtXK1ACHRb3AK/nA6Y8wrMaweiE6Htx5DSdixLLRw2cAEbO336JAFRpieLajccrEsOmqEzAn030qIxelv1s06xXNbPFlDlI+sEgamfaNsfeFBMOj55F9Uozk7fm3UJKDMtESyrNQXcMatoxMAU0N73dEDaxHjuoe0Ya+qr4nBV3RGhR9YzTHHkIm826dGlurDxUe953HzBfqucatBXAalJU3vjKeEGQZHN4nLWBiS6QdqAIfdGeJls6Z59spgW95iF2GuLR7lMn4FnB9UaDRgyhR1Fy2GtwRhwJ+KM0xsh7Coc5cWnTMek10916OPcLkIGxa8hjZ0j6dPiTOyodjTeAKTO3+2U46WNd+l5viYtg+c+I==6pDM-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 16 Jun 2020 12:13
(name . Jakub Kądziołka)(address . kuba@kadziolka.net)(address . bug-guix@gnu.org)
87sgevtj1b.fsf@gnu.org
Hi,
Jakub Kądziołka <kuba@kadziolka.net> skribis:
Toggle quote (20 lines)> 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. Icame up with the list above by comparing the lib/ directory of clangwithout clang-tools-extra and clang with clang-tools-extra. I waspretty sure these libraries were only used by the clang-tools-extrabinaries.
Toggle quote (7 lines)> 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:
Toggle snippet (4 lines)list(APPEND _IMPORT_CHECK_TARGETS clangApplyReplacements )list(APPEND _IMPORT_CHECK_FILES_FOR_clangApplyReplacements "${_IMPORT_PREFIX}/lib/libclangApplyReplacements.a" )
?
Alternatively, we can try building clang@10 with the flags Pierrementioned recently on this list so that we’re only building sharedlibraries; that should take up less space.
HTH,Ludo’.
J
J
Jakub Kądziołka wrote on 20 Jun 2020 03:27
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . bug-guix@gnu.org)
20200620012743.kg3kqnxyc4eyrzdf@gravity
On Tue, Jun 16, 2020 at 12:13:52PM +0200, Ludovic Courtès wrote:
Toggle quote (6 lines)> Hi,> > 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.
I'm currently building clang@10 with -DCLANG_LINK_CLANG_DYLIB=ON, butunfortunately this flag requires -DLLVM_LINK_LLVM_DYLIB=ON, and itdoesn't work if LLVM wasn't build with that same flag.
Unfortunately, LLVM is a reverse-dep to the entire mesa mess, so thisapproach would require a trip through staging (unless we create aseparate llvm-for-mesa package - would that be reasonable?).
Thoughts?
Regards,Jakub Kądziołka
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEE5Xa/ss9usT31cTO54xWnWEYTFWQFAl7tZg8ACgkQ4xWnWEYTFWTkYQ//W04iZ6XgqS8HlKNXHeM6OZMILuR3kB8waFPh7ryYp4mXyRfHgPanV6OyYfgAoS0wr83DWJJ10n2AKTieRZ6ZfxcBDr8rHLph3f7+pW+Yrv+JW75XDx3bceiWC9MCTVfrU5BsqKvt7hnDAa3WzYCuqr7Zlcd8V+43nL1PxYYUDxK1Cmi/WlhzFRRBqoIqtvjpuFKijAYzC1FjVrg0De1NGpuqHAc48MWkpvEXw/VciDbMe8B+BnhYQEDvMOw1bMZbKWjW19JR28jKIJpTbmhjyzZMp6jtxxIby3+9fDrAlo016izB4yXog4heKmUuAOoHSIYernRxsDMdo72zvrbDN2YKu323nJtEDK7MGmuRmRVWJrec0tYoEDn1Zc0S+rXfno62MbPSEywUvzKRxjs2DBW2wa29L+15eL4wmK7Uav4soZmpXQ0/5dS5zlA6VX3MXYbTc6EbEh5dhh5bqf9HKUiw/ln+TNz8HFOyjtDqGNLZLTJJiwKtomEgb9TFj5Q/6ixYTk/25yDP5kF+qKf6z/AmK+qm5beTWn7Y9CELDvRr1/HvRudyTgf6+pC6FRhbMyePu0YXCaJqL4VgG7Fi5xQ3bQuFi2sqwtc230P0/5qy1ge5AQi3OMJ5dkJtrQDCFwnVIEpB2MTNMtgcH8FXhxFCVwXDx5OQt/v4TuGDfys==/W05-----END PGP SIGNATURE-----

M
M
Marius Bakke wrote on 20 Jun 2020 16:07
Re: bug#41872: emacs-irony-mode fails to build on LLVM 10
(address . 41872@debbugs.gnu.org)
87sgepde61.fsf@gnu.org
Jakub Kądziołka <kuba@kadziolka.net> writes:
Toggle quote (4 lines)> 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' apermanent thing in the long term, and build only the subset of LLVM thatMesa uses.
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl7uGAYACgkQoqBt8qM6VPq0NQf+IBCfsyKQjqmeY5DSRb7miH37VsBgbetLcHxvBiztaLuRLiJL+2jOoNe9zi2tWPhDk3oQgt/QHAEgejJauNE4+iYEZ5QB8mV3XWAeTfnWwys8XggdjSdNA5yC7J94HmI1PxiB0jQikdLR9qMMVMhez2um8GLKn338JWUhmNqSfSreKNXRyx3Z+7DLAz5q6YWKuzvMYTfm65hmrr3xoPTIxt6KKYeyoie8++zDZf4JP8ofETMKiS6HNRaVYCHUuBWJXeKIcf+rvxGsWvZ4ElszbXaSq+sgsC74lSPN9/9eTNCRs5783rB/xYYIcAaWO1ndXPfbt5ESW8rfeZAy8UnwhA===eJDX-----END PGP SIGNATURE-----
?