unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH v2] gnu: Add rust
@ 2016-09-07  5:57 Eric Le Bihan
  2016-09-07  8:48 ` David Craven
  2016-09-13 12:09 ` [PATCH v2] gnu: Add rust ng0
  0 siblings, 2 replies; 10+ messages in thread
From: Eric Le Bihan @ 2016-09-07  5:57 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/rust.scm(rust): New variable.

Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
---
 gnu/packages/rust.scm | 143 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 143 insertions(+)
 create mode 100644 gnu/packages/rust.scm

diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
new file mode 100644
index 0000000..7f2edb8
--- /dev/null
+++ b/gnu/packages/rust.scm
@@ -0,0 +1,143 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2016 Eric Le Bihan <eric.le.bihan.dev@free.fr>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages rust)
+  #:use-module (ice-9 regex)
+  #:use-module ((guix licenses) #:select (asl2.0 x11-style))
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module (guix build-system gnu)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages bootstrap)
+  #:use-module (gnu packages curl)
+  #:use-module (gnu packages elf)
+  #:use-module (gnu packages gcc)
+  #:use-module (gnu packages jemalloc)
+  #:use-module (gnu packages perl)
+  #:use-module (gnu packages python))
+
+(define rust-bootstrap-x86_64-1.9.0
+  (origin
+   (method url-fetch)
+   (uri
+    "https://static.rust-lang.org/dist/2016-05-24/rustc-1.9.0-x86_64-unknown-linux-gnu.tar.gz")
+   (sha256
+    (base32
+     "1i44rlvvn3pr81sli6bdbkzd78ar1ibybxx6mzpw6rkw4c84sw6h"))))
+
+(define rust-bootstrap-i686-1.9.0
+  (origin
+   (method url-fetch)
+   (uri
+    "https://static.rust-lang.org/dist/2016-05-24/rustc-1.9.0-i686-unknown-linux-gnu.tar.gz")
+   (sha256
+    (base32
+     "0fdf5xvh3g4hdza0y80w1r9vnfczjqnbzbvs7k878yc26p4dwl99"))))
+
+(define-public rust
+  (package
+   (name "rust")
+   (version "1.10.0")
+   (source (origin
+            (method url-fetch)
+            (uri (string-append "https://static.rust-lang.org/dist/rustc-"
+                                version "-src.tar.gz"))
+            (sha256
+             (base32
+              "0sb82xb8y2pzs8l1hk91z228bambwx3dmi2kj8isin7nyjn5l0d4"))))
+   (build-system gnu-build-system)
+   (native-inputs
+    `(("curl" ,curl)
+      ("gcc" ,gcc)
+      ("gcc-lib" ,gcc "lib")
+      ("jemalloc" ,jemalloc)
+      ("patchelf" ,patchelf)
+      ("perl" ,perl)
+      ("python" ,python-2)
+      ("rust-bootstrap"
+       ,(if (string-match "x86_64"
+                          (or (%current-target-system) (%current-system)))
+            rust-bootstrap-x86_64-1.9.0
+            rust-bootstrap-i686-1.9.0))
+      ("which" ,which)))
+   (arguments
+    `(#:phases
+      (modify-phases %standard-phases
+        (add-after 'unpack 'unpack-bootstrap
+                   (lambda* (#:key inputs #:allow-other-keys)
+                     (with-directory-excursion (getcwd)
+                       (zero? (system*
+                               "tar"
+                               "--strip-components=1"
+                               "-xzf"
+                               (assoc-ref inputs "rust-bootstrap"))))))
+        (replace 'configure
+                 (lambda* (#:key inputs outputs #:allow-other-keys)
+                   (let ((out (assoc-ref outputs "out"))
+                         (binutils (assoc-ref inputs "binutils"))
+                         (gcc (assoc-ref inputs "gcc"))
+                         (gcc-lib (assoc-ref inputs "gcc-lib"))
+                         (jemalloc (assoc-ref inputs "jemalloc"))
+                         (ld-so (string-append
+                                 (assoc-ref inputs "libc")
+                                 ,(glibc-dynamic-linker)))
+                         (python (assoc-ref inputs "python")))
+                     (setenv "SHELL" (which "sh"))
+                     (setenv "CONFIG_SHELL" (which "sh"))
+                     ;; Tell where to find libgcc_s.so
+                     (setenv "LD_LIBRARY_PATH" (string-append gcc-lib "/lib"))
+                     ;; Remove reference to "/lib64/ld-linux-x86-64.so.2" from binary
+                     (zero? (system*
+                             "patchelf"
+                             "--set-interpreter" ld-so
+                             "rustc/bin/rustc"))
+                     (zero? (system*
+                             "./configure"
+                             (string-append "--prefix=" out)
+                             (string-append "--default-linker=" gcc "/bin/gcc")
+                             (string-append "--default-ar=" binutils "/bin/ar")
+                             (string-append "--jemalloc-root=" jemalloc "/lib")
+                             (string-append "--enable-rpath")
+                             (string-append "--enable-local-rust")
+                             (string-append "--local-rust-root=" (getcwd) "/rustc")
+                             (string-append "--python=" python "/bin/python2")
+                             "--disable-manage-submodules")))))
+        (add-before 'build 'create-linker-wrapper
+                    (lambda _
+                      (let* ((bindir (string-append (getcwd) "/bin"))
+                             (cc (string-append bindir "/cc")))
+                        (mkdir bindir)
+                        (call-with-output-file cc
+                          (lambda (port)
+                            (format port
+                                    "#!~a\n\nexec gcc \"$@\"\n" (which "sh"))))
+                        (chmod cc #o755))))
+        (add-before 'build 'change-PATH
+                    (lambda _
+                      (setenv "PATH"
+                              (string-append (getcwd)
+                                             "/bin:"
+                                             (getenv "PATH"))))))
+      ;; Disable tests which can only be run from Git repository
+      #:tests? #f))
+   (synopsis "Compiler for the Rust progamming language")
+   (description
+    "Rust is a systems programming language that runs blazingly fast, prevents
+segfaults, and guarantees thread safety.")
+   (home-page "https://www.rust-lang.org")
+   (license (list asl2.0 (x11-style "file://LICENSE-MIT")))))
-- 
2.4.11

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v2] gnu: Add rust
  2016-09-07  5:57 [PATCH v2] gnu: Add rust Eric Le Bihan
@ 2016-09-07  8:48 ` David Craven
  2016-09-13 11:55   ` [PATCH v2] gnu: Add rust (sidenotes on rust) ng0
  2016-09-13 12:09 ` [PATCH v2] gnu: Add rust ng0
  1 sibling, 1 reply; 10+ messages in thread
From: David Craven @ 2016-09-07  8:48 UTC (permalink / raw)
  To: Eric Le Bihan; +Cc: guix-devel

I haven't actually built rustc yet, because I know how long it takes...

> +                         (ld-so (string-append
> +                                 (assoc-ref inputs "libc")
> +                                 ,(glibc-dynamic-linker)))

> +                     ;; Remove reference to "/lib64/ld-linux-x86-64.so.2" from binary
> +                     (zero? (system*
> +                             "patchelf"
> +                             "--set-interpreter" ld-so

I think that this should be part of the a rustc-bootstrap package. We
shouldn't export binaries to the user, but I think we need a fully
functional bootstrap compiler.

> +                     (setenv "SHELL" (which "sh"))
> +                     (setenv "CONFIG_SHELL" (which "sh"))
> +                     ;; Tell where to find libgcc_s.so
> +                     (setenv "LD_LIBRARY_PATH" (string-append gcc-lib "/lib"))

I think this should be a separate phase. We can then use
#:configure-flags to pass --default-linker etc.

> +      #:tests? #f))

To get tests enabled you can apply this patch [0].

[0] https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/compilers/rust/patches/disable-lockfile-check.patch

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2] gnu: Add rust (sidenotes on rust)
  2016-09-07  8:48 ` David Craven
@ 2016-09-13 11:55   ` ng0
  2016-09-13 12:19     ` ng0
  0 siblings, 1 reply; 10+ messages in thread
From: ng0 @ 2016-09-13 11:55 UTC (permalink / raw)
  To: David Craven, Eric Le Bihan; +Cc: guix-devel

I can testbuild rustc and give some input.

Additionally, we're having conversations about rust, today this came up:


dev @> Very interesting: https://github.com/rust-lang/rfcs/blob/master/text/1200-cargo-install.md
" it's not clear that this is worthwhile enough to support installing libraries yet."
on bootstraping: https://mail.mozilla.org/pipermail/rust-dev/2014-June/010222.html 

dev @> apparently cargo is not designed to use system paths to find dynamic libraries
by default libraries are downloaded from github and stored in a cache directory


How problematic will this be for us? Our person in charge for the rust
stuff works around this by including copies of the libraries in a folder
named 'third_party', but I don't understand enough of the language and
lack a build system at the moment.

David Craven <david@craven.ch> writes:

> I haven't actually built rustc yet, because I know how long it takes...
>
>> +                         (ld-so (string-append
>> +                                 (assoc-ref inputs "libc")
>> +                                 ,(glibc-dynamic-linker)))
>
>> +                     ;; Remove reference to "/lib64/ld-linux-x86-64.so.2" from binary
>> +                     (zero? (system*
>> +                             "patchelf"
>> +                             "--set-interpreter" ld-so
>
> I think that this should be part of the a rustc-bootstrap package. We
> shouldn't export binaries to the user, but I think we need a fully
> functional bootstrap compiler.
>
>> +                     (setenv "SHELL" (which "sh"))
>> +                     (setenv "CONFIG_SHELL" (which "sh"))
>> +                     ;; Tell where to find libgcc_s.so
>> +                     (setenv "LD_LIBRARY_PATH" (string-append gcc-lib "/lib"))
>
> I think this should be a separate phase. We can then use
> #:configure-flags to pass --default-linker etc.
>
>> +      #:tests? #f))
>
> To get tests enabled you can apply this patch [0].
>
> [0] https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/compilers/rust/patches/disable-lockfile-check.patch
>

-- 
ng0
For non-prism friendly talk find me on http://www.psyced.org

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2] gnu: Add rust
  2016-09-07  5:57 [PATCH v2] gnu: Add rust Eric Le Bihan
  2016-09-07  8:48 ` David Craven
@ 2016-09-13 12:09 ` ng0
  2016-09-13 17:20   ` Eric Le Bihan
  1 sibling, 1 reply; 10+ messages in thread
From: ng0 @ 2016-09-13 12:09 UTC (permalink / raw)
  To: Eric Le Bihan, guix-devel

Hi,

I can not apply this patch with git am. Can you resend the patch as an
appended file created with git format-patch or something similar, and
not inlined?

Eric Le Bihan <eric.le.bihan.dev@free.fr> writes:

> * gnu/packages/rust.scm(rust): New variable.
>
> Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
> ---
>  gnu/packages/rust.scm | 143 ++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 143 insertions(+)
>  create mode 100644 gnu/packages/rust.scm
>
> diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
> new file mode 100644
> index 0000000..7f2edb8
> --- /dev/null
> +++ b/gnu/packages/rust.scm
> @@ -0,0 +1,143 @@
> +;;; GNU Guix --- Functional package management for GNU
> +;;; Copyright © 2016 Eric Le Bihan <eric.le.bihan.dev@free.fr>
> +;;;
> +;;; This file is part of GNU Guix.
> +;;;
> +;;; GNU Guix is free software; you can redistribute it and/or modify it
> +;;; under the terms of the GNU General Public License as published by
> +;;; the Free Software Foundation; either version 3 of the License, or (at
> +;;; your option) any later version.
> +;;;
> +;;; GNU Guix is distributed in the hope that it will be useful, but
> +;;; WITHOUT ANY WARRANTY; without even the implied warranty of
> +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +;;; GNU General Public License for more details.
> +;;;
> +;;; You should have received a copy of the GNU General Public License
> +;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
> +
> +(define-module (gnu packages rust)
> +  #:use-module (ice-9 regex)
> +  #:use-module ((guix licenses) #:select (asl2.0 x11-style))
> +  #:use-module (guix packages)
> +  #:use-module (guix download)
> +  #:use-module (guix build-system gnu)
> +  #:use-module (gnu packages base)
> +  #:use-module (gnu packages bootstrap)
> +  #:use-module (gnu packages curl)
> +  #:use-module (gnu packages elf)
> +  #:use-module (gnu packages gcc)
> +  #:use-module (gnu packages jemalloc)
> +  #:use-module (gnu packages perl)
> +  #:use-module (gnu packages python))
> +
> +(define rust-bootstrap-x86_64-1.9.0
> +  (origin
> +   (method url-fetch)
> +   (uri
> +    "https://static.rust-lang.org/dist/2016-05-24/rustc-1.9.0-x86_64-unknown-linux-gnu.tar.gz")
> +   (sha256
> +    (base32
> +     "1i44rlvvn3pr81sli6bdbkzd78ar1ibybxx6mzpw6rkw4c84sw6h"))))
> +
> +(define rust-bootstrap-i686-1.9.0
> +  (origin
> +   (method url-fetch)
> +   (uri
> +    "https://static.rust-lang.org/dist/2016-05-24/rustc-1.9.0-i686-unknown-linux-gnu.tar.gz")
> +   (sha256
> +    (base32
> +     "0fdf5xvh3g4hdza0y80w1r9vnfczjqnbzbvs7k878yc26p4dwl99"))))
> +
> +(define-public rust
> +  (package
> +   (name "rust")
> +   (version "1.10.0")
> +   (source (origin
> +            (method url-fetch)
> +            (uri (string-append "https://static.rust-lang.org/dist/rustc-"
> +                                version "-src.tar.gz"))
> +            (sha256
> +             (base32
> +              "0sb82xb8y2pzs8l1hk91z228bambwx3dmi2kj8isin7nyjn5l0d4"))))
> +   (build-system gnu-build-system)
> +   (native-inputs
> +    `(("curl" ,curl)
> +      ("gcc" ,gcc)
> +      ("gcc-lib" ,gcc "lib")
> +      ("jemalloc" ,jemalloc)
> +      ("patchelf" ,patchelf)
> +      ("perl" ,perl)
> +      ("python" ,python-2)
> +      ("rust-bootstrap"
> +       ,(if (string-match "x86_64"
> +                          (or (%current-target-system) (%current-system)))
> +            rust-bootstrap-x86_64-1.9.0
> +            rust-bootstrap-i686-1.9.0))
> +      ("which" ,which)))
> +   (arguments
> +    `(#:phases
> +      (modify-phases %standard-phases
> +        (add-after 'unpack 'unpack-bootstrap
> +                   (lambda* (#:key inputs #:allow-other-keys)
> +                     (with-directory-excursion (getcwd)
> +                       (zero? (system*
> +                               "tar"
> +                               "--strip-components=1"
> +                               "-xzf"
> +                               (assoc-ref inputs "rust-bootstrap"))))))
> +        (replace 'configure
> +                 (lambda* (#:key inputs outputs #:allow-other-keys)
> +                   (let ((out (assoc-ref outputs "out"))
> +                         (binutils (assoc-ref inputs "binutils"))
> +                         (gcc (assoc-ref inputs "gcc"))
> +                         (gcc-lib (assoc-ref inputs "gcc-lib"))
> +                         (jemalloc (assoc-ref inputs "jemalloc"))
> +                         (ld-so (string-append
> +                                 (assoc-ref inputs "libc")
> +                                 ,(glibc-dynamic-linker)))
> +                         (python (assoc-ref inputs "python")))
> +                     (setenv "SHELL" (which "sh"))
> +                     (setenv "CONFIG_SHELL" (which "sh"))
> +                     ;; Tell where to find libgcc_s.so
> +                     (setenv "LD_LIBRARY_PATH" (string-append gcc-lib "/lib"))
> +                     ;; Remove reference to "/lib64/ld-linux-x86-64.so.2" from binary
> +                     (zero? (system*
> +                             "patchelf"
> +                             "--set-interpreter" ld-so
> +                             "rustc/bin/rustc"))
> +                     (zero? (system*
> +                             "./configure"
> +                             (string-append "--prefix=" out)
> +                             (string-append "--default-linker=" gcc "/bin/gcc")
> +                             (string-append "--default-ar=" binutils "/bin/ar")
> +                             (string-append "--jemalloc-root=" jemalloc "/lib")
> +                             (string-append "--enable-rpath")
> +                             (string-append "--enable-local-rust")
> +                             (string-append "--local-rust-root=" (getcwd) "/rustc")
> +                             (string-append "--python=" python "/bin/python2")
> +                             "--disable-manage-submodules")))))
> +        (add-before 'build 'create-linker-wrapper
> +                    (lambda _
> +                      (let* ((bindir (string-append (getcwd) "/bin"))
> +                             (cc (string-append bindir "/cc")))
> +                        (mkdir bindir)
> +                        (call-with-output-file cc
> +                          (lambda (port)
> +                            (format port
> +                                    "#!~a\n\nexec gcc \"$@\"\n" (which "sh"))))
> +                        (chmod cc #o755))))
> +        (add-before 'build 'change-PATH
> +                    (lambda _
> +                      (setenv "PATH"
> +                              (string-append (getcwd)
> +                                             "/bin:"
> +                                             (getenv "PATH"))))))
> +      ;; Disable tests which can only be run from Git repository
> +      #:tests? #f))
> +   (synopsis "Compiler for the Rust progamming language")
> +   (description
> +    "Rust is a systems programming language that runs blazingly fast, prevents
> +segfaults, and guarantees thread safety.")
> +   (home-page "https://www.rust-lang.org")
> +   (license (list asl2.0 (x11-style "file://LICENSE-MIT")))))
> -- 
> 2.4.11
>
>

-- 
ng0
For non-prism friendly talk find me on http://www.psyced.org

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2] gnu: Add rust (sidenotes on rust)
  2016-09-13 11:55   ` [PATCH v2] gnu: Add rust (sidenotes on rust) ng0
@ 2016-09-13 12:19     ` ng0
  2016-09-13 12:28       ` David Craven
  0 siblings, 1 reply; 10+ messages in thread
From: ng0 @ 2016-09-13 12:19 UTC (permalink / raw)
  To: David Craven, Eric Le Bihan; +Cc: guix-devel

ng0 <ng0@we.make.ritual.n0.is> writes:

> I can testbuild rustc and give some input.
>
> Additionally, we're having conversations about rust, today this came up:
>
>
> dev @> Very interesting: https://github.com/rust-lang/rfcs/blob/master/text/1200-cargo-install.md
> " it's not clear that this is worthwhile enough to support installing libraries yet."
> on bootstraping: https://mail.mozilla.org/pipermail/rust-dev/2014-June/010222.html 
>
> dev @> apparently cargo is not designed to use system paths to find dynamic libraries
> by default libraries are downloaded from github and stored in a cache directory
>
>
> How problematic will this be for us? Our person in charge for the rust
> stuff works around this by including copies of the libraries in a folder
> named 'third_party', but I don't understand enough of the language and
> lack a build system at the moment.

These two links should be useful too, so it might not be that hard to
establish a build system.

http://doc.crates.io/source-replacement.html
http://doc.crates.io/specifying-dependencies.html

> David Craven <david@craven.ch> writes:
>
>> I haven't actually built rustc yet, because I know how long it takes...
>>
>>> +                         (ld-so (string-append
>>> +                                 (assoc-ref inputs "libc")
>>> +                                 ,(glibc-dynamic-linker)))
>>
>>> +                     ;; Remove reference to "/lib64/ld-linux-x86-64.so.2" from binary
>>> +                     (zero? (system*
>>> +                             "patchelf"
>>> +                             "--set-interpreter" ld-so
>>
>> I think that this should be part of the a rustc-bootstrap package. We
>> shouldn't export binaries to the user, but I think we need a fully
>> functional bootstrap compiler.
>>
>>> +                     (setenv "SHELL" (which "sh"))
>>> +                     (setenv "CONFIG_SHELL" (which "sh"))
>>> +                     ;; Tell where to find libgcc_s.so
>>> +                     (setenv "LD_LIBRARY_PATH" (string-append gcc-lib "/lib"))
>>
>> I think this should be a separate phase. We can then use
>> #:configure-flags to pass --default-linker etc.
>>
>>> +      #:tests? #f))
>>
>> To get tests enabled you can apply this patch [0].
>>
>> [0] https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/compilers/rust/patches/disable-lockfile-check.patch
>>
>
> -- 
> ng0
> For non-prism friendly talk find me on http://www.psyced.org
>
>

-- 
ng0

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2] gnu: Add rust (sidenotes on rust)
  2016-09-13 12:19     ` ng0
@ 2016-09-13 12:28       ` David Craven
  0 siblings, 0 replies; 10+ messages in thread
From: David Craven @ 2016-09-13 12:28 UTC (permalink / raw)
  To: ng0; +Cc: guix-devel

> How problematic will this be for us? Our person in charge for the rust
> stuff works around this by including copies of the libraries in a folder
> named 'third_party', but I don't understand enough of the language and
> lack a build system at the moment.

Initially this isn't a problem, since we'll use cargo to build the c
dependencies of a package. The cargo packages that wrap c packages
usually have a detection mechanism to use system libraries instead of
building them - but I haven't looked into how this works exactly.

> These two links should be useful too, so it might not be that hard to
> establish a build system.

I don't think it's hard, but just takes time. The part that I expect
will take more time than the build system is the importer.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2] gnu: Add rust
  2016-09-13 12:09 ` [PATCH v2] gnu: Add rust ng0
@ 2016-09-13 17:20   ` Eric Le Bihan
  2016-09-13 18:29     ` ng0
  0 siblings, 1 reply; 10+ messages in thread
From: Eric Le Bihan @ 2016-09-13 17:20 UTC (permalink / raw)
  To: ng0; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 588 bytes --]

Hi!

Le Tue, 13 Sep 2016 12:09:42 +0000,
ng0 <ng0@we.make.ritual.n0.is> a écrit :

> I can not apply this patch with git am. Can you resend the patch as an
> appended file created with git format-patch or something similar, and
> not inlined?

That's surprising: the patch was generated by `git format-patch` and
sent via `git send-email`. My mail client is Claws Mail and it allows
me to save the email I previously sent to a file in mbox format, which
applies without problem with `git am`.

Anyway, please find it re-attached to this mail.

Best regards,

-- 
ELB

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-rust.patch --]
[-- Type: text/x-patch, Size: 7139 bytes --]

From 4f52b3f041e040d93a0a2f178d3b4a6e8f49df9f Mon Sep 17 00:00:00 2001
From: Eric Le Bihan <eric.le.bihan.dev@free.fr>
Date: Thu, 28 Jul 2016 20:09:01 +0200
Subject: [PATCH v2] gnu: Add rust

* gnu/packages/rust.scm(rust): New variable.

Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
---
 gnu/packages/rust.scm | 143 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 143 insertions(+)
 create mode 100644 gnu/packages/rust.scm

diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
new file mode 100644
index 0000000..7f2edb8
--- /dev/null
+++ b/gnu/packages/rust.scm
@@ -0,0 +1,143 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2016 Eric Le Bihan <eric.le.bihan.dev@free.fr>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages rust)
+  #:use-module (ice-9 regex)
+  #:use-module ((guix licenses) #:select (asl2.0 x11-style))
+  #:use-module (guix packages)
+  #:use-module (guix download)
+  #:use-module (guix build-system gnu)
+  #:use-module (gnu packages base)
+  #:use-module (gnu packages bootstrap)
+  #:use-module (gnu packages curl)
+  #:use-module (gnu packages elf)
+  #:use-module (gnu packages gcc)
+  #:use-module (gnu packages jemalloc)
+  #:use-module (gnu packages perl)
+  #:use-module (gnu packages python))
+
+(define rust-bootstrap-x86_64-1.9.0
+  (origin
+   (method url-fetch)
+   (uri
+    "https://static.rust-lang.org/dist/2016-05-24/rustc-1.9.0-x86_64-unknown-linux-gnu.tar.gz")
+   (sha256
+    (base32
+     "1i44rlvvn3pr81sli6bdbkzd78ar1ibybxx6mzpw6rkw4c84sw6h"))))
+
+(define rust-bootstrap-i686-1.9.0
+  (origin
+   (method url-fetch)
+   (uri
+    "https://static.rust-lang.org/dist/2016-05-24/rustc-1.9.0-i686-unknown-linux-gnu.tar.gz")
+   (sha256
+    (base32
+     "0fdf5xvh3g4hdza0y80w1r9vnfczjqnbzbvs7k878yc26p4dwl99"))))
+
+(define-public rust
+  (package
+   (name "rust")
+   (version "1.10.0")
+   (source (origin
+            (method url-fetch)
+            (uri (string-append "https://static.rust-lang.org/dist/rustc-"
+                                version "-src.tar.gz"))
+            (sha256
+             (base32
+              "0sb82xb8y2pzs8l1hk91z228bambwx3dmi2kj8isin7nyjn5l0d4"))))
+   (build-system gnu-build-system)
+   (native-inputs
+    `(("curl" ,curl)
+      ("gcc" ,gcc)
+      ("gcc-lib" ,gcc "lib")
+      ("jemalloc" ,jemalloc)
+      ("patchelf" ,patchelf)
+      ("perl" ,perl)
+      ("python" ,python-2)
+      ("rust-bootstrap"
+       ,(if (string-match "x86_64"
+                          (or (%current-target-system) (%current-system)))
+            rust-bootstrap-x86_64-1.9.0
+            rust-bootstrap-i686-1.9.0))
+      ("which" ,which)))
+   (arguments
+    `(#:phases
+      (modify-phases %standard-phases
+        (add-after 'unpack 'unpack-bootstrap
+                   (lambda* (#:key inputs #:allow-other-keys)
+                     (with-directory-excursion (getcwd)
+                       (zero? (system*
+                               "tar"
+                               "--strip-components=1"
+                               "-xzf"
+                               (assoc-ref inputs "rust-bootstrap"))))))
+        (replace 'configure
+                 (lambda* (#:key inputs outputs #:allow-other-keys)
+                   (let ((out (assoc-ref outputs "out"))
+                         (binutils (assoc-ref inputs "binutils"))
+                         (gcc (assoc-ref inputs "gcc"))
+                         (gcc-lib (assoc-ref inputs "gcc-lib"))
+                         (jemalloc (assoc-ref inputs "jemalloc"))
+                         (ld-so (string-append
+                                 (assoc-ref inputs "libc")
+                                 ,(glibc-dynamic-linker)))
+                         (python (assoc-ref inputs "python")))
+                     (setenv "SHELL" (which "sh"))
+                     (setenv "CONFIG_SHELL" (which "sh"))
+                     ;; Tell where to find libgcc_s.so
+                     (setenv "LD_LIBRARY_PATH" (string-append gcc-lib "/lib"))
+                     ;; Remove reference to "/lib64/ld-linux-x86-64.so.2" from binary
+                     (zero? (system*
+                             "patchelf"
+                             "--set-interpreter" ld-so
+                             "rustc/bin/rustc"))
+                     (zero? (system*
+                             "./configure"
+                             (string-append "--prefix=" out)
+                             (string-append "--default-linker=" gcc "/bin/gcc")
+                             (string-append "--default-ar=" binutils "/bin/ar")
+                             (string-append "--jemalloc-root=" jemalloc "/lib")
+                             (string-append "--enable-rpath")
+                             (string-append "--enable-local-rust")
+                             (string-append "--local-rust-root=" (getcwd) "/rustc")
+                             (string-append "--python=" python "/bin/python2")
+                             "--disable-manage-submodules")))))
+        (add-before 'build 'create-linker-wrapper
+                    (lambda _
+                      (let* ((bindir (string-append (getcwd) "/bin"))
+                             (cc (string-append bindir "/cc")))
+                        (mkdir bindir)
+                        (call-with-output-file cc
+                          (lambda (port)
+                            (format port
+                                    "#!~a\n\nexec gcc \"$@\"\n" (which "sh"))))
+                        (chmod cc #o755))))
+        (add-before 'build 'change-PATH
+                    (lambda _
+                      (setenv "PATH"
+                              (string-append (getcwd)
+                                             "/bin:"
+                                             (getenv "PATH"))))))
+      ;; Disable tests which can only be run from Git repository
+      #:tests? #f))
+   (synopsis "Compiler for the Rust progamming language")
+   (description
+    "Rust is a systems programming language that runs blazingly fast, prevents
+segfaults, and guarantees thread safety.")
+   (home-page "https://www.rust-lang.org")
+   (license (list asl2.0 (x11-style "file://LICENSE-MIT")))))
-- 
2.4.11


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v2] gnu: Add rust
  2016-09-13 17:20   ` Eric Le Bihan
@ 2016-09-13 18:29     ` ng0
  2016-09-13 18:45       ` ng0
  0 siblings, 1 reply; 10+ messages in thread
From: ng0 @ 2016-09-13 18:29 UTC (permalink / raw)
  To: Eric Le Bihan; +Cc: guix-devel

Eric Le Bihan <eric.le.bihan.dev@free.fr> writes:

> Hi!
>
> Le Tue, 13 Sep 2016 12:09:42 +0000,
> ng0 <ng0@we.make.ritual.n0.is> a écrit :
>
>> I can not apply this patch with git am. Can you resend the patch as an
>> appended file created with git format-patch or something similar, and
>> not inlined?
>
> That's surprising: the patch was generated by `git format-patch` and
> sent via `git send-email`. My mail client is Claws Mail and it allows
> me to save the email I previously sent to a file in mbox format, which
> applies without problem with `git am`.
>
> Anyway, please find it re-attached to this mail.

Thanks, worked this time.

> Best regards,


I get this output, same like I had with what jelle ended up with my
base, produced an equal first error at some point.

Okay, i just realized there was a mistake in the patch i applied, I need
to check it again, but I've got this before.. I don't know what's wrong
here.

substitute: updating list of substitutes from 'https://mirror.hydra.gnu.org'... 100.0%
substitute: updating list of substitutes from 'https://mirror.hydra.gnu.org'... 100.0%
process 16829 acquired build slot '/var/guix/offload/192.168.1.198/0'
Cannot open display "default display"
load on machine '192.168.1.198' is 0.0 (normalized: 0.0)
@ build-started /gnu/store/qaf7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv - x86_64-linux /var/log/guix/drvs/qa//f7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv.bz2
Cannot open display "default display"
Cannot open display "default display"
sending 2 store files to '192.168.1.198'...
Cannot open display "default display"
exporting path `/gnu/store/hpj2m538l2anjb6bwksxgbivjxz5gnzj-rust-stage0-2016-02-17-4d3eebf-linux-x86_64-d29b7607d13d64078b6324aec82926fb493f59ba.tar.bz2.drv'
exporting path `/gnu/store/qaf7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv'
offloading '/gnu/store/qaf7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv' to '192.168.1.198'...
@ build-remote /gnu/store/qaf7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv 192.168.1.198
Cannot open display "default display"
substitute: updating list of substitutes from 'https://mirror.hydra.gnu.org'... 100.0%
The following derivation will be built:
   /gnu/store/qaf7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv
@ build-started /gnu/store/qaf7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv - x86_64-linux /var/log/guix/drvs/qa//f7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv.bz2
Backtrace:
In ice-9/boot-9.scm:
 157: 11 [catch #t #<catch-closure 8c9560> ...]
In unknown file:
   ?: 10 [apply-smob/1 #<catch-closure 8c9560>]
In ice-9/boot-9.scm:
  63: 9 [call-with-prompt prompt0 ...]
In ice-9/eval.scm:
 432: 8 [eval # #]
In ice-9/boot-9.scm:
2401: 7 [save-module-excursion #<procedure 8e7880 at ice-9/boot-9.scm:4045:3 ()>]
4050: 6 [#<procedure 8e7880 at ice-9/boot-9.scm:4045:3 ()>]
1724: 5 [%start-stack load-stack #<procedure 8fa7c0 at ice-9/boot-9.scm:4041:10 ()>]
1729: 4 [#<procedure 8fdc60 ()>]
In unknown file:
   ?: 3 [primitive-load "/gnu/store/x5fjjgvzbrcibsv2zwqvsay5zc4916xx-rust-stage0-2016-02-17-4d3eebf-guile-builder"]
In ice-9/eval.scm:
 387: 2 [eval # ()]
 411: 1 [eval # ()]
In unknown file:
   ?: 0 [string-append #f "/lib/ld-linux-x86-64.so.2"]

ERROR: In procedure string-append:
ERROR: In procedure string-append: Wrong type (expecting string): #f
builder for `/gnu/store/qaf7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv' failed with exit code 1
@ build-failed /gnu/store/qaf7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv - 1 builder for `/gnu/store/qaf7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv' failed with exit code 1
guix build: error: build failed: build of `/gnu/store/qaf7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv' failed
Cannot open display "default display"
derivation '/gnu/store/qaf7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv' offloaded to '192.168.1.198' failed with exit code 1
@ build-failed /gnu/store/qaf7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv - 1 builder for `/gnu/store/qaf7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv' failed with exit code 100
cannot build derivation `/gnu/store/0jplgx6n7a8qc93h36cjwr0bxxcksrah-rust-1.8.0.drv': 1 dependencies couldn't be built
guix build: error: build failed: build of `/gnu/store/0jplgx6n7a8qc93h36cjwr0bxxcksrah-rust-1.8.0.drv' failed



> -- 
> ELB
> From 4f52b3f041e040d93a0a2f178d3b4a6e8f49df9f Mon Sep 17 00:00:00 2001
> From: Eric Le Bihan <eric.le.bihan.dev@free.fr>
> Date: Thu, 28 Jul 2016 20:09:01 +0200
> Subject: [PATCH v2] gnu: Add rust
>
> * gnu/packages/rust.scm(rust): New variable.
>
> Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
> ---
>  gnu/packages/rust.scm | 143 ++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 143 insertions(+)
>  create mode 100644 gnu/packages/rust.scm
>
> diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
> new file mode 100644
> index 0000000..7f2edb8
> --- /dev/null
> +++ b/gnu/packages/rust.scm
> @@ -0,0 +1,143 @@
> +;;; GNU Guix --- Functional package management for GNU
> +;;; Copyright © 2016 Eric Le Bihan <eric.le.bihan.dev@free.fr>
> +;;;
> +;;; This file is part of GNU Guix.
> +;;;
> +;;; GNU Guix is free software; you can redistribute it and/or modify it
> +;;; under the terms of the GNU General Public License as published by
> +;;; the Free Software Foundation; either version 3 of the License, or (at
> +;;; your option) any later version.
> +;;;
> +;;; GNU Guix is distributed in the hope that it will be useful, but
> +;;; WITHOUT ANY WARRANTY; without even the implied warranty of
> +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +;;; GNU General Public License for more details.
> +;;;
> +;;; You should have received a copy of the GNU General Public License
> +;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
> +
> +(define-module (gnu packages rust)
> +  #:use-module (ice-9 regex)
> +  #:use-module ((guix licenses) #:select (asl2.0 x11-style))
> +  #:use-module (guix packages)
> +  #:use-module (guix download)
> +  #:use-module (guix build-system gnu)
> +  #:use-module (gnu packages base)
> +  #:use-module (gnu packages bootstrap)
> +  #:use-module (gnu packages curl)
> +  #:use-module (gnu packages elf)
> +  #:use-module (gnu packages gcc)
> +  #:use-module (gnu packages jemalloc)
> +  #:use-module (gnu packages perl)
> +  #:use-module (gnu packages python))
> +
> +(define rust-bootstrap-x86_64-1.9.0
> +  (origin
> +   (method url-fetch)
> +   (uri
> +    "https://static.rust-lang.org/dist/2016-05-24/rustc-1.9.0-x86_64-unknown-linux-gnu.tar.gz")
> +   (sha256
> +    (base32
> +     "1i44rlvvn3pr81sli6bdbkzd78ar1ibybxx6mzpw6rkw4c84sw6h"))))
> +
> +(define rust-bootstrap-i686-1.9.0
> +  (origin
> +   (method url-fetch)
> +   (uri
> +    "https://static.rust-lang.org/dist/2016-05-24/rustc-1.9.0-i686-unknown-linux-gnu.tar.gz")
> +   (sha256
> +    (base32
> +     "0fdf5xvh3g4hdza0y80w1r9vnfczjqnbzbvs7k878yc26p4dwl99"))))
> +
> +(define-public rust
> +  (package
> +   (name "rust")
> +   (version "1.10.0")
> +   (source (origin
> +            (method url-fetch)
> +            (uri (string-append "https://static.rust-lang.org/dist/rustc-"
> +                                version "-src.tar.gz"))
> +            (sha256
> +             (base32
> +              "0sb82xb8y2pzs8l1hk91z228bambwx3dmi2kj8isin7nyjn5l0d4"))))
> +   (build-system gnu-build-system)
> +   (native-inputs
> +    `(("curl" ,curl)
> +      ("gcc" ,gcc)
> +      ("gcc-lib" ,gcc "lib")
> +      ("jemalloc" ,jemalloc)
> +      ("patchelf" ,patchelf)
> +      ("perl" ,perl)
> +      ("python" ,python-2)
> +      ("rust-bootstrap"
> +       ,(if (string-match "x86_64"
> +                          (or (%current-target-system) (%current-system)))
> +            rust-bootstrap-x86_64-1.9.0
> +            rust-bootstrap-i686-1.9.0))
> +      ("which" ,which)))
> +   (arguments
> +    `(#:phases
> +      (modify-phases %standard-phases
> +        (add-after 'unpack 'unpack-bootstrap
> +                   (lambda* (#:key inputs #:allow-other-keys)
> +                     (with-directory-excursion (getcwd)
> +                       (zero? (system*
> +                               "tar"
> +                               "--strip-components=1"
> +                               "-xzf"
> +                               (assoc-ref inputs "rust-bootstrap"))))))
> +        (replace 'configure
> +                 (lambda* (#:key inputs outputs #:allow-other-keys)
> +                   (let ((out (assoc-ref outputs "out"))
> +                         (binutils (assoc-ref inputs "binutils"))
> +                         (gcc (assoc-ref inputs "gcc"))
> +                         (gcc-lib (assoc-ref inputs "gcc-lib"))
> +                         (jemalloc (assoc-ref inputs "jemalloc"))
> +                         (ld-so (string-append
> +                                 (assoc-ref inputs "libc")
> +                                 ,(glibc-dynamic-linker)))
> +                         (python (assoc-ref inputs "python")))
> +                     (setenv "SHELL" (which "sh"))
> +                     (setenv "CONFIG_SHELL" (which "sh"))
> +                     ;; Tell where to find libgcc_s.so
> +                     (setenv "LD_LIBRARY_PATH" (string-append gcc-lib "/lib"))
> +                     ;; Remove reference to "/lib64/ld-linux-x86-64.so.2" from binary
> +                     (zero? (system*
> +                             "patchelf"
> +                             "--set-interpreter" ld-so
> +                             "rustc/bin/rustc"))
> +                     (zero? (system*
> +                             "./configure"
> +                             (string-append "--prefix=" out)
> +                             (string-append "--default-linker=" gcc "/bin/gcc")
> +                             (string-append "--default-ar=" binutils "/bin/ar")
> +                             (string-append "--jemalloc-root=" jemalloc "/lib")
> +                             (string-append "--enable-rpath")
> +                             (string-append "--enable-local-rust")
> +                             (string-append "--local-rust-root=" (getcwd) "/rustc")
> +                             (string-append "--python=" python "/bin/python2")
> +                             "--disable-manage-submodules")))))
> +        (add-before 'build 'create-linker-wrapper
> +                    (lambda _
> +                      (let* ((bindir (string-append (getcwd) "/bin"))
> +                             (cc (string-append bindir "/cc")))
> +                        (mkdir bindir)
> +                        (call-with-output-file cc
> +                          (lambda (port)
> +                            (format port
> +                                    "#!~a\n\nexec gcc \"$@\"\n" (which "sh"))))
> +                        (chmod cc #o755))))
> +        (add-before 'build 'change-PATH
> +                    (lambda _
> +                      (setenv "PATH"
> +                              (string-append (getcwd)
> +                                             "/bin:"
> +                                             (getenv "PATH"))))))
> +      ;; Disable tests which can only be run from Git repository
> +      #:tests? #f))
> +   (synopsis "Compiler for the Rust progamming language")
> +   (description
> +    "Rust is a systems programming language that runs blazingly fast, prevents
> +segfaults, and guarantees thread safety.")
> +   (home-page "https://www.rust-lang.org")
> +   (license (list asl2.0 (x11-style "file://LICENSE-MIT")))))
> -- 
> 2.4.11
>

-- 
             ng0

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2] gnu: Add rust
  2016-09-13 18:29     ` ng0
@ 2016-09-13 18:45       ` ng0
  2016-09-13 19:11         ` ng0
  0 siblings, 1 reply; 10+ messages in thread
From: ng0 @ 2016-09-13 18:45 UTC (permalink / raw)
  To: Eric Le Bihan; +Cc: guix-devel

Disregard this, works now.

ng0 <ng0@we.make.ritual.n0.is> writes:

> Eric Le Bihan <eric.le.bihan.dev@free.fr> writes:
>
>> Hi!
>>
>> Le Tue, 13 Sep 2016 12:09:42 +0000,
>> ng0 <ng0@we.make.ritual.n0.is> a écrit :
>>
>>> I can not apply this patch with git am. Can you resend the patch as an
>>> appended file created with git format-patch or something similar, and
>>> not inlined?
>>
>> That's surprising: the patch was generated by `git format-patch` and
>> sent via `git send-email`. My mail client is Claws Mail and it allows
>> me to save the email I previously sent to a file in mbox format, which
>> applies without problem with `git am`.
>>
>> Anyway, please find it re-attached to this mail.
>
> Thanks, worked this time.
>
>> Best regards,
>
>
> I get this output, same like I had with what jelle ended up with my
> base, produced an equal first error at some point.
>
> Okay, i just realized there was a mistake in the patch i applied, I need
> to check it again, but I've got this before.. I don't know what's wrong
> here.
>
> substitute: updating list of substitutes from 'https://mirror.hydra.gnu.org'... 100.0%
> substitute: updating list of substitutes from 'https://mirror.hydra.gnu.org'... 100.0%
> process 16829 acquired build slot '/var/guix/offload/192.168.1.198/0'
> Cannot open display "default display"
> load on machine '192.168.1.198' is 0.0 (normalized: 0.0)
> @ build-started /gnu/store/qaf7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv - x86_64-linux /var/log/guix/drvs/qa//f7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv.bz2
> Cannot open display "default display"
> Cannot open display "default display"
> sending 2 store files to '192.168.1.198'...
> Cannot open display "default display"
> exporting path `/gnu/store/hpj2m538l2anjb6bwksxgbivjxz5gnzj-rust-stage0-2016-02-17-4d3eebf-linux-x86_64-d29b7607d13d64078b6324aec82926fb493f59ba.tar.bz2.drv'
> exporting path `/gnu/store/qaf7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv'
> offloading '/gnu/store/qaf7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv' to '192.168.1.198'...
> @ build-remote /gnu/store/qaf7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv 192.168.1.198
> Cannot open display "default display"
> substitute: updating list of substitutes from 'https://mirror.hydra.gnu.org'... 100.0%
> The following derivation will be built:
>    /gnu/store/qaf7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv
> @ build-started /gnu/store/qaf7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv - x86_64-linux /var/log/guix/drvs/qa//f7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv.bz2
> Backtrace:
> In ice-9/boot-9.scm:
>  157: 11 [catch #t #<catch-closure 8c9560> ...]
> In unknown file:
>    ?: 10 [apply-smob/1 #<catch-closure 8c9560>]
> In ice-9/boot-9.scm:
>   63: 9 [call-with-prompt prompt0 ...]
> In ice-9/eval.scm:
>  432: 8 [eval # #]
> In ice-9/boot-9.scm:
> 2401: 7 [save-module-excursion #<procedure 8e7880 at ice-9/boot-9.scm:4045:3 ()>]
> 4050: 6 [#<procedure 8e7880 at ice-9/boot-9.scm:4045:3 ()>]
> 1724: 5 [%start-stack load-stack #<procedure 8fa7c0 at ice-9/boot-9.scm:4041:10 ()>]
> 1729: 4 [#<procedure 8fdc60 ()>]
> In unknown file:
>    ?: 3 [primitive-load "/gnu/store/x5fjjgvzbrcibsv2zwqvsay5zc4916xx-rust-stage0-2016-02-17-4d3eebf-guile-builder"]
> In ice-9/eval.scm:
>  387: 2 [eval # ()]
>  411: 1 [eval # ()]
> In unknown file:
>    ?: 0 [string-append #f "/lib/ld-linux-x86-64.so.2"]
>
> ERROR: In procedure string-append:
> ERROR: In procedure string-append: Wrong type (expecting string): #f
> builder for `/gnu/store/qaf7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv' failed with exit code 1
> @ build-failed /gnu/store/qaf7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv - 1 builder for `/gnu/store/qaf7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv' failed with exit code 1
> guix build: error: build failed: build of `/gnu/store/qaf7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv' failed
> Cannot open display "default display"
> derivation '/gnu/store/qaf7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv' offloaded to '192.168.1.198' failed with exit code 1
> @ build-failed /gnu/store/qaf7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv - 1 builder for `/gnu/store/qaf7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv' failed with exit code 100
> cannot build derivation `/gnu/store/0jplgx6n7a8qc93h36cjwr0bxxcksrah-rust-1.8.0.drv': 1 dependencies couldn't be built
> guix build: error: build failed: build of `/gnu/store/0jplgx6n7a8qc93h36cjwr0bxxcksrah-rust-1.8.0.drv' failed
>
>
>
>> -- 
>> ELB
>> From 4f52b3f041e040d93a0a2f178d3b4a6e8f49df9f Mon Sep 17 00:00:00 2001
>> From: Eric Le Bihan <eric.le.bihan.dev@free.fr>
>> Date: Thu, 28 Jul 2016 20:09:01 +0200
>> Subject: [PATCH v2] gnu: Add rust
>>
>> * gnu/packages/rust.scm(rust): New variable.
>>
>> Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
>> ---
>>  gnu/packages/rust.scm | 143 ++++++++++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 143 insertions(+)
>>  create mode 100644 gnu/packages/rust.scm
>>
>> diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
>> new file mode 100644
>> index 0000000..7f2edb8
>> --- /dev/null
>> +++ b/gnu/packages/rust.scm
>> @@ -0,0 +1,143 @@
>> +;;; GNU Guix --- Functional package management for GNU
>> +;;; Copyright © 2016 Eric Le Bihan <eric.le.bihan.dev@free.fr>
>> +;;;
>> +;;; This file is part of GNU Guix.
>> +;;;
>> +;;; GNU Guix is free software; you can redistribute it and/or modify it
>> +;;; under the terms of the GNU General Public License as published by
>> +;;; the Free Software Foundation; either version 3 of the License, or (at
>> +;;; your option) any later version.
>> +;;;
>> +;;; GNU Guix is distributed in the hope that it will be useful, but
>> +;;; WITHOUT ANY WARRANTY; without even the implied warranty of
>> +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> +;;; GNU General Public License for more details.
>> +;;;
>> +;;; You should have received a copy of the GNU General Public License
>> +;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
>> +
>> +(define-module (gnu packages rust)
>> +  #:use-module (ice-9 regex)
>> +  #:use-module ((guix licenses) #:select (asl2.0 x11-style))
>> +  #:use-module (guix packages)
>> +  #:use-module (guix download)
>> +  #:use-module (guix build-system gnu)
>> +  #:use-module (gnu packages base)
>> +  #:use-module (gnu packages bootstrap)
>> +  #:use-module (gnu packages curl)
>> +  #:use-module (gnu packages elf)
>> +  #:use-module (gnu packages gcc)
>> +  #:use-module (gnu packages jemalloc)
>> +  #:use-module (gnu packages perl)
>> +  #:use-module (gnu packages python))
>> +
>> +(define rust-bootstrap-x86_64-1.9.0
>> +  (origin
>> +   (method url-fetch)
>> +   (uri
>> +    "https://static.rust-lang.org/dist/2016-05-24/rustc-1.9.0-x86_64-unknown-linux-gnu.tar.gz")
>> +   (sha256
>> +    (base32
>> +     "1i44rlvvn3pr81sli6bdbkzd78ar1ibybxx6mzpw6rkw4c84sw6h"))))
>> +
>> +(define rust-bootstrap-i686-1.9.0
>> +  (origin
>> +   (method url-fetch)
>> +   (uri
>> +    "https://static.rust-lang.org/dist/2016-05-24/rustc-1.9.0-i686-unknown-linux-gnu.tar.gz")
>> +   (sha256
>> +    (base32
>> +     "0fdf5xvh3g4hdza0y80w1r9vnfczjqnbzbvs7k878yc26p4dwl99"))))
>> +
>> +(define-public rust
>> +  (package
>> +   (name "rust")
>> +   (version "1.10.0")
>> +   (source (origin
>> +            (method url-fetch)
>> +            (uri (string-append "https://static.rust-lang.org/dist/rustc-"
>> +                                version "-src.tar.gz"))
>> +            (sha256
>> +             (base32
>> +              "0sb82xb8y2pzs8l1hk91z228bambwx3dmi2kj8isin7nyjn5l0d4"))))
>> +   (build-system gnu-build-system)
>> +   (native-inputs
>> +    `(("curl" ,curl)
>> +      ("gcc" ,gcc)
>> +      ("gcc-lib" ,gcc "lib")
>> +      ("jemalloc" ,jemalloc)
>> +      ("patchelf" ,patchelf)
>> +      ("perl" ,perl)
>> +      ("python" ,python-2)
>> +      ("rust-bootstrap"
>> +       ,(if (string-match "x86_64"
>> +                          (or (%current-target-system) (%current-system)))
>> +            rust-bootstrap-x86_64-1.9.0
>> +            rust-bootstrap-i686-1.9.0))
>> +      ("which" ,which)))
>> +   (arguments
>> +    `(#:phases
>> +      (modify-phases %standard-phases
>> +        (add-after 'unpack 'unpack-bootstrap
>> +                   (lambda* (#:key inputs #:allow-other-keys)
>> +                     (with-directory-excursion (getcwd)
>> +                       (zero? (system*
>> +                               "tar"
>> +                               "--strip-components=1"
>> +                               "-xzf"
>> +                               (assoc-ref inputs "rust-bootstrap"))))))
>> +        (replace 'configure
>> +                 (lambda* (#:key inputs outputs #:allow-other-keys)
>> +                   (let ((out (assoc-ref outputs "out"))
>> +                         (binutils (assoc-ref inputs "binutils"))
>> +                         (gcc (assoc-ref inputs "gcc"))
>> +                         (gcc-lib (assoc-ref inputs "gcc-lib"))
>> +                         (jemalloc (assoc-ref inputs "jemalloc"))
>> +                         (ld-so (string-append
>> +                                 (assoc-ref inputs "libc")
>> +                                 ,(glibc-dynamic-linker)))
>> +                         (python (assoc-ref inputs "python")))
>> +                     (setenv "SHELL" (which "sh"))
>> +                     (setenv "CONFIG_SHELL" (which "sh"))
>> +                     ;; Tell where to find libgcc_s.so
>> +                     (setenv "LD_LIBRARY_PATH" (string-append gcc-lib "/lib"))
>> +                     ;; Remove reference to "/lib64/ld-linux-x86-64.so.2" from binary
>> +                     (zero? (system*
>> +                             "patchelf"
>> +                             "--set-interpreter" ld-so
>> +                             "rustc/bin/rustc"))
>> +                     (zero? (system*
>> +                             "./configure"
>> +                             (string-append "--prefix=" out)
>> +                             (string-append "--default-linker=" gcc "/bin/gcc")
>> +                             (string-append "--default-ar=" binutils "/bin/ar")
>> +                             (string-append "--jemalloc-root=" jemalloc "/lib")
>> +                             (string-append "--enable-rpath")
>> +                             (string-append "--enable-local-rust")
>> +                             (string-append "--local-rust-root=" (getcwd) "/rustc")
>> +                             (string-append "--python=" python "/bin/python2")
>> +                             "--disable-manage-submodules")))))
>> +        (add-before 'build 'create-linker-wrapper
>> +                    (lambda _
>> +                      (let* ((bindir (string-append (getcwd) "/bin"))
>> +                             (cc (string-append bindir "/cc")))
>> +                        (mkdir bindir)
>> +                        (call-with-output-file cc
>> +                          (lambda (port)
>> +                            (format port
>> +                                    "#!~a\n\nexec gcc \"$@\"\n" (which "sh"))))
>> +                        (chmod cc #o755))))
>> +        (add-before 'build 'change-PATH
>> +                    (lambda _
>> +                      (setenv "PATH"
>> +                              (string-append (getcwd)
>> +                                             "/bin:"
>> +                                             (getenv "PATH"))))))
>> +      ;; Disable tests which can only be run from Git repository
>> +      #:tests? #f))
>> +   (synopsis "Compiler for the Rust progamming language")
>> +   (description
>> +    "Rust is a systems programming language that runs blazingly fast, prevents
>> +segfaults, and guarantees thread safety.")
>> +   (home-page "https://www.rust-lang.org")
>> +   (license (list asl2.0 (x11-style "file://LICENSE-MIT")))))
>> -- 
>> 2.4.11
>>
>
> -- 
>              ng0
>
>

-- 
             ng0

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2] gnu: Add rust
  2016-09-13 18:45       ` ng0
@ 2016-09-13 19:11         ` ng0
  0 siblings, 0 replies; 10+ messages in thread
From: ng0 @ 2016-09-13 19:11 UTC (permalink / raw)
  To: Eric Le Bihan; +Cc: guix-devel

This now fails differently after a good while of compiling.

llvm[1]: ***** Completed Release Build
make[1]: Leaving directory '/tmp/guix-build-rust-1.10.0.drv-0/rustc-1.10.0/x86_64-unknown-linux-gnu/llvm'
rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore
compile: x86_64-unknown-linux-gnu/rustllvm/ExecutionEngineWrapper.o
compile: x86_64-unknown-linux-gnu/rustllvm/RustWrapper.o
compile: x86_64-unknown-linux-gnu/rustllvm/PassWrapper.o
compile: x86_64-unknown-linux-gnu/rustllvm/ArchiveWrapper.o
link: x86_64-unknown-linux-gnu/rt/librustllvm.a
ar: `u' modifier ignored since `D' is the default (see `U')
src/libcore/lib.rs:69:12: 69:33 warning: unused or unknown feature, #[warn(unused_features)] on by default
src/libcore/lib.rs:69 #![feature(cfg_target_has_atomic)]
                                 ^~~~~~~~~~~~~~~~~~~~~
rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc
rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/librand
rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_unicode
rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_bitflags
rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc_system
rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind
rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc_jemalloc
rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc
rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcollections
rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_abort
rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind
rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd
rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libarena
rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libflate
rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgetopts
rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgraphviz
rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libterm
rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblog
rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libfmt_macros
rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_llvm
rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_platform_intrinsics
cp: x86_64-unknown-linux-gnu/stage1/lib/libstd
rustc: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libserialize
error: linking with `cc` failed: exit code: 1
note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/tmp/guix-build-rust-1.10.0.drv-0/rustc-1.10.0/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib" "x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/rustc_llvm-2f39a9bd.0.o" "-o" "x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_llvm-2f39a9bd.so" "x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/rustc_llvm-2f39a9bd.metadata.o" "-Wl,-O1" "-nodefaultlibs" "-L" "x86_64-unknown-linux-gnu/rt" "-L" "/tmp/guix-build-rust-1.10.0.drv-0/rustc-1.10.0/x86_64-unknown-linux-gnu/llvm/Release/lib" "-L" "/tmp/guix-build-rust-1.10.0.drv-0/rustc-1.10.0/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "-Wl,
 --whole-archive" "-l" "rustllvm" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMInterpreter" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMMCJIT" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMExecutionEngine" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMRuntimeDyld" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMipo" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMVectorize" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMLinker" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMIRReader" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMAsmParser" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMPowerPCDisassembler" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMPowerPCCodeGen" "-Wl,-
 -no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMPowerPCAsmParser" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMPowerPCDesc" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMPowerPCInfo" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMPowerPCAsmPrinter" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMMipsDisassembler" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMMipsCodeGen" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMMipsAsmParser" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMMipsDesc" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMMipsInfo" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMMipsAsmPrinter" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMAArch64Disassembler" "-Wl,--no-w
 hole-archive" "-Wl,--whole-archive" "-l" "LLVMAArch64CodeGen" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMAArch64AsmParser" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMAArch64Desc" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMAArch64Info" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMAArch64AsmPrinter" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMAArch64Utils" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMARMDisassembler" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMARMCodeGen" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMARMAsmParser" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMARMDesc" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMARMInfo" "-Wl,--no-whole-archive" "-W
 l,--whole-archive" "-l" "LLVMARMAsmPrinter" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMX86Disassembler" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMX86AsmParser" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMX86CodeGen" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMSelectionDAG" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMAsmPrinter" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMCodeGen" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMTarget" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMScalarOpts" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMInstCombine" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMInstrumentation" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLV
 MProfileData" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMTransformUtils" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMBitWriter" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMAnalysis" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMX86Desc" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMObject" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMMCParser" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMBitReader" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMMCDisassembler" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMX86Info" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMX86AsmPrinter" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMMC" "-Wl,--no-whole-archive" "-Wl,--whole-
 archive" "-l" "LLVMX86Utils" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMCore" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "-l" "LLVMSupport" "-Wl,--no-whole-archive" "-Wl,-Bdynamic" "-l" "pthread" "-l" "dl" "-l" "m" "-l" "stdc++" "-L" "/tmp/guix-build-rust-1.10.0.drv-0/rustc-1.10.0/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "std-2f39a9bd" "-l" "dl" "-l" "pthread" "-l" "gcc_s" "-l" "c" "-l" "m" "-l" "rt" "-l" "util" "-shared" "-Wl,-rpath,$ORIGIN/" "-Wl,-rpath,/usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,--enable-new-dtags" "-l" "compiler-rt"
note: ld: cannot find -lLLVMInterpreter
ld: cannot find -lLLVMMCJIT
ld: cannot find -lLLVMRuntimeDyld
ld: cannot find -lLLVMPowerPCDisassembler
ld: cannot find -lLLVMPowerPCCodeGen
ld: cannot find -lLLVMPowerPCAsmParser
ld: cannot find -lLLVMPowerPCDesc
ld: cannot find -lLLVMPowerPCInfo
ld: cannot find -lLLVMPowerPCAsmPrinter
ld: cannot find -lLLVMMipsDisassembler
ld: cannot find -lLLVMMipsCodeGen
ld: cannot find -lLLVMMipsAsmParser
ld: cannot find -lLLVMMipsDesc
ld: cannot find -lLLVMMipsInfo
ld: cannot find -lLLVMMipsAsmPrinter
ld: cannot find -lLLVMAArch64Disassembler
ld: cannot find -lLLVMAArch64CodeGen
ld: cannot find -lLLVMAArch64AsmParser
ld: cannot find -lLLVMAArch64Desc
ld: cannot find -lLLVMAArch64Info
ld: cannot find -lLLVMAArch64AsmPrinter
ld: cannot find -lLLVMAArch64Utils
ld: cannot find -lLLVMARMDisassembler
ld: cannot find -lLLVMARMCodeGen
ld: cannot find -lLLVMARMAsmParser
ld: cannot find -lLLVMARMDesc
ld: cannot find -lLLVMARMInfo
ld: cannot find -lLLVMARMAsmPrinter
ld: cannot find -lLLVMX86Disassembler
ld: cannot find -lLLVMX86AsmParser
ld: cannot find -lLLVMX86CodeGen
ld: cannot find -lLLVMSelectionDAG
ld: cannot find -lLLVMAsmPrinter
ld: cannot find -lLLVMX86Desc
ld: cannot find -lLLVMMCParser
ld: cannot find -lLLVMMCDisassembler
ld: cannot find -lLLVMX86Info
ld: cannot find -lLLVMX86AsmPrinter
ld: cannot find -lLLVMX86Utils
collect2: error: ld returned 1 exit status

error: aborting due to previous error
make: *** [/tmp/guix-build-rust-1.10.0.drv-0/rustc-1.10.0/mk/target.mk:216: x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/stamp.rustc_llvm] Error 101
make: *** Waiting for unfinished jobs....
phase `build' failed after 672.4 seconds
builder for `/gnu/store/c8acq3klhxjf50sb31wfbsg48v6rg2kj-rust-1.10.0.drv' failed with exit code 1
@ build-failed /gnu/store/c8acq3klhxjf50sb31wfbsg48v6rg2kj-rust-1.10.0.drv - 1 builder for `/gnu/store/c8acq3klhxjf50sb31wfbsg48v6rg2kj-rust-1.10.0.drv' failed with exit code 1
guix build: error: build failed: build of `/gnu/store/c8acq3klhxjf50sb31wfbsg48v6rg2kj-rust-1.10.0.drv' failed
Cannot open display "default display"
derivation '/gnu/store/c8acq3klhxjf50sb31wfbsg48v6rg2kj-rust-1.10.0.drv' offloaded to '192.168.1.198' failed with exit code 1
@ build-failed /gnu/store/c8acq3klhxjf50sb31wfbsg48v6rg2kj-rust-1.10.0.drv - 1 builder for `/gnu/store/c8acq3klhxjf50sb31wfbsg48v6rg2kj-rust-1.10.0.drv' failed with exit code 100
guix build: error: build failed: build of `/gnu/store/c8acq3klhxjf50sb31wfbsg48v6rg2kj-rust-1.10.0.drv' failed


ng0 <ng0@we.make.ritual.n0.is> writes:

> Disregard this, works now.
>
> ng0 <ng0@we.make.ritual.n0.is> writes:
>
>> Eric Le Bihan <eric.le.bihan.dev@free.fr> writes:
>>
>>> Hi!
>>>
>>> Le Tue, 13 Sep 2016 12:09:42 +0000,
>>> ng0 <ng0@we.make.ritual.n0.is> a écrit :
>>>
>>>> I can not apply this patch with git am. Can you resend the patch as an
>>>> appended file created with git format-patch or something similar, and
>>>> not inlined?
>>>
>>> That's surprising: the patch was generated by `git format-patch` and
>>> sent via `git send-email`. My mail client is Claws Mail and it allows
>>> me to save the email I previously sent to a file in mbox format, which
>>> applies without problem with `git am`.
>>>
>>> Anyway, please find it re-attached to this mail.
>>
>> Thanks, worked this time.
>>
>>> Best regards,
>>
>>
>> I get this output, same like I had with what jelle ended up with my
>> base, produced an equal first error at some point.
>>
>> Okay, i just realized there was a mistake in the patch i applied, I need
>> to check it again, but I've got this before.. I don't know what's wrong
>> here.
>>
>> substitute: updating list of substitutes from 'https://mirror.hydra.gnu.org'... 100.0%
>> substitute: updating list of substitutes from 'https://mirror.hydra.gnu.org'... 100.0%
>> process 16829 acquired build slot '/var/guix/offload/192.168.1.198/0'
>> Cannot open display "default display"
>> load on machine '192.168.1.198' is 0.0 (normalized: 0.0)
>> @ build-started /gnu/store/qaf7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv - x86_64-linux /var/log/guix/drvs/qa//f7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv.bz2
>> Cannot open display "default display"
>> Cannot open display "default display"
>> sending 2 store files to '192.168.1.198'...
>> Cannot open display "default display"
>> exporting path `/gnu/store/hpj2m538l2anjb6bwksxgbivjxz5gnzj-rust-stage0-2016-02-17-4d3eebf-linux-x86_64-d29b7607d13d64078b6324aec82926fb493f59ba.tar.bz2.drv'
>> exporting path `/gnu/store/qaf7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv'
>> offloading '/gnu/store/qaf7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv' to '192.168.1.198'...
>> @ build-remote /gnu/store/qaf7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv 192.168.1.198
>> Cannot open display "default display"
>> substitute: updating list of substitutes from 'https://mirror.hydra.gnu.org'... 100.0%
>> The following derivation will be built:
>>    /gnu/store/qaf7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv
>> @ build-started /gnu/store/qaf7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv - x86_64-linux /var/log/guix/drvs/qa//f7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv.bz2
>> Backtrace:
>> In ice-9/boot-9.scm:
>>  157: 11 [catch #t #<catch-closure 8c9560> ...]
>> In unknown file:
>>    ?: 10 [apply-smob/1 #<catch-closure 8c9560>]
>> In ice-9/boot-9.scm:
>>   63: 9 [call-with-prompt prompt0 ...]
>> In ice-9/eval.scm:
>>  432: 8 [eval # #]
>> In ice-9/boot-9.scm:
>> 2401: 7 [save-module-excursion #<procedure 8e7880 at ice-9/boot-9.scm:4045:3 ()>]
>> 4050: 6 [#<procedure 8e7880 at ice-9/boot-9.scm:4045:3 ()>]
>> 1724: 5 [%start-stack load-stack #<procedure 8fa7c0 at ice-9/boot-9.scm:4041:10 ()>]
>> 1729: 4 [#<procedure 8fdc60 ()>]
>> In unknown file:
>>    ?: 3 [primitive-load "/gnu/store/x5fjjgvzbrcibsv2zwqvsay5zc4916xx-rust-stage0-2016-02-17-4d3eebf-guile-builder"]
>> In ice-9/eval.scm:
>>  387: 2 [eval # ()]
>>  411: 1 [eval # ()]
>> In unknown file:
>>    ?: 0 [string-append #f "/lib/ld-linux-x86-64.so.2"]
>>
>> ERROR: In procedure string-append:
>> ERROR: In procedure string-append: Wrong type (expecting string): #f
>> builder for `/gnu/store/qaf7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv' failed with exit code 1
>> @ build-failed /gnu/store/qaf7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv - 1 builder for `/gnu/store/qaf7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv' failed with exit code 1
>> guix build: error: build failed: build of `/gnu/store/qaf7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv' failed
>> Cannot open display "default display"
>> derivation '/gnu/store/qaf7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv' offloaded to '192.168.1.198' failed with exit code 1
>> @ build-failed /gnu/store/qaf7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv - 1 builder for `/gnu/store/qaf7fvpw6z8h6ck5ia9ignik8r6bsm0d-rust-stage0-2016-02-17-4d3eebf.drv' failed with exit code 100
>> cannot build derivation `/gnu/store/0jplgx6n7a8qc93h36cjwr0bxxcksrah-rust-1.8.0.drv': 1 dependencies couldn't be built
>> guix build: error: build failed: build of `/gnu/store/0jplgx6n7a8qc93h36cjwr0bxxcksrah-rust-1.8.0.drv' failed
>>
>>
>>
>>> -- 
>>> ELB
>>> From 4f52b3f041e040d93a0a2f178d3b4a6e8f49df9f Mon Sep 17 00:00:00 2001
>>> From: Eric Le Bihan <eric.le.bihan.dev@free.fr>
>>> Date: Thu, 28 Jul 2016 20:09:01 +0200
>>> Subject: [PATCH v2] gnu: Add rust
>>>
>>> * gnu/packages/rust.scm(rust): New variable.
>>>
>>> Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
>>> ---
>>>  gnu/packages/rust.scm | 143 ++++++++++++++++++++++++++++++++++++++++++++++++++
>>>  1 file changed, 143 insertions(+)
>>>  create mode 100644 gnu/packages/rust.scm
>>>
>>> diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
>>> new file mode 100644
>>> index 0000000..7f2edb8
>>> --- /dev/null
>>> +++ b/gnu/packages/rust.scm
>>> @@ -0,0 +1,143 @@
>>> +;;; GNU Guix --- Functional package management for GNU
>>> +;;; Copyright © 2016 Eric Le Bihan <eric.le.bihan.dev@free.fr>
>>> +;;;
>>> +;;; This file is part of GNU Guix.
>>> +;;;
>>> +;;; GNU Guix is free software; you can redistribute it and/or modify it
>>> +;;; under the terms of the GNU General Public License as published by
>>> +;;; the Free Software Foundation; either version 3 of the License, or (at
>>> +;;; your option) any later version.
>>> +;;;
>>> +;;; GNU Guix is distributed in the hope that it will be useful, but
>>> +;;; WITHOUT ANY WARRANTY; without even the implied warranty of
>>> +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>>> +;;; GNU General Public License for more details.
>>> +;;;
>>> +;;; You should have received a copy of the GNU General Public License
>>> +;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
>>> +
>>> +(define-module (gnu packages rust)
>>> +  #:use-module (ice-9 regex)
>>> +  #:use-module ((guix licenses) #:select (asl2.0 x11-style))
>>> +  #:use-module (guix packages)
>>> +  #:use-module (guix download)
>>> +  #:use-module (guix build-system gnu)
>>> +  #:use-module (gnu packages base)
>>> +  #:use-module (gnu packages bootstrap)
>>> +  #:use-module (gnu packages curl)
>>> +  #:use-module (gnu packages elf)
>>> +  #:use-module (gnu packages gcc)
>>> +  #:use-module (gnu packages jemalloc)
>>> +  #:use-module (gnu packages perl)
>>> +  #:use-module (gnu packages python))
>>> +
>>> +(define rust-bootstrap-x86_64-1.9.0
>>> +  (origin
>>> +   (method url-fetch)
>>> +   (uri
>>> +    "https://static.rust-lang.org/dist/2016-05-24/rustc-1.9.0-x86_64-unknown-linux-gnu.tar.gz")
>>> +   (sha256
>>> +    (base32
>>> +     "1i44rlvvn3pr81sli6bdbkzd78ar1ibybxx6mzpw6rkw4c84sw6h"))))
>>> +
>>> +(define rust-bootstrap-i686-1.9.0
>>> +  (origin
>>> +   (method url-fetch)
>>> +   (uri
>>> +    "https://static.rust-lang.org/dist/2016-05-24/rustc-1.9.0-i686-unknown-linux-gnu.tar.gz")
>>> +   (sha256
>>> +    (base32
>>> +     "0fdf5xvh3g4hdza0y80w1r9vnfczjqnbzbvs7k878yc26p4dwl99"))))
>>> +
>>> +(define-public rust
>>> +  (package
>>> +   (name "rust")
>>> +   (version "1.10.0")
>>> +   (source (origin
>>> +            (method url-fetch)
>>> +            (uri (string-append "https://static.rust-lang.org/dist/rustc-"
>>> +                                version "-src.tar.gz"))
>>> +            (sha256
>>> +             (base32
>>> +              "0sb82xb8y2pzs8l1hk91z228bambwx3dmi2kj8isin7nyjn5l0d4"))))
>>> +   (build-system gnu-build-system)
>>> +   (native-inputs
>>> +    `(("curl" ,curl)
>>> +      ("gcc" ,gcc)
>>> +      ("gcc-lib" ,gcc "lib")
>>> +      ("jemalloc" ,jemalloc)
>>> +      ("patchelf" ,patchelf)
>>> +      ("perl" ,perl)
>>> +      ("python" ,python-2)
>>> +      ("rust-bootstrap"
>>> +       ,(if (string-match "x86_64"
>>> +                          (or (%current-target-system) (%current-system)))
>>> +            rust-bootstrap-x86_64-1.9.0
>>> +            rust-bootstrap-i686-1.9.0))
>>> +      ("which" ,which)))
>>> +   (arguments
>>> +    `(#:phases
>>> +      (modify-phases %standard-phases
>>> +        (add-after 'unpack 'unpack-bootstrap
>>> +                   (lambda* (#:key inputs #:allow-other-keys)
>>> +                     (with-directory-excursion (getcwd)
>>> +                       (zero? (system*
>>> +                               "tar"
>>> +                               "--strip-components=1"
>>> +                               "-xzf"
>>> +                               (assoc-ref inputs "rust-bootstrap"))))))
>>> +        (replace 'configure
>>> +                 (lambda* (#:key inputs outputs #:allow-other-keys)
>>> +                   (let ((out (assoc-ref outputs "out"))
>>> +                         (binutils (assoc-ref inputs "binutils"))
>>> +                         (gcc (assoc-ref inputs "gcc"))
>>> +                         (gcc-lib (assoc-ref inputs "gcc-lib"))
>>> +                         (jemalloc (assoc-ref inputs "jemalloc"))
>>> +                         (ld-so (string-append
>>> +                                 (assoc-ref inputs "libc")
>>> +                                 ,(glibc-dynamic-linker)))
>>> +                         (python (assoc-ref inputs "python")))
>>> +                     (setenv "SHELL" (which "sh"))
>>> +                     (setenv "CONFIG_SHELL" (which "sh"))
>>> +                     ;; Tell where to find libgcc_s.so
>>> +                     (setenv "LD_LIBRARY_PATH" (string-append gcc-lib "/lib"))
>>> +                     ;; Remove reference to "/lib64/ld-linux-x86-64.so.2" from binary
>>> +                     (zero? (system*
>>> +                             "patchelf"
>>> +                             "--set-interpreter" ld-so
>>> +                             "rustc/bin/rustc"))
>>> +                     (zero? (system*
>>> +                             "./configure"
>>> +                             (string-append "--prefix=" out)
>>> +                             (string-append "--default-linker=" gcc "/bin/gcc")
>>> +                             (string-append "--default-ar=" binutils "/bin/ar")
>>> +                             (string-append "--jemalloc-root=" jemalloc "/lib")
>>> +                             (string-append "--enable-rpath")
>>> +                             (string-append "--enable-local-rust")
>>> +                             (string-append "--local-rust-root=" (getcwd) "/rustc")
>>> +                             (string-append "--python=" python "/bin/python2")
>>> +                             "--disable-manage-submodules")))))
>>> +        (add-before 'build 'create-linker-wrapper
>>> +                    (lambda _
>>> +                      (let* ((bindir (string-append (getcwd) "/bin"))
>>> +                             (cc (string-append bindir "/cc")))
>>> +                        (mkdir bindir)
>>> +                        (call-with-output-file cc
>>> +                          (lambda (port)
>>> +                            (format port
>>> +                                    "#!~a\n\nexec gcc \"$@\"\n" (which "sh"))))
>>> +                        (chmod cc #o755))))
>>> +        (add-before 'build 'change-PATH
>>> +                    (lambda _
>>> +                      (setenv "PATH"
>>> +                              (string-append (getcwd)
>>> +                                             "/bin:"
>>> +                                             (getenv "PATH"))))))
>>> +      ;; Disable tests which can only be run from Git repository
>>> +      #:tests? #f))
>>> +   (synopsis "Compiler for the Rust progamming language")
>>> +   (description
>>> +    "Rust is a systems programming language that runs blazingly fast, prevents
>>> +segfaults, and guarantees thread safety.")
>>> +   (home-page "https://www.rust-lang.org")
>>> +   (license (list asl2.0 (x11-style "file://LICENSE-MIT")))))
>>> -- 
>>> 2.4.11
>>>
>>
>> -- 
>>              ng0
>>
>>
>
> -- 
>              ng0
>
>

-- 
              ng0

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-09-13 19:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-07  5:57 [PATCH v2] gnu: Add rust Eric Le Bihan
2016-09-07  8:48 ` David Craven
2016-09-13 11:55   ` [PATCH v2] gnu: Add rust (sidenotes on rust) ng0
2016-09-13 12:19     ` ng0
2016-09-13 12:28       ` David Craven
2016-09-13 12:09 ` [PATCH v2] gnu: Add rust ng0
2016-09-13 17:20   ` Eric Le Bihan
2016-09-13 18:29     ` ng0
2016-09-13 18:45       ` ng0
2016-09-13 19:11         ` ng0

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).