:Resend: Add LLVM, clang and clang-runtime-3.8 to GNU Guix

Message ID CAKKYfmHAyMHhREUpdtvtoxjE8re_33bwWPsP5jU2SZ0i4Mxv7g@mail.gmail.com
State New
Headers

Commit Message

Dennis Mungai May 26, 2016, 8:44 p.m. UTC
  See corrected patch, as attached.



On 26 May 2016 at 23:13, Roel Janssen <roel@gnu.org> wrote:
> Hello Dennis,
>
> Welcome and thank you for the patch.
>
> Dennis Mungai writes:
>
>> +(define-public llvm-3.8
>> +  (package (inherit llvm)
>> +    (version "3.8.0")
>> +    (source
>> +     (origin
>> +       (method url-fetch)
>> +       (uri (string-append "http://llvm.org/releases/"
>> +                           version "/llvm-" version ".src.tar.xz"))
>> +       (sha256
>> +        (base32
>> +         "0ikfq0gxac8xpvxj23l4hk8f12ydx48fljgrz1gl9xp0ks704nsm"))))
>> +    (native-inputs
>> +     `(("python" ,python-wrapper)
>> +       ("perl"   ,perl)
>> +       ("libffi" ,libffi)
>> +       ("zlib" ,zlib)))
>
> One space between the string and the unquote is enough.
>
>> +    (arguments
>> +     `(#:configure-flags '("-DCMAKE_SKIP_BUILD_RPATH=FALSE"
>> +                           "-DCMAKE_BUILD_WITH_INSTALL_RPATH=FALSE"
>> +                           "-DLLVM_ENABLE_PIC=ON"
>> +                           ;"-DLLVM_ENABLE_RTTI=ON"
>> +                           "-DLLVM_ENABLE_WERROR=OFF"
>> +                           ;;"-DLLVM_REQUIRES_RTTI=ON"
>
> Could you remove the options you commented out?
>
>> +                           )))))
>
> These should be positioned directly after "-DLLVM_ENABLE_WERROR=OFF".
>
>> +
>> +(define-public clang-runtime-3.8
>> +  (clang-runtime-from-llvm
>> +   llvm-3.8
>> +   "1c2nkp9563873ffz22qmhc0wakgj428pch8rmhym8agjamz3ily8"))
>> +
>> +(define-public clang-3.8
>> +  (clang-from-llvm llvm-3.8 clang-runtime-3.8
>> +                   "1ybcac8hlr9vl3wg8s4v6cp0c0qgqnwprsv85lihbkq3vqv94504"))
>> --
>> 2.7.4
>
> Thank you,
> Roel Janssen
  

Comments

Eric Bavier May 27, 2016, 2:09 p.m. UTC | #1
On 2016-05-26 15:44, Dennis Mungai wrote:
> See corrected patch, as attached.

> +(define-public clang-3.8
> +  (clang-from-llvm llvm-3.8 clang-runtime-3.8
> +                   
> >"1ybcac8hlr9vl3wg8s4v6cp0c0qgqnwprsv85lihbkq3vqv94504"))

Did you successfully build clang 3.8 with this patch?  I ask because I 
am currently trying to do the same (while also upgrading 3.6 to 3.6.2 
and adding clang 3.7.1), but found that the clang-libc-search.patch 
that's used in clang-from-llvm does not apply to clang 3.8 source.

`~Eric

> 
> 
> 
> On 26 May 2016 at 23:13, Roel Janssen <roel@gnu.org> wrote:
>> Hello Dennis,
>> 
>> Welcome and thank you for the patch.
>> 
>> Dennis Mungai writes:
>> 
>>> +(define-public llvm-3.8
>>> +  (package (inherit llvm)
>>> +    (version "3.8.0")
>>> +    (source
>>> +     (origin
>>> +       (method url-fetch)
>>> +       (uri (string-append "http://llvm.org/releases/"
>>> +                           version "/llvm-" version ".src.tar.xz"))
>>> +       (sha256
>>> +        (base32
>>> +         "0ikfq0gxac8xpvxj23l4hk8f12ydx48fljgrz1gl9xp0ks704nsm"))))
>>> +    (native-inputs
>>> +     `(("python" ,python-wrapper)
>>> +       ("perl"   ,perl)
>>> +       ("libffi" ,libffi)
>>> +       ("zlib" ,zlib)))
>> 
>> One space between the string and the unquote is enough.
>> 
>>> +    (arguments
>>> +     `(#:configure-flags '("-DCMAKE_SKIP_BUILD_RPATH=FALSE"
>>> +                           "-DCMAKE_BUILD_WITH_INSTALL_RPATH=FALSE"
>>> +                           "-DLLVM_ENABLE_PIC=ON"
>>> +                           ;"-DLLVM_ENABLE_RTTI=ON"
>>> +                           "-DLLVM_ENABLE_WERROR=OFF"
>>> +                           ;;"-DLLVM_REQUIRES_RTTI=ON"
>> 
>> Could you remove the options you commented out?
>> 
>>> +                           )))))
>> 
>> These should be positioned directly after "-DLLVM_ENABLE_WERROR=OFF".
>> 
>>> +
>>> +(define-public clang-runtime-3.8
>>> +  (clang-runtime-from-llvm
>>> +   llvm-3.8
>>> +   "1c2nkp9563873ffz22qmhc0wakgj428pch8rmhym8agjamz3ily8"))
>>> +
>>> +(define-public clang-3.8
>>> +  (clang-from-llvm llvm-3.8 clang-runtime-3.8
>>> +                   
>>> "1ybcac8hlr9vl3wg8s4v6cp0c0qgqnwprsv85lihbkq3vqv94504"))
>>> --
>>> 2.7.4
>> 
>> Thank you,
>> Roel Janssen
  
Dennis Mungai May 27, 2016, 3:07 p.m. UTC | #2
Yes, I did.

I'll inspect this shortly and give you feedback.

On 27 May 2016 at 17:09, Eric Bavier <ericbavier@openmailbox.org> wrote:
> On 2016-05-26 15:44, Dennis Mungai wrote:
>>
>> See corrected patch, as attached.
>
>
>> +(define-public clang-3.8
>> +  (clang-from-llvm llvm-3.8 clang-runtime-3.8
>> +
>> >"1ybcac8hlr9vl3wg8s4v6cp0c0qgqnwprsv85lihbkq3vqv94504"))
>
>
> Did you successfully build clang 3.8 with this patch?  I ask because I am
> currently trying to do the same (while also upgrading 3.6 to 3.6.2 and
> adding clang 3.7.1), but found that the clang-libc-search.patch that's used
> in clang-from-llvm does not apply to clang 3.8 source.
>
> `~Eric
>
>
>>
>>
>>
>> On 26 May 2016 at 23:13, Roel Janssen <roel@gnu.org> wrote:
>>>
>>> Hello Dennis,
>>>
>>> Welcome and thank you for the patch.
>>>
>>> Dennis Mungai writes:
>>>
>>>> +(define-public llvm-3.8
>>>> +  (package (inherit llvm)
>>>> +    (version "3.8.0")
>>>> +    (source
>>>> +     (origin
>>>> +       (method url-fetch)
>>>> +       (uri (string-append "http://llvm.org/releases/"
>>>> +                           version "/llvm-" version ".src.tar.xz"))
>>>> +       (sha256
>>>> +        (base32
>>>> +         "0ikfq0gxac8xpvxj23l4hk8f12ydx48fljgrz1gl9xp0ks704nsm"))))
>>>> +    (native-inputs
>>>> +     `(("python" ,python-wrapper)
>>>> +       ("perl"   ,perl)
>>>> +       ("libffi" ,libffi)
>>>> +       ("zlib" ,zlib)))
>>>
>>>
>>> One space between the string and the unquote is enough.
>>>
>>>> +    (arguments
>>>> +     `(#:configure-flags '("-DCMAKE_SKIP_BUILD_RPATH=FALSE"
>>>> +                           "-DCMAKE_BUILD_WITH_INSTALL_RPATH=FALSE"
>>>> +                           "-DLLVM_ENABLE_PIC=ON"
>>>> +                           ;"-DLLVM_ENABLE_RTTI=ON"
>>>> +                           "-DLLVM_ENABLE_WERROR=OFF"
>>>> +                           ;;"-DLLVM_REQUIRES_RTTI=ON"
>>>
>>>
>>> Could you remove the options you commented out?
>>>
>>>> +                           )))))
>>>
>>>
>>> These should be positioned directly after "-DLLVM_ENABLE_WERROR=OFF".
>>>
>>>> +
>>>> +(define-public clang-runtime-3.8
>>>> +  (clang-runtime-from-llvm
>>>> +   llvm-3.8
>>>> +   "1c2nkp9563873ffz22qmhc0wakgj428pch8rmhym8agjamz3ily8"))
>>>> +
>>>> +(define-public clang-3.8
>>>> +  (clang-from-llvm llvm-3.8 clang-runtime-3.8
>>>> +
>>>> "1ybcac8hlr9vl3wg8s4v6cp0c0qgqnwprsv85lihbkq3vqv94504"))
>>>> --
>>>> 2.7.4
>>>
>>>
>>> Thank you,
>>> Roel Janssen
>
>
> --
> `~Eric
  
Roel Janssen May 28, 2016, 9:22 a.m. UTC | #3
Eric Bavier writes:

> On 2016-05-26 15:44, Dennis Mungai wrote:
>> See corrected patch, as attached.
>
>> +(define-public clang-3.8
>> +  (clang-from-llvm llvm-3.8 clang-runtime-3.8
>> +                   
>> >"1ybcac8hlr9vl3wg8s4v6cp0c0qgqnwprsv85lihbkq3vqv94504"))
>
> Did you successfully build clang 3.8 with this patch?  I ask because I 
> am currently trying to do the same (while also upgrading 3.6 to 3.6.2 
> and adding clang 3.7.1), but found that the clang-libc-search.patch 
> that's used in clang-from-llvm does not apply to clang 3.8 source.

I have the same problem.  Here is the relevant output of my local build:

patching file lib/Driver/ToolChains.cpp
Hunk #1 FAILED at 2931.
Hunk #2 succeeded at 3702 (offset 729 lines).
Hunk #3 FAILED at 3044.
Hunk #4 succeeded at 3792 with fuzz 2 (offset 731 lines).
Hunk #5 FAILED at 3085.
3 out of 5 hunks FAILED -- saving rejects to file lib/Driver/ToolChains.cpp.rej
source is under 'cfe-3.8.0.src'
applying '/gnu/store/9hzhm2s0fb9g9i6kxmp6jyjrj5v3b7xn-clang-libc-search-path.patch'...
builder for `/gnu/store/nw20qmrai6nvfkfybl4qfxdx3qlyays2-cfe-3.8.0.src.tar.xz.drv' failed to produce output path `/gnu/store/f0jccijb05rpw0vsfv8b57j67fsh5q29-cfe-3.8.0.src.tar.xz'

Kind regards,
Roel Janssen
  
Ludovic Courtès May 28, 2016, 3:30 p.m. UTC | #4
Hi!

Another question: is there any use for all these versions, or should we
instead just bump llvm/clang/clang-runtime to 3.8?

LLVM 3.6 currently has only five users:

--8<---------------cut here---------------start------------->8---
$ GUIX_PACKAGE_PATH= guix refresh -l llvm@3.6
Building the following 2 packages would ensure 5 dependent packages are rebuilt: rdmd-v2.070.0-1.da0a2e0 c-reduce-2.3.0
--8<---------------cut here---------------end--------------->8---

Thanks,
Ludo’.
  
Pjotr Prins June 10, 2016, 4:38 p.m. UTC | #5
On Sat, May 28, 2016 at 05:30:49PM +0200, Ludovic Courtès wrote:
> Hi!
> 
> Another question: is there any use for all these versions, or should we
> instead just bump llvm/clang/clang-runtime to 3.8?
> 
> LLVM 3.6 currently has only five users:

rdmd and ldc just got upgraded to LLVM 3.8 - we'll update those shortly. 
I am not sure about Julia. 

I think it is reasonable to have at least 2 versions of LLVM in GNU
Guix. There are always tools lagging behind.

Pj.
  
Dennis Mungai June 12, 2016, 10:17 a.m. UTC | #6
I second Pjotr on this.

There are always tools that will lag behind, and having multiple LLVM
versions is a reasonable (and possibly unavoidable) compromise, for
now.

There may be problems with conflicts should a user install such
pipelines with differing LLVM and Clang combinations within the same
profile, as a worst case scenario.

On 10 June 2016 at 19:38, Pjotr Prins <pjotr.public12@thebird.nl> wrote:
> On Sat, May 28, 2016 at 05:30:49PM +0200, Ludovic Courtčs wrote:
>> Hi!
>>
>> Another question: is there any use for all these versions, or should we
>> instead just bump llvm/clang/clang-runtime to 3.8?
>>
>> LLVM 3.6 currently has only five users:
>
> rdmd and ldc just got upgraded to LLVM 3.8 - we'll update those shortly.
> I am not sure about Julia.
>
> I think it is reasonable to have at least 2 versions of LLVM in GNU
> Guix. There are always tools lagging behind.
>
> Pj.
  
Ludovic Courtès June 12, 2016, 4:30 p.m. UTC | #7
Hi!

Dennis Mungai <dmngaie@gmail.com> skribis:

> I second Pjotr on this.
>
> There are always tools that will lag behind, and having multiple LLVM
> versions is a reasonable (and possibly unavoidable) compromise, for
> now.
>
> There may be problems with conflicts should a user install such
> pipelines with differing LLVM and Clang combinations within the same
> profile, as a worst case scenario.

OK fine.  Currently we have 3.6 and 3.5, so we’d add 3.8 on top of it,
right?  And the ‘llvm’, ‘clang’ etc. bindings would still point to 3.6?
Does it even make sense to have unversioned bindings?

The patch you posted earlier adds a number of configure flags, different
from those currently used in ‘llvm’, and in particular:

> +                           "-DLLVM_INCLUDE_TESTS=OFF" ;; clang target units cannot be built (invalid test targets inherited from llvm result in build failure)

IIUC, this has the effect of disabling tests, which is something we
avoid unless there’s a good reason.  I don’t understand the comment,
what’s happening?

Could you remove as many of the configure flags as needed, and add a
comment for those that need to remain?

Also, as a bonus, could you add a conforming commit log?  :-)

  https://www.gnu.org/software/guix/manual/html_node/Submitting-Patches.html

Thanks in advance!

Ludo’.
  

Patch

From 38643acf50749212a4455d15a1729002d6dfa04a Mon Sep 17 00:00:00 2001
From: brainiarc7 <dmngaie@gmail.com>
Date: Thu, 26 May 2016 22:39:05 +0300
Subject: [PATCH] Add LLVM 3.8 to GNU Guix

---
 gnu/packages/llvm.scm | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index 3bf019f..e995ff2 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -2,6 +2,9 @@ 
 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016 Dennis Mungai <dmngaie@gmail.com>
+;;; Copyright © 2016 Pjotr Prins <pjotr.public12@thebird.nl>
+;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -21,6 +24,8 @@ 
 (define-module (gnu packages llvm)
   #:use-module (guix packages)
   #:use-module (guix licenses)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages libffi)
   #:use-module (guix download)
   #:use-module (guix utils)
   #:use-module (guix build-system gnu)
@@ -201,3 +206,37 @@  code analysis tools.")
 (define-public clang-3.5
   (clang-from-llvm llvm-3.5 clang-runtime-3.5
                    "12yv3jwdjcbkrx7zjm8wh4jrvb59v8fdw4mnmz3zc1jb00p9k07w"))
+                   
+(define-public llvm-3.8
+  (package (inherit llvm)
+    (version "3.8.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "http://llvm.org/releases/"
+                           version "/llvm-" version ".src.tar.xz"))
+       (sha256
+        (base32
+         "0ikfq0gxac8xpvxj23l4hk8f12ydx48fljgrz1gl9xp0ks704nsm"))))
+    (native-inputs
+     `(("python" ,python-wrapper)
+       ("perl" ,perl)
+       ("libffi" ,libffi)
+       ("zlib" ,zlib)))
+    (arguments
+     `(#:configure-flags '("-DCMAKE_SKIP_BUILD_RPATH=FALSE"
+                           "-DCMAKE_BUILD_WITH_INSTALL_RPATH=FALSE"
+                           "-DLLVM_ENABLE_PIC=ON"
+                           "-DLLVM_ENABLE_WERROR=OFF")))))
+
+(define-public clang-runtime-3.8
+  (clang-runtime-from-llvm
+   llvm-3.8
+   "1c2nkp9563873ffz22qmhc0wakgj428pch8rmhym8agjamz3ily8"))
+
+(define-public clang-3.8
+  (clang-from-llvm llvm-3.8 clang-runtime-3.8
+                   "1ybcac8hlr9vl3wg8s4v6cp0c0qgqnwprsv85lihbkq3vqv94504"))
-- 
2.7.4