diff mbox

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

Message ID 87eg77izg8.fsf@gnu.org
State New
Headers show

Commit Message

Roel Janssen July 5, 2016, 8:48 p.m. UTC
Hello Dennis,

Thanks for your work on LLVM-3.8.  I see a couple of things:
- We try to keep lines within 80 columns.
- libffi and zlib should be inputs instead of native-inputs.
- zlib is both a license and a package, so the licenses should be
prefixed.

I created a new patch for you addressing these issues, if you and others
agree, I can push this one for you.  I verified that the package builds
and that the programs can be run.

Could you please also let me know whether you want to use the name
'brainiarc7' in the commit history, or that you prefer 'Dennis Mungai'.

Thanks again!

Kind regards,
Roel Janssen

>From 451d93eaaab6166e38e33f0556fe40f83afefc5c Mon Sep 17 00:00:00 2001
From: brainiarc7 <dmngaie@gmail.com>
Date: Tue, 5 Jul 2016 22:42:24 +0200
Subject: [PATCH] gnu: Add LLVM 3.8.

* gnu/packages/llvm.scm (llvm-3.8): New variable.
* gnu/packages/llvm.scm (clang-runtime-3.8): New variable.
---
 gnu/packages/llvm.scm | 47 +++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 43 insertions(+), 4 deletions(-)

Comments

Dennis Mungai July 5, 2016, 9:20 p.m. UTC | #1
Roel, you may push.

Also, I prefer the name Dennis Mungai.

:-)

On 5 July 2016 at 23:48, Roel Janssen <roel@gnu.org> wrote:
> Hello Dennis,
>
> Thanks for your work on LLVM-3.8.  I see a couple of things:
> - We try to keep lines within 80 columns.
> - libffi and zlib should be inputs instead of native-inputs.
> - zlib is both a license and a package, so the licenses should be
> prefixed.
>
> I created a new patch for you addressing these issues, if you and others
> agree, I can push this one for you.  I verified that the package builds
> and that the programs can be run.
>
> Could you please also let me know whether you want to use the name
> 'brainiarc7' in the commit history, or that you prefer 'Dennis Mungai'.
>
> Thanks again!
>
> Kind regards,
> Roel Janssen
>
> >From 451d93eaaab6166e38e33f0556fe40f83afefc5c Mon Sep 17 00:00:00 2001
> From: brainiarc7 <dmngaie@gmail.com>
> Date: Tue, 5 Jul 2016 22:42:24 +0200
> Subject: [PATCH] gnu: Add LLVM 3.8.
>
> * gnu/packages/llvm.scm (llvm-3.8): New variable.
> * gnu/packages/llvm.scm (clang-runtime-3.8): New variable.
> ---
>  gnu/packages/llvm.scm | 47 +++++++++++++++++++++++++++++++++++++++++++----
>  1 file changed, 43 insertions(+), 4 deletions(-)
>
> diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
> index 3bf019f..911a5ea 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.
>  ;;;
> @@ -20,7 +23,9 @@
>
>  (define-module (gnu packages llvm)
>    #:use-module (guix packages)
> -  #:use-module (guix licenses)
> +  #:use-module ((guix licenses) #:prefix license:)
> +  #:use-module (gnu packages compression)
> +  #:use-module (gnu packages libffi)
>    #:use-module (guix download)
>    #:use-module (guix utils)
>    #:use-module (guix build-system gnu)
> @@ -60,7 +65,7 @@ languages.  It currently supports compilation of C and C++ programs, using
>  front-ends derived from GCC 4.0.1.  A new front-end for the C family of
>  languages is in development.  The compiler infrastructure includes mirror sets
>  of programming tools as well as libraries with equivalent functionality.")
> -    (license ncsa)))
> +    (license license:ncsa)))
>
>  (define (clang-runtime-from-llvm llvm hash)
>    (package
> @@ -87,7 +92,7 @@ of programming tools as well as libraries with equivalent functionality.")
>  functions for C and C++ programs.  It also provides header files that allow C
>  and C++ source code to interface with the \"sanitization\" passes of the clang
>  compiler.  In LLVM this library is called \"compiler-rt\".")
> -    (license ncsa)
> +    (license license:ncsa)
>
>      ;; <http://compiler-rt.llvm.org/> doesn't list MIPS as supported.
>      (supported-systems (delete "mips64el-linux" %supported-systems))))
> @@ -170,7 +175,7 @@ compiler.  In LLVM this library is called \"compiler-rt\".")
>  Objective-C++ programming languages.  It uses LLVM as its back end.  The Clang
>  project includes the Clang front end, the Clang static analyzer, and several
>  code analysis tools.")
> -    (license ncsa)))
> +    (license license:ncsa)))
>
>  (define-public clang-runtime
>    (clang-runtime-from-llvm
> @@ -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"))))
> +    (inputs
> +     `(("libffi" ,libffi)
> +       ("zlib" ,zlib)))
> +    (native-inputs
> +     `(("python" ,python-wrapper)
> +       ("perl" ,perl)))
> +    (arguments
> +     `(#:configure-flags '("-DCMAKE_SKIP_BUILD_RPATH=FALSE"
> +                           ;; Using the "Release" build type we reduce the
> +                           ;; disk space and compile time footprint
> +                           ;; considerably.
> +                           "-DCMAKE_BUILD_TYPE=Release"
> +                           ;; This option was set on the previous LLVM build,
> +                           ;; so for consistency, use it here too.
> +                           "-DCMAKE_BUILD_WITH_INSTALL_RPATH=FALSE"
> +                           "-DLLVM_ENABLE_PIC=ON"
> +                           ;; Some non-crucial compiler warnings occur.  Treat
> +                           ;; them as warnings instead of errors.
> +                           "-DLLVM_ENABLE_WERROR=OFF")))))
> +
> +(define-public clang-runtime-3.8
> +  (clang-runtime-from-llvm llvm-3.8
> +   "1c2nkp9563873ffz22qmhc0wakgj428pch8rmhym8agjamz3ily8"))
> --
> 2.9.0
Roel Janssen July 5, 2016, 9:43 p.m. UTC | #2
Does everyone agree that the proposed patch is fine?

Dennis Mungai writes:

> Roel, you may push.
>
> Also, I prefer the name Dennis Mungai.
>
> :-)
>
> On 5 July 2016 at 23:48, Roel Janssen <roel@gnu.org> wrote:
>> Hello Dennis,
>>
>> Thanks for your work on LLVM-3.8.  I see a couple of things:
>> - We try to keep lines within 80 columns.
>> - libffi and zlib should be inputs instead of native-inputs.
>> - zlib is both a license and a package, so the licenses should be
>> prefixed.
>>
>> I created a new patch for you addressing these issues, if you and others
>> agree, I can push this one for you.  I verified that the package builds
>> and that the programs can be run.
>>
>> Could you please also let me know whether you want to use the name
>> 'brainiarc7' in the commit history, or that you prefer 'Dennis Mungai'.
>>
>> Thanks again!
>>
>> Kind regards,
>> Roel Janssen
>>
>> >From 451d93eaaab6166e38e33f0556fe40f83afefc5c Mon Sep 17 00:00:00 2001
>> From: brainiarc7 <dmngaie@gmail.com>
>> Date: Tue, 5 Jul 2016 22:42:24 +0200
>> Subject: [PATCH] gnu: Add LLVM 3.8.
>>
>> * gnu/packages/llvm.scm (llvm-3.8): New variable.
>> * gnu/packages/llvm.scm (clang-runtime-3.8): New variable.
>> ---
>>  gnu/packages/llvm.scm | 47 +++++++++++++++++++++++++++++++++++++++++++----
>>  1 file changed, 43 insertions(+), 4 deletions(-)
>>
>> diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
>> index 3bf019f..911a5ea 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.
>>  ;;;
>> @@ -20,7 +23,9 @@
>>
>>  (define-module (gnu packages llvm)
>>    #:use-module (guix packages)
>> -  #:use-module (guix licenses)
>> +  #:use-module ((guix licenses) #:prefix license:)
>> +  #:use-module (gnu packages compression)
>> +  #:use-module (gnu packages libffi)
>>    #:use-module (guix download)
>>    #:use-module (guix utils)
>>    #:use-module (guix build-system gnu)
>> @@ -60,7 +65,7 @@ languages.  It currently supports compilation of C and C++ programs, using
>>  front-ends derived from GCC 4.0.1.  A new front-end for the C family of
>>  languages is in development.  The compiler infrastructure includes mirror sets
>>  of programming tools as well as libraries with equivalent functionality.")
>> -    (license ncsa)))
>> +    (license license:ncsa)))
>>
>>  (define (clang-runtime-from-llvm llvm hash)
>>    (package
>> @@ -87,7 +92,7 @@ of programming tools as well as libraries with equivalent functionality.")
>>  functions for C and C++ programs.  It also provides header files that allow C
>>  and C++ source code to interface with the \"sanitization\" passes of the clang
>>  compiler.  In LLVM this library is called \"compiler-rt\".")
>> -    (license ncsa)
>> +    (license license:ncsa)
>>
>>      ;; <http://compiler-rt.llvm.org/> doesn't list MIPS as supported.
>>      (supported-systems (delete "mips64el-linux" %supported-systems))))
>> @@ -170,7 +175,7 @@ compiler.  In LLVM this library is called \"compiler-rt\".")
>>  Objective-C++ programming languages.  It uses LLVM as its back end.  The Clang
>>  project includes the Clang front end, the Clang static analyzer, and several
>>  code analysis tools.")
>> -    (license ncsa)))
>> +    (license license:ncsa)))
>>
>>  (define-public clang-runtime
>>    (clang-runtime-from-llvm
>> @@ -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"))))
>> +    (inputs
>> +     `(("libffi" ,libffi)
>> +       ("zlib" ,zlib)))
>> +    (native-inputs
>> +     `(("python" ,python-wrapper)
>> +       ("perl" ,perl)))
>> +    (arguments
>> +     `(#:configure-flags '("-DCMAKE_SKIP_BUILD_RPATH=FALSE"
>> +                           ;; Using the "Release" build type we reduce the
>> +                           ;; disk space and compile time footprint
>> +                           ;; considerably.
>> +                           "-DCMAKE_BUILD_TYPE=Release"
>> +                           ;; This option was set on the previous LLVM build,
>> +                           ;; so for consistency, use it here too.
>> +                           "-DCMAKE_BUILD_WITH_INSTALL_RPATH=FALSE"
>> +                           "-DLLVM_ENABLE_PIC=ON"
>> +                           ;; Some non-crucial compiler warnings occur.  Treat
>> +                           ;; them as warnings instead of errors.
>> +                           "-DLLVM_ENABLE_WERROR=OFF")))))
>> +
>> +(define-public clang-runtime-3.8
>> +  (clang-runtime-from-llvm llvm-3.8
>> +   "1c2nkp9563873ffz22qmhc0wakgj428pch8rmhym8agjamz3ily8"))
>> --
>> 2.9.0
Ricardo Wurmus July 6, 2016, 4:55 a.m. UTC | #3
Roel Janssen <roel@gnu.org> writes:

>>From 451d93eaaab6166e38e33f0556fe40f83afefc5c Mon Sep 17 00:00:00 2001
> From: brainiarc7 <dmngaie@gmail.com>
> Date: Tue, 5 Jul 2016 22:42:24 +0200
> Subject: [PATCH] gnu: Add LLVM 3.8.
>
> * gnu/packages/llvm.scm (llvm-3.8): New variable.
> * gnu/packages/llvm.scm (clang-runtime-3.8): New variable.

Please split this into two commits.  One for adding the “license:”
prefix, and another to add the new variables.

Other than that it looks good to me.  Thank you, Roel and Dennis!

~~ Ricardo
Efraim Flashner July 6, 2016, 11:54 a.m. UTC | #4
On Wed, Jul 06, 2016 at 06:55:56AM +0200, Ricardo Wurmus wrote:
> 
> Roel Janssen <roel@gnu.org> writes:
> 
> >>From 451d93eaaab6166e38e33f0556fe40f83afefc5c Mon Sep 17 00:00:00 2001
> > From: brainiarc7 <dmngaie@gmail.com>
> > Date: Tue, 5 Jul 2016 22:42:24 +0200
> > Subject: [PATCH] gnu: Add LLVM 3.8.
> >
> > * gnu/packages/llvm.scm (llvm-3.8): New variable.
> > * gnu/packages/llvm.scm (clang-runtime-3.8): New variable.
> 
> Please split this into two commits.  One for adding the “license:”
> prefix, and another to add the new variables.
> 
> Other than that it looks good to me.  Thank you, Roel and Dennis!
> 
> ~~ Ricardo
> 

Do we want to change the default llvm and clang to 3.8 also?
Eric Bavier July 6, 2016, 6:08 p.m. UTC | #5
On 2016-07-06 06:54, Efraim Flashner wrote:
> On Wed, Jul 06, 2016 at 06:55:56AM +0200, Ricardo Wurmus wrote:
>> 
>> Roel Janssen <roel@gnu.org> writes:
>> 
>> >>From 451d93eaaab6166e38e33f0556fe40f83afefc5c Mon Sep 17 00:00:00 2001
>> > From: brainiarc7 <dmngaie@gmail.com>
>> > Date: Tue, 5 Jul 2016 22:42:24 +0200
>> > Subject: [PATCH] gnu: Add LLVM 3.8.
>> >
>> > * gnu/packages/llvm.scm (llvm-3.8): New variable.
>> > * gnu/packages/llvm.scm (clang-runtime-3.8): New variable.
>> 
>> Please split this into two commits.  One for adding the “license:”
>> prefix, and another to add the new variables.
>> 
>> Other than that it looks good to me.  Thank you, Roel and Dennis!
>> 
>> ~~ Ricardo
>> 
> 
> Do we want to change the default llvm and clang to 3.8 also?

Yes, I think we should.  And fix the fallout from that change.

I have a few other issues with this patch:

1) It copy-pastes too much from the llvm package, rather than relying on 
a simple inherit like other versions.

2) It introduces cmake flags for things that are default, e.g. 
"-DLLVM_ENABLE_PIC=ON"

3) It uses the "-DCMAKE_BUILD_TYPE=Release" flag rather that our 
cmake-build-system's #:build-type keyword.

4) It adds libffi and zlib inputs.  These are not strictly necessary for 
the build, so I would prefer they be added in a separate commit.   Also, 
there's a missing "-DLLVM_ENABLE_FFI:BOOL=TRUE" flag, so the build 
system doesn't use the new input.

5) It doesn't also add a clang@3.8.0 package.  While this could be done 
later, I'd prefer it be done at the same time, like previous llvm 
updates.

I have been working on this update in parallel.  I've incorporated some 
parts of this patch, and I'll post the series here soon.
diff mbox

Patch

diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index 3bf019f..911a5ea 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.
 ;;;
@@ -20,7 +23,9 @@ 
 
 (define-module (gnu packages llvm)
   #:use-module (guix packages)
-  #:use-module (guix licenses)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages libffi)
   #:use-module (guix download)
   #:use-module (guix utils)
   #:use-module (guix build-system gnu)
@@ -60,7 +65,7 @@  languages.  It currently supports compilation of C and C++ programs, using
 front-ends derived from GCC 4.0.1.  A new front-end for the C family of
 languages is in development.  The compiler infrastructure includes mirror sets
 of programming tools as well as libraries with equivalent functionality.")
-    (license ncsa)))
+    (license license:ncsa)))
 
 (define (clang-runtime-from-llvm llvm hash)
   (package
@@ -87,7 +92,7 @@  of programming tools as well as libraries with equivalent functionality.")
 functions for C and C++ programs.  It also provides header files that allow C
 and C++ source code to interface with the \"sanitization\" passes of the clang
 compiler.  In LLVM this library is called \"compiler-rt\".")
-    (license ncsa)
+    (license license:ncsa)
 
     ;; <http://compiler-rt.llvm.org/> doesn't list MIPS as supported.
     (supported-systems (delete "mips64el-linux" %supported-systems))))
@@ -170,7 +175,7 @@  compiler.  In LLVM this library is called \"compiler-rt\".")
 Objective-C++ programming languages.  It uses LLVM as its back end.  The Clang
 project includes the Clang front end, the Clang static analyzer, and several
 code analysis tools.")
-    (license ncsa)))
+    (license license:ncsa)))
 
 (define-public clang-runtime
   (clang-runtime-from-llvm
@@ -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"))))
+    (inputs
+     `(("libffi" ,libffi)
+       ("zlib" ,zlib)))
+    (native-inputs
+     `(("python" ,python-wrapper)
+       ("perl" ,perl)))
+    (arguments
+     `(#:configure-flags '("-DCMAKE_SKIP_BUILD_RPATH=FALSE"
+                           ;; Using the "Release" build type we reduce the
+                           ;; disk space and compile time footprint
+                           ;; considerably.
+                           "-DCMAKE_BUILD_TYPE=Release"
+                           ;; This option was set on the previous LLVM build,
+                           ;; so for consistency, use it here too.
+                           "-DCMAKE_BUILD_WITH_INSTALL_RPATH=FALSE"
+                           "-DLLVM_ENABLE_PIC=ON"
+                           ;; Some non-crucial compiler warnings occur.  Treat
+                           ;; them as warnings instead of errors.
+                           "-DLLVM_ENABLE_WERROR=OFF")))))
+
+(define-public clang-runtime-3.8
+  (clang-runtime-from-llvm llvm-3.8
+   "1c2nkp9563873ffz22qmhc0wakgj428pch8rmhym8agjamz3ily8"))