GNU bug report logs - #28433
[WIP] Rust update

Previous Next

Package: guix-patches;

Reported by: Danny Milosavljevic <dannym <at> scratchpost.org>

Date: Tue, 12 Sep 2017 16:51:01 UTC

Severity: normal

Tags: moreinfo

Done: Danny Milosavljevic <dannym <at> scratchpost.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 28433 in the body.
You can then email your comments to 28433 AT debbugs.gnu.org in the normal way.

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

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


Report forwarded to guix-patches <at> gnu.org:
bug#28433; Package guix-patches. (Tue, 12 Sep 2017 16:51:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Danny Milosavljevic <dannym <at> scratchpost.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 12 Sep 2017 16:51:01 GMT) Full text and rfc822 format available.

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

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: <guix-patches <at> gnu.org>
Subject: [WIP] Rust update
Date: Tue, 12 Sep 2017 18:50:23 +0200
I'm trying to update our Rust.  I've got it to work further than the text "package bootstrap" once, but I can't find how I did it anymore.  See below.

Help?

diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index 652686e06..a0d4554d6 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -25,6 +25,7 @@
   #:use-module (gnu packages bootstrap)
   #:use-module (gnu packages cmake)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages cross-base)
   #:use-module (gnu packages curl)
   #:use-module (gnu packages elf)
   #:use-module (gnu packages flex)
@@ -47,7 +48,7 @@
   #:use-module (srfi srfi-26))
 
 ;; Should be one less than the current released version.
-(define %rust-bootstrap-binaries-version "1.15.0")
+(define %rust-bootstrap-binaries-version "1.17.0")
 
 (define %rust-bootstrap-binaries
   (origin
@@ -58,7 +59,7 @@
           "-i686-unknown-linux-gnu.tar.gz"))
     (sha256
      (base32
-      "0wmkfx8pxmkkw021mrq9s3xhra8f0daqdl6j56pxyn4w39i0rzrw"))))
+      "1svbg96gjkfk40hgyhgkm5mqxlx24943xf1423p3gfhqyvh6rl9r"))))
 
 (define (increment-rust-version rust-version major patch)
   (match (string-split rust-version #\.)
@@ -208,7 +209,7 @@ rustc-bootstrap and cargo-bootstrap packages.")
                     "rustc-" version "-src.tar.gz"))
               (sha256
                (base32
-                "1d78jq7mc34n265by68amr9r4nzbiqrilfbwh7gx56ydn4gb6rpr"))
+                "04b1qd4zy9x0hax0rxzd0gg6nki37kjdvk9bid46j8lykglkdp6j"))
             (modules '((guix build utils)))
             (snippet
              `(begin
@@ -222,16 +223,26 @@ rustc-bootstrap and cargo-bootstrap packages.")
        ("git" ,git)
        ("procps" ,procps) ; For the tests
        ("python-2" ,python-2)
+       ("cargo-bootstrap" ,cargo-bootstrap)
        ("rust-bootstrap" ,rust-bootstrap)
-       ("which" ,which)))
+       ("which" ,which)
+       ("strace" ,strace)
+       ("cross-gcc" ,(cross-gcc "i686-linux-gnu"
+                      #:xbinutils (cross-binutils "i686-linux-gnu")
+                      #:libc (cross-libc "i686-linux-gnu")))
+       ("cross-libc" ,(cross-libc "i686-linux-gnu"))))
     (inputs
      `(("jemalloc" ,jemalloc)
        ("llvm" ,llvm-3.9.1)))
     (arguments
      `(#:phases
        (modify-phases %standard-phases
+         ;; Avoid cargo complaining about mismatched checksums.
+         (delete 'patch-source-shebangs)
+         (delete 'patch-generated-file-shebangs)
+         (delete 'patch-usr-bin-file)
          (add-after 'unpack 'patch-configure
-           (lambda _
+           (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "configure"
                (("/usr/bin/env") (which "env")) ; Detect target CPU correctly.
                (("probe_need CFG_CURL curl") "") ; Avoid curl build dependency.
@@ -247,14 +258,46 @@ rustc-bootstrap and cargo-bootstrap packages.")
              (substitute* "src/tools/compiletest/src/util.rs"
                (("(\"amd64\", \"x86_64\"),") "(\"amd64\", \"x86_64\"),
 (\"nvptx\", \"nvptx\"),")) ; Make LLVM >= 3.8.1 work.
-             (substitute* "mk/main.mk"
-               (("LLVM_OPTIONAL_COMPONENTS=")
-                "LLVM_OPTIONAL_COMPONENTS=nvptx ")) ; Make LLVM >= 3.8.1 work.
+             ;(system* "mv" "src/bootstrap/config.toml.example"
+             ;              "src/bootstrap/config.toml")
+             (mkdir-p "src/bootstrap/.cargo")
+             (call-with-output-file "src/bootstrap/.cargo/config"
+                 (lambda (p)
+                   (format p "
+[source.crates-io]
+registry = 'https://github.com/rust-lang/crates.io-index'
+replace-with = 'vendored-sources'
+
+[source.vendored-sources]
+directory = 'src/vendor'
+
+[target.i686-linux-gnu]
+linker = \"~a/bin/i686-linux-gnu-gcc\"
+
+" (assoc-ref inputs "cross-gcc"))))
+
              #t))
          (add-after 'unpack 'set-env
            (lambda _
+             (define (cross? x)
+               (string-contains x "cross-"))
              (setenv "SHELL" (which "sh"))
              (setenv "CONFIG_SHELL" (which "sh"))
+             (setenv "VERBOSE" "1")
+             (setenv "CROSS_C_INCLUDE_PATH" (getenv "C_INCLUDE_PATH"))
+             (setenv "CROSS_CPLUS_INCLUDE_PATH" (getenv "CPLUS_INCLUDE_PATH"))
+             (setenv "CROSS_LIBRARY_PATH" (getenv "LIBRARY_PATH"))
+             (for-each
+              (lambda (env-name)
+                (let* ((env-value (getenv env-name))
+                       (search-path (search-path-as-string->list env-value))
+                       (new-search-path (filter (lambda (e) (not (cross? e)))
+                                                search-path))
+                       (new-env-value (list->search-path-as-string
+                                       new-search-path ":")))
+                  (setenv env-name new-env-value)))
+              '("C_INCLUDE_PATH" "CPLUS_INCLUDE_PATH" "LIBRARY_PATH"))
+
              #t))
          (add-after 'unpack 'patch-tests
            (lambda* (#:key inputs #:allow-other-keys)
@@ -284,6 +327,7 @@ fn test_process_mask"))
                     (rustc (assoc-ref inputs "rustc-bootstrap"))
                     (llvm (assoc-ref inputs "llvm"))
                     (jemalloc (assoc-ref inputs "jemalloc"))
+                    ;; TODO make bootstrapper use i686 libraries! (-lutil, -ldl, ...).
                     (flags (list
                             (string-append "--prefix=" out)
                             (string-append "--datadir=" out "/share")
@@ -291,16 +335,43 @@ fn test_process_mask"))
                             (string-append "--default-linker=" gcc "/bin/gcc")
                             (string-append "--default-ar=" binutils "/bin/ar")
                             (string-append "--python=" python "/bin/python2")
+                            ; FIXME /gnu/store/6rri0kxb9q1gz6lv1dgdwjh41aa9ijdl-rustc-bootstrap-1.17.0/bin/cargo is wrong.
                             (string-append "--local-rust-root=" rustc)
                             (string-append "--llvm-root=" llvm)
                             (string-append "--jemalloc-root=" jemalloc "/lib")
                             "--release-channel=stable"
                             "--enable-rpath"
                             "--enable-local-rust"
-                            "--disable-rustbuild" ; rustbuild doesn't work yet.
                             "--disable-manage-submodules")))
+               (mkdir "Xcargo")
+               (call-with-output-file "Xcargo/config"
+                 (lambda (p)
+                   (format p "
+[source.crates-io]
+registry = 'https://github.com/rust-lang/crates.io-index'
+replace-with = 'vendored-sources'
+
+[source.vendored-sources]
+directory = 'src/vendor'
+
+[target.i686-linux-gnu]
+linker = \"~a/bin/i686-linux-gnu-gcc\"
+
+" (assoc-ref inputs "cross-gcc"))))
+               (setenv "CARGO_HOME" (string-append (getcwd) "/Xcargo"))
+               (substitute* "src/bootstrap/bootstrap.py"
+                 (("/etc/NIXOS")
+                  (getcwd))
+                 (("config [+] '/bin/cargo'")
+                  (string-append "'" (assoc-ref inputs "cargo-bootstrap")
+                                 "/bin/cargo'"))
+                 (("cargo[(][)], \"build\"") "cargo(), \"build\", \"--verbose\""))
                ;; Rust uses a custom configure script (no autoconf).
-               (zero? (apply system* "./configure" flags)))))
+               (let ((status (zero? (apply system* (which "sh") "./configure" flags))))
+                (substitute* "Makefile"
+                 (("[$][(]Q[)][$][(]BOOTSTRAP[)] build [$][(]BOOTSTRAP_ARGS[)]")
+                  "$(Q)$(BOOTSTRAP) build $(BOOTSTRAP_ARGS)"))
+                status))))
          (add-after 'install 'wrap-rustc
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (let ((out (assoc-ref outputs "out"))




Information forwarded to guix-patches <at> gnu.org:
bug#28433; Package guix-patches. (Wed, 25 Oct 2017 14:21:01 GMT) Full text and rfc822 format available.

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

From: Ricardo Wurmus <rekado <at> elephly.net>
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: 28433 <at> debbugs.gnu.org
Subject: Re: [bug#28433] [WIP] Rust update
Date: Wed, 25 Oct 2017 16:19:45 +0200
Danny Milosavljevic <dannym <at> scratchpost.org> writes:

> I'm trying to update our Rust.  I've got it to work further than the
> text "package bootstrap" once, but I can't find how I did it anymore.
> See below.
>
> Help?

Could you tell us what you’ve tried and what the error means?

--
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net






Added tag(s) moreinfo. Request was from Ricardo Wurmus <rekado <at> elephly.net> to control <at> debbugs.gnu.org. (Wed, 25 Oct 2017 14:36:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#28433; Package guix-patches. (Thu, 26 Oct 2017 08:18:01 GMT) Full text and rfc822 format available.

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

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: Ricardo Wurmus <rekado <at> elephly.net>
Cc: 28433 <at> debbugs.gnu.org
Subject: Re: [bug#28433] [WIP] Rust update
Date: Thu, 26 Oct 2017 10:17:28 +0200
Hi,

Rust as I posted it fails with the text below.  It tries to compile and link rustc via bootstrap rustc and gcc, via a i686 compiler (also on x86_64).  What the error message means is that it is only picking up the x86_64 glibc - and not the i686 glibc - even though the "cc" command line contains "-m32".  I've even added a custom linker command to the rust config (also in the patch) but that doesn't help either - apparently that setting is not even picked up.  Maybe that's the reason... 

Rust has support for Nix somewhat, and I've enabled it in the bootstrapper.  I've also added cross-libc for i686 and fixed up environment variables (in a hacky way - maybe that's the reason).

So I guess my actual question is how to do this cross compilation correctly.  Note that the rust bootstrap compiler are binaries from upstream.  (There's a project "mrust" <https://github.com/thepowersgang/mrustc> that is a reimplementation of Rust in C++ that we could use in the long term in order to remove this binary)

----------------------------------------------------------
     Running `/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq-rustc-bootstrap-1.17.0/bin/rustc --crate-name rustdoc src/bootstrap/bin/rustdoc.rs --crate-type bin --emit=dep-info,link -C 
debug-assertions=off -C metadata=83218ce7652a40a2 -C extra-filename=-83218ce7652a40a2 --out-dir /tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps -L depe
ndency=/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps --extern rustc_serialize=/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/deb
ug/deps/librustc_serialize-5c8c719f8cb442df.rlib --extern getopts=/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/libgetopts-781edef4d7eacd14.rlib --ex
tern gcc=/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/libgcc-3c79a13fa356000a.rlib --extern libc=/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src
/build/bootstrap/debug/deps/liblibc-1ece201356dd0812.rlib --extern toml=/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/libtoml-3495572d91ba2dfe.rlib -
-extern num_cpus=/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/libnum_cpus-d81d39a56ecc4645.rlib --extern build_helper=/tmp/guix-build-rustc-1.18.0.d
rv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/libbuild_helper-d1189496287db707.rlib --extern filetime=/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/libfiletime-1fba24aeada37bf3.rlib --extern cmake=/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/libcmake-4feacbf6844c5e86.rlib --extern bootstrap=/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/libbootstrap-3ebfecab87ea2884.rlib`
error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m32" "-L" "/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq-rustc-bootstrap-1.17.0/lib/rustlib/i686-unknown-linux-gnu/lib" "/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/rustdoc-83218ce7652a40a2.0.o" "-o" "/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/rustdoc-83218ce7652a40a2" "-Wl,--gc-sections" "-pie" "-nodefaultlibs" "-L" "/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps" "-L" "/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq-rustc-bootstrap-1.17.0/lib/rustlib/i686-unknown-linux-gnu/lib" "-Wl,-Bstatic" "-Wl,-Bdynamic" "/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/libbootstrap-3ebfecab87ea2884.rlib" "/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/libtoml-3495572d91ba2dfe.rlib" "/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/librustc_serialize-5c8
 c719f8cb442df.rlib" "/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/libnum_cpus-d81d39a56ecc4645.rlib" "/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/libcmake-4feacbf6844c5e86.rlib" "/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/libgcc-3c79a13fa356000a.rlib" "/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/libbuild_helper-d1189496287db707.rlib" "/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/libfiletime-1fba24aeada37bf3.rlib" "/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/liblibc-1ece201356dd0812.rlib" "/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/libgetopts-781edef4d7eacd14.rlib" "/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq-rustc-bootstrap-1.17.0/lib/rustlib/i686-unknown-linux-gnu/lib/libstd-f4594d3e53dcb114.rlib" "/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq
 -rustc-bootstrap-1.17.0/lib/rustlib/i686-unknown-linux-gnu/lib/libpanic_unwind-a0157c0ca919c364.rlib" "/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq-rustc-bootstrap-1.17.0/lib/rustlib/i686-unknown-linux-gnu/lib/libunwind-488b4ab4bd53a138.rlib" "/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq-rustc-bootstrap-1.17.0/lib/rustlib/i686-unknown-linux-gnu/lib/librand-1efbcfd8938372b6.rlib" "/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq-rustc-bootstrap-1.17.0/lib/rustlib/i686-unknown-linux-gnu/lib/libcollections-532a3dbf317eff86.rlib" "/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq-rustc-bootstrap-1.17.0/lib/rustlib/i686-unknown-linux-gnu/lib/liballoc-ca07b617414dd0fa.rlib" "/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq-rustc-bootstrap-1.17.0/lib/rustlib/i686-unknown-linux-gnu/lib/liballoc_jemalloc-492d8ea7fa3384ff.rlib" "/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq-rustc-bootstrap-1.17.0/lib/rustlib/i686-unknown-linux-gnu/lib/liblibc-88c194c15fdb6521.rlib" "/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq-ru
 stc-bootstrap-1.17.0/lib/rustlib/i686-unknown-linux-gnu/lib/libstd_unicode-cfbd6648f7db2ee5.rlib" "/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq-rustc-bootstrap-1.17.0/lib/rustlib/i686-unknown-linux-gnu/lib/libcore-687e6a964d22cbb4.rlib" "/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq-rustc-bootstrap-1.17.0/lib/rustlib/i686-unknown-linux-gnu/lib/libcompiler_builtins-987729be881d4d32.rlib" "-l" "util" "-l" "dl" "-l" "rt" "-l" "pthread" "-l" "gcc_s" "-l" "pthread" "-l" "c" "-l" "m" "-l" "rt" "-l" "util"

  = note: ld: skipping incompatible /gnu/store/n6nvxlk2j8ysffjh3jphn1k5silnakh6-glibc-2.25/lib/libutil.so when searching for -lutil
          ld: skipping incompatible /gnu/store/n6nvxlk2j8ysffjh3jphn1k5silnakh6-glibc-2.25/lib/libutil.a when searching for -lutil
          ld: skipping incompatible /gnu/store/n6nvxlk2j8ysffjh3jphn1k5silnakh6-glibc-2.25/lib/libutil.so when searching for -lutil
          ld: skipping incompatible /gnu/store/n6nvxlk2j8ysffjh3jphn1k5silnakh6-glibc-2.25/lib/libutil.a when searching for -lutil
          ld: cannot find -lutil
          ld: skipping incompatible /gnu/store/n6nvxlk2j8ysffjh3jphn1k5silnakh6-glibc-2.25/lib/libdl.so when searching for -ldl
          ld: skipping incompatible /gnu/store/n6nvxlk2j8ysffjh3jphn1k5silnakh6-glibc-2.25/lib/libdl.a when searching for -ldl
          ld: skipping incompatible /gnu/store/n6nvxlk2j8ysffjh3jphn1k5silnakh6-glibc-2.25/lib/libdl.so when searching for -ldl
          ld: skipping incompatible /gnu/store/n6nvxlk2j8ysffjh3jphn1k5silnakh6-glibc-2.25/lib/libdl.a when searching for -ldl
          ld: cannot find -ldl
          ld: skipping incompatible /gnu/store/n6nvxlk2j8ysffjh3jphn1k5silnakh6-glibc-2.25/lib/librt.so when searching for -lrt
          ld: skipping incompatible /gnu/store/n6nvxlk2j8ysffjh3jphn1k5silnakh6-glibc-2.25/lib/librt.a when searching for -lrt
          ld: skipping incompatible /gnu/store/n6nvxlk2j8ysffjh3jphn1k5silnakh6-glibc-2.25/lib/librt.so when searching for -lrt
          ld: skipping incompatible /gnu/store/n6nvxlk2j8ysffjh3jphn1k5silnakh6-glibc-2.25/lib/librt.a when searching for -lrt
          ld: cannot find -lrt
          ld: skipping incompatible /gnu/store/n6nvxlk2j8ysffjh3jphn1k5silnakh6-glibc-2.25/lib/libpthread.so when searching for -lpthread
          ld: skipping incompatible /gnu/store/n6nvxlk2j8ysffjh3jphn1k5silnakh6-glibc-2.25/lib/libpthread.a when searching for -lpthread
          ld: skipping incompatible /gnu/store/n6nvxlk2j8ysffjh3jphn1k5silnakh6-glibc-2.25/lib/libpthread.so when searching for -lpthread
          ld: skipping incompatible /gnu/store/n6nvxlk2j8ysffjh3jphn1k5silnakh6-glibc-2.25/lib/libpthread.a when searching for -lpthread
          ld: cannot find -lpthread
          ld: skipping incompatible /gnu/store/3x53yv4v144c9xp02rs64z7j597kkqax-gcc-5.4.0-lib/lib/gcc/x86_64-unknown-linux-gnu/5.4.0/../../../libgcc_s.so when searching for -lgcc_s
          ld: cannot find -lgcc_s
----------------------------------------------------------





Information forwarded to guix-patches <at> gnu.org:
bug#28433; Package guix-patches. (Sat, 28 Oct 2017 10:44:01 GMT) Full text and rfc822 format available.

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

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: Ricardo Wurmus <rekado <at> elephly.net>
Cc: 28433 <at> debbugs.gnu.org
Subject: Re: [bug#28433] [WIP] Rust update
Date: Sat, 28 Oct 2017 12:42:58 +0200
Aha!  I digged some more and found that rust-bootstrap doesn't specify #:system "i686-linux", while rustc-bootstrap does.

Symptom:

$ guix environment --pure rustc
[env]$ ls -l /gnu/store/15hcgm941wgxfk08w0wrwpd9p7wjbq87-profile/bin/cc
lrwxrwxrwx 2 root root 72 Jan  1  1970 /gnu/store/15hcgm941wgxfk08w0wrwpd9p7wjbq87-profile/bin/cc -> /gnu/store/a3gr3imzn6nqzs9q1ql0pilr0dnbpps4-rust-bootstrap-1.15.0/bin/cc
[env]$ file /gnu/store/a3gr3imzn6nqzs9q1ql0pilr0dnbpps4-rust-bootstrap-1.15.0/bin/cc
/gnu/store/a3gr3imzn6nqzs9q1ql0pilr0dnbpps4-rust-bootstrap-1.15.0/bin/cc: symbolic link to /gnu/store/8yxpqz65fgvcab60ypih009xv777ni66-gcc-5.4.0/bin/gcc
[env]$ file /gnu/store/8yxpqz65fgvcab60ypih009xv777ni66-gcc-5.4.0/bin/gcc
/gnu/store/8yxpqz65fgvcab60ypih009xv777ni66-gcc-5.4.0/bin/gcc: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /gnu/store/3h31zsqxjjg52da5gp3qmhkh4x8klhah-glibc-2.25/lib/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, not stripped, with debug_info

Note "x86-64".

On the other hand:

[env]$ file -L /gnu/store/15hcgm941wgxfk08w0wrwpd9p7wjbq87-profile/bin/rustc
/gnu/store/15hcgm941wgxfk08w0wrwpd9p7wjbq87-profile/bin/rustc: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /gnu/store/kzkgc8avgnanrv3ab2g3g8yj7l4bcavj-glibc-2.25/lib/ld-linux.so.2, for GNU/Linux 2.6.9, not stripped, with debug_info

[env]$ file -L /gnu/store/kzkgc8avgnanrv3ab2g3g8yj7l4bcavj-glibc-2.25/lib/ld-linux.so.2
/gnu/store/kzkgc8avgnanrv3ab2g3g8yj7l4bcavj-glibc-2.25/lib/ld-linux.so.2: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped, with debug_info

Note "32-bit", "80386".

But when I change rust-bootstrap to specify #:system "i686-linux", then I get:

  |
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m32" "-L" "/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq-rustc-bootstrap-1.17.0/lib/rustlib/i686-unknown-linux-gnu/lib" "/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/rustc-f53d5ba9fb00bcc2.0.o" "-o" "/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/rustc-f53d5ba9fb00bcc2" "-Wl,--gc-sections" "-pie" "-nodefaultlibs" "-L" "/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps" "-L" "/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq-rustc-bootstrap-1.17.0/lib/rustlib/i686-unknown-linux-gnu/lib" "-Wl,-Bstatic" "-Wl,-Bdynamic" "/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/libbootstrap-3ebfecab87ea2884.rlib" "/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/libtoml-3495572d91ba2dfe.rlib" "/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/librustc_serialize-5c8c719
 f8cb442df.rlib" "/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/libnum_cpus-d81d39a56ecc4645.rlib" "/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/libcmake-4feacbf6844c5e86.rlib" "/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/libgcc-3c79a13fa356000a.rlib" "/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/libbuild_helper-d1189496287db707.rlib" "/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/libfiletime-1fba24aeada37bf3.rlib" "/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/liblibc-1ece201356dd0812.rlib" "/tmp/guix-build-rustc-1.18.0.drv-0/rustc-1.18.0-src/build/bootstrap/debug/deps/libgetopts-781edef4d7eacd14.rlib" "/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq-rustc-bootstrap-1.17.0/lib/rustlib/i686-unknown-linux-gnu/lib/libstd-f4594d3e53dcb114.rlib" "/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq-rus
 tc-bootstrap-1.17.0/lib/rustlib/i686-unknown-linux-gnu/lib/libpanic_unwind-a0157c0ca919c364.rlib" "/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq-rustc-bootstrap-1.17.0/lib/rustlib/i686-unknown-linux-gnu/lib/libunwind-488b4ab4bd53a138.rlib" "/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq-rustc-bootstrap-1.17.0/lib/rustlib/i686-unknown-linux-gnu/lib/librand-1efbcfd8938372b6.rlib" "/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq-rustc-bootstrap-1.17.0/lib/rustlib/i686-unknown-linux-gnu/lib/libcollections-532a3dbf317eff86.rlib" "/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq-rustc-bootstrap-1.17.0/lib/rustlib/i686-unknown-linux-gnu/lib/liballoc-ca07b617414dd0fa.rlib" "/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq-rustc-bootstrap-1.17.0/lib/rustlib/i686-unknown-linux-gnu/lib/liballoc_jemalloc-492d8ea7fa3384ff.rlib" "/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq-rustc-bootstrap-1.17.0/lib/rustlib/i686-unknown-linux-gnu/lib/liblibc-88c194c15fdb6521.rlib" "/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq-rustc-
 bootstrap-1.17.0/lib/rustlib/i686-unknown-linux-gnu/lib/libstd_unicode-cfbd6648f7db2ee5.rlib" "/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq-rustc-bootstrap-1.17.0/lib/rustlib/i686-unknown-linux-gnu/lib/libcore-687e6a964d22cbb4.rlib" "/gnu/store/zmcc9gizicl91qvpcnl7ric2klnqhsdq-rustc-bootstrap-1.17.0/lib/rustlib/i686-unknown-linux-gnu/lib/libcompiler_builtins-987729be881d4d32.rlib" "-l" "util" "-l" "dl" "-l" "rt" "-l" "pthread" "-l" "gcc_s" "-l" "pthread" "-l" "c" "-l" "m" "-l" "rt" "-l" "util"
  = note: ld: /gnu/store/w8swvn15kqzzl3q5d0d9zjnhg5pk9ksw-gcc-5.4.0/libexec/gcc/i686-unknown-linux-gnu/5.4.0/liblto_plugin.so: error loading plugin: /gnu/store/w8swvn15kqzzl3q5d0d9zjnhg5pk9ksw-gcc-5.4.0/libexec/gcc/i686-unknown-linux-gnu/5.4.0/liblto_plugin.so: wrong ELF class: ELFCLASS32




Information forwarded to guix-patches <at> gnu.org:
bug#28433; Package guix-patches. (Sat, 28 Oct 2017 11:33:02 GMT) Full text and rfc822 format available.

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

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: Ricardo Wurmus <rekado <at> elephly.net>
Cc: 28433 <at> debbugs.gnu.org
Subject: Re: [bug#28433] [WIP] Rust update
Date: Sat, 28 Oct 2017 13:31:57 +0200
And gcc picks up ld from PATH, which is a x86_64 ld.  Bad.




Information forwarded to guix-patches <at> gnu.org:
bug#28433; Package guix-patches. (Sat, 28 Oct 2017 11:58:01 GMT) Full text and rfc822 format available.

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

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: Ricardo Wurmus <rekado <at> elephly.net>
Cc: 28433 <at> debbugs.gnu.org
Subject: Re: [bug#28433] [WIP] Rust update
Date: Sat, 28 Oct 2017 13:57:26 +0200
Do we support lib32 a la "gcc -m32" ? How can we provide a working glibc for that? It seems that rustc bootstrap is trying to use that option.




Information forwarded to guix-patches <at> gnu.org:
bug#28433; Package guix-patches. (Sat, 28 Oct 2017 15:37:02 GMT) Full text and rfc822 format available.

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

From: ng0 <ng0 <at> infotropique.org>
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: Ricardo Wurmus <rekado <at> elephly.net>, 28433 <at> debbugs.gnu.org
Subject: Re: [bug#28433] [WIP] Rust update
Date: Sat, 28 Oct 2017 15:36:23 +0000
[Message part 1 (text/plain, inline)]
Danny Milosavljevic transcribed 8.7K bytes:
> Hi,
…
> So I guess my actual question is how to do this cross compilation correctly.
Note that the rust bootstrap compiler are binaries from upstream.
(There's a project "mrust" <https://github.com/thepowersgang/mrustc>
that is a reimplementation of Rust in C++ that we could use in the long
term in order to remove this binary)

In the long term this would be nice. It was my first idea when
I learned about this project, but as you can read in the
bug I opened in the last 2(?) months in the mrustc bugtracker
it still requires rustc to work.
-- 
ng0
GnuPG: A88C8ADD129828D7EAC02E52E22F9BBFEE348588
GnuPG: https://dist.ng0.infotropique.org/dist/keys/
https://www.infotropique.org https://ng0.infotropique.org
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#28433; Package guix-patches. (Sat, 28 Oct 2017 18:27:02 GMT) Full text and rfc822 format available.

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

From: ludo <at> gnu.org (Ludovic Courtès)
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: Ricardo Wurmus <rekado <at> elephly.net>, 28433 <at> debbugs.gnu.org
Subject: Re: [bug#28433] [WIP] Rust update
Date: Sat, 28 Oct 2017 20:26:39 +0200
Hi,

Danny Milosavljevic <dannym <at> scratchpost.org> skribis:

> Do we support lib32 a la "gcc -m32" ? How can we provide a working glibc for that? It seems that rustc bootstrap is trying to use that option.

We don’t support multilib, so glibc provides only 64-bit headers on
x86_64 (if you try -m32 there you’ll get an error about missing
<gnu/stubs-32.h> or something like that.)

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#28433; Package guix-patches. (Sat, 28 Oct 2017 18:33:01 GMT) Full text and rfc822 format available.

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

From: ludo <at> gnu.org (Ludovic Courtès)
To: ng0 <ng0 <at> infotropique.org>
Cc: Ricardo Wurmus <rekado <at> elephly.net>,
 Danny Milosavljevic <dannym <at> scratchpost.org>, 28433 <at> debbugs.gnu.org
Subject: Re: [bug#28433] [WIP] Rust update
Date: Sat, 28 Oct 2017 20:32:31 +0200
ng0 <ng0 <at> infotropique.org> skribis:

> (There's a project "mrust" <https://github.com/thepowersgang/mrustc>
> that is a reimplementation of Rust in C++ that we could use in the long
> term in order to remove this binary)

At GPCE I also talked with someone who implements a compiler for a
Rust-like language (Rust with some extensions, minus a few features, so
not directly usable but might be worth keeping in mind):

  https://github.com/AnyDSL/traversal

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#28433; Package guix-patches. (Mon, 30 Oct 2017 11:36:02 GMT) Full text and rfc822 format available.

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

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: ludo <at> gnu.org (Ludovic Courtès)
Cc: Ricardo Wurmus <rekado <at> elephly.net>, 28433 <at> debbugs.gnu.org
Subject: Re: [bug#28433] [WIP] Rust update
Date: Mon, 30 Oct 2017 12:35:01 +0100
On Sat, 28 Oct 2017 20:26:39 +0200
ludo <at> gnu.org (Ludovic Courtès) wrote:

> Danny Milosavljevic <dannym <at> scratchpost.org> skribis:
> 
> > Do we support lib32 a la "gcc -m32" ? How can we provide a working glibc for that? It seems that rustc bootstrap is trying to use that option.  
> 
> We don’t support multilib, so glibc provides only 64-bit headers on
> x86_64 (if you try -m32 there you’ll get an error about missing
> <gnu/stubs-32.h> or something like that.)

Yeah.

What happens when I use an i686 host/target gcc and use "-m32" (rustbuild does that)? Will it just ignore the option?




Information forwarded to guix-patches <at> gnu.org:
bug#28433; Package guix-patches. (Mon, 30 Oct 2017 15:39:02 GMT) Full text and rfc822 format available.

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

From: ludo <at> gnu.org (Ludovic Courtès)
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: Ricardo Wurmus <rekado <at> elephly.net>, 28433 <at> debbugs.gnu.org
Subject: Re: [bug#28433] [WIP] Rust update
Date: Mon, 30 Oct 2017 16:38:02 +0100
Danny Milosavljevic <dannym <at> scratchpost.org> skribis:

> On Sat, 28 Oct 2017 20:26:39 +0200
> ludo <at> gnu.org (Ludovic Courtès) wrote:
>
>> Danny Milosavljevic <dannym <at> scratchpost.org> skribis:
>> 
>> > Do we support lib32 a la "gcc -m32" ? How can we provide a working glibc for that? It seems that rustc bootstrap is trying to use that option.  
>> 
>> We don’t support multilib, so glibc provides only 64-bit headers on
>> x86_64 (if you try -m32 there you’ll get an error about missing
>> <gnu/stubs-32.h> or something like that.)
>
> Yeah.
>
> What happens when I use an i686 host/target gcc and use "-m32" (rustbuild does that)? Will it just ignore the option?

Yes, I think -m32 is a no-op in this case.

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#28433; Package guix-patches. (Mon, 30 Oct 2017 16:15:02 GMT) Full text and rfc822 format available.

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

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: ludo <at> gnu.org (Ludovic Courtès)
Cc: Ricardo Wurmus <rekado <at> elephly.net>, 28433 <at> debbugs.gnu.org
Subject: Re: [bug#28433] [WIP] Rust update
Date: Mon, 30 Oct 2017 17:14:15 +0100
Hi Ludo,

> Yes, I think -m32 is a no-op in this case.

Yep.  I just got rustc to build a bootstrap executable (which fails when executing it [*], but hey, progress) by making a union-build with all the i686 libs.

Feels kinda icky, but it seems that propagated-inputs don't remember the #:system it was for, so for example if A propagates B and A specifies system i686, and X specifies system x86_64 and X depends on A, then X's B will be x86_64.  Weird but understandable I guess...

Details:

A:
  propagated-inputs
    B
  arguments system i686

X:
  native-inputs
    A
  arguments system x86_64

Now X's B is x86_64...

The workaround is this:

A:
  arguments system i686
  native-inputs
    B
  union-build out/lib from B (etc)

X:
  native-inputs
    A
  arguments system x86_64

That works.

In our specific case A = "rust-bootstrap", X = "rustc", B = "glibc", "gcc:lib" etc.

[*] Tries to load libgcc_s.so.1 from the glibc store directory.  WTF?




Information forwarded to guix-patches <at> gnu.org:
bug#28433; Package guix-patches. (Mon, 30 Oct 2017 19:19:01 GMT) Full text and rfc822 format available.

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

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: 28433 <at> debbugs.gnu.org
Subject: [WIP] v2 Rust update
Date: Mon, 30 Oct 2017 20:18:20 +0100
[Message part 1 (text/plain, inline)]
New patch (relative to master) attached.  Result:

...
   Compiling bootstrap v0.0.0 (file:///tmp/guix-build-rustc-1.21.0.drv-0/rustc-1.21.0-src/src/bootstrap)
...
     Running `/gnu/store/vqqyfd20cci8ngffx8ip30xj1zghj3d3-rustc-bootstrap-1.20.0/bin/rustc --crate-name rustdoc src/bootstrap/bin/rustdoc.rs --crate-type bin --emit=dep-info,link -C debug-assertions=off -C overflow-checks=on -C metadata=be82d62669cb1c84 -C extra-filename=-be82d62669cb1c84 --out-dir /tmp/guix-build-rustc-1.21.0.drv-0/rustc-1.21.0-src/build/bootstrap/debug/deps -L dependency=/tmp/guix-build-rustc-1.21.0.drv-0/rustc-1.21.0-src/build/bootstrap/debug/deps --extern serde=/tmp/guix-build-rustc-1.21.0.drv-0/rustc-1.21.0-src/build/bootstrap/debug/deps/libserde-632d9b22ceaaf392.rlib --extern getopts=/tmp/guix-build-rustc-1.21.0.drv-0/rustc-1.21.0-src/build/bootstrap/debug/deps/libgetopts-3bd92ee3d46aec42.rlib --extern filetime=/tmp/guix-build-rustc-1.21.0.drv-0/rustc-1.21.0-src/build/bootstrap/debug/deps/libfiletime-c92abda52111c8f6.rlib --extern lazy_static=/tmp/guix-build-rustc-1.21.0.drv-0/rustc-1.21.0-src/build/bootstrap/debug/deps/liblazy_static-2aedc8916caa605d.rlib --ex
 tern cmake=/tmp/guix-build-rustc-1.21.0.drv-0/rustc-1.21.0-src/build/bootstrap/debug/deps/libcmake-cb4e4459aab5227f.rlib --extern build_helper=/tmp/guix-build-rustc-1.21.0.drv-0/rustc-1.21.0-src/build/bootstrap/debug/deps/libbuild_helper-a3d8a479aaa255b5.rlib --extern toml=/tmp/guix-build-rustc-1.21.0.drv-0/rustc-1.21.0-src/build/bootstrap/debug/deps/libtoml-9a87f4f0395599e4.rlib --extern gcc=/tmp/guix-build-rustc-1.21.0.drv-0/rustc-1.21.0-src/build/bootstrap/debug/deps/libgcc-f472059c4232400f.rlib --extern serde_derive=/tmp/guix-build-rustc-1.21.0.drv-0/rustc-1.21.0-src/build/bootstrap/debug/deps/libserde_derive-46fcba9d518ff59d.so --extern serde_json=/tmp/guix-build-rustc-1.21.0.drv-0/rustc-1.21.0-src/build/bootstrap/debug/deps/libserde_json-d578450b81b0fe32.rlib --extern num_cpus=/tmp/guix-build-rustc-1.21.0.drv-0/rustc-1.21.0-src/build/bootstrap/debug/deps/libnum_cpus-c524032e97e252a3.rlib --extern libc=/tmp/guix-build-rustc-1.21.0.drv-0/rustc-1.21.0-src/build/bootstrap/debug/de
 ps/liblibc-785194da5730896d.rlib --extern bootstrap=/tmp/guix-build-rustc-1.21.0.drv-0/rustc-1.21.0-src/build/bootstrap/debug/deps/libbootstrap-5489136beef8bcf0.rlib`
    Finished dev [unoptimized] target(s) in 95.84 secs
running: /tmp/guix-build-rustc-1.21.0.drv-0/rustc-1.21.0-src/build/bootstrap/debug/bootstrap build -v
/tmp/guix-build-rustc-1.21.0.drv-0/rustc-1.21.0-src/build/bootstrap/debug/bootstrap: error while loading shared libraries: libgcc_s.so.1: cannot open shared object file: No such file or directory
Traceback (most recent call last):
  File "/tmp/guix-build-rustc-1.21.0.drv-0/rustc-1.21.0-src/src/bootstrap/bootstrap.py", line 816, in <module>
    main()
  File "/tmp/guix-build-rustc-1.21.0.drv-0/rustc-1.21.0-src/src/bootstrap/bootstrap.py", line 799, in main
    bootstrap()
  File "/tmp/guix-build-rustc-1.21.0.drv-0/rustc-1.21.0-src/src/bootstrap/bootstrap.py", line 790, in bootstrap
    run(args, env=env, verbose=build.verbose)
  File "/tmp/guix-build-rustc-1.21.0.drv-0/rustc-1.21.0-src/src/bootstrap/bootstrap.py", line 148, in run
    raise RuntimeError(err)
RuntimeError: failed to run: /tmp/guix-build-rustc-1.21.0.drv-0/rustc-1.21.0-src/build/bootstrap/debug/bootstrap build -v
make: *** [Makefile:24: all] Error 1
phase `build' failed after 96.3 seconds
[RUST (application/octet-stream, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#28433; Package guix-patches. (Tue, 28 Nov 2017 06:36:01 GMT) Full text and rfc822 format available.

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

From: ng0 <ng0 <at> n0.is>
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: Ricardo Wurmus <rekado <at> elephly.net>,
 Ludovic Courtès <ludo <at> gnu.org>, 28433 <at> debbugs.gnu.org
Subject: Re: [bug#28433] [WIP] Rust update
Date: Tue, 28 Nov 2017 06:35:17 +0000
[Message part 1 (text/plain, inline)]
Hey Danny,

what's missing here? rustc has been released as 1.22.1 since this thread
started. I hope to introduce some people in January at our GNUnet
workshop to the open tasks on the Guix rust-build-system and - depending
on how they judge their own abilities - get them to work on this throughout
the year.

Danny Milosavljevic transcribed 0.9K bytes:
> Hi Ludo,
> 
> > Yes, I think -m32 is a no-op in this case.
> 
> Yep.  I just got rustc to build a bootstrap executable (which fails when executing it [*], but hey, progress) by making a union-build with all the i686 libs.
> 
> Feels kinda icky, but it seems that propagated-inputs don't remember the #:system it was for, so for example if A propagates B and A specifies system i686, and X specifies system x86_64 and X depends on A, then X's B will be x86_64.  Weird but understandable I guess...
> 
> Details:
> 
> A:
>   propagated-inputs
>     B
>   arguments system i686
> 
> X:
>   native-inputs
>     A
>   arguments system x86_64
> 
> Now X's B is x86_64...
> 
> The workaround is this:
> 
> A:
>   arguments system i686
>   native-inputs
>     B
>   union-build out/lib from B (etc)
> 
> X:
>   native-inputs
>     A
>   arguments system x86_64
> 
> That works.
> 
> In our specific case A = "rust-bootstrap", X = "rustc", B = "glibc", "gcc:lib" etc.
> 
> [*] Tries to load libgcc_s.so.1 from the glibc store directory.  WTF?
> 
> 
> 
> 

-- 
GnuPG: A88C8ADD129828D7EAC02E52E22F9BBFEE348588
GnuPG: https://c.n0.is/ng0_pubkeys/tree/keys
  WWW: https://n0.is
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#28433; Package guix-patches. (Tue, 28 Nov 2017 10:13:02 GMT) Full text and rfc822 format available.

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

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: ng0 <ng0 <at> n0.is>
Cc: Ricardo Wurmus <rekado <at> elephly.net>,
 Ludovic Courtès <ludo <at> gnu.org>, 28433 <at> debbugs.gnu.org
Subject: Re: [bug#28433] [WIP] Rust update
Date: Tue, 28 Nov 2017 11:12:08 +0100
[Message part 1 (text/plain, inline)]
Hi ng0,

I've attached the current version of gnu/packages/rust.scm .

For some reason, Rust bootstrap ignores the environment variable AR_x86_64_unknown_linux_gnu even though it doesn't ignore other similar variables (CC_x86_64_unknown_linux_gnu etc).  It also ignored config.toml's [target.x86_64-unknown-linux-gnu].  Therefore, the bootstrapping fails when trying to compile the x86_64 version (the i686 version works).

To try it, copy the attached file to gnu/packages/rust.scm , overwriting the latter file.

Then just invoke

$ ./pre-inst-env guix build rustc

It will fail like explained above, with the log message:

------------------------------------------------------------------------------------------------------
running: /tmp/guix-build-rustc-1.22.0.drv-0/rustc-1.22.0-src/build/bootstrap/debug/bootstrap build -v
finding compilers
CC_x86_64-unknown-linux-gnu = "/gnu/store/5sv5zy2kgg6iaqyv8zw49w4243j0xkd0-gcc-5.4.0/bin/gcc"
AR_x86_64-unknown-linux-gnu = "/gnu/store/5sv5zy2kgg6iaqyv8zw49w4243j0xkd0-gcc-5.4.0/bin/ar"
CC_x86_64-unknown-linux-gnu = "/gnu/store/5sv5zy2kgg6iaqyv8zw49w4243j0xkd0-gcc-5.4.0/bin/gcc"
AR_x86_64-unknown-linux-gnu = "/gnu/store/5sv5zy2kgg6iaqyv8zw49w4243j0xkd0-gcc-5.4.0/bin/ar"
CC_x86_64-unknown-linux-gnu = "/gnu/store/5sv5zy2kgg6iaqyv8zw49w4243j0xkd0-gcc-5.4.0/bin/gcc"
AR_x86_64-unknown-linux-gnu = "/gnu/store/5sv5zy2kgg6iaqyv8zw49w4243j0xkd0-gcc-5.4.0/bin/ar"
CXX_x86_64-unknown-linux-gnu = "/gnu/store/5sv5zy2kgg6iaqyv8zw49w4243j0xkd0-gcc-5.4.0/bin/g++"
CXX_x86_64-unknown-linux-gnu = "/gnu/store/5sv5zy2kgg6iaqyv8zw49w4243j0xkd0-gcc-5.4.0/bin/g++"
running sanity check
thread 'main' panicked at '

couldn't find required command: "/gnu/store/5sv5zy2kgg6iaqyv8zw49w4243j0xkd0-gcc-5.4.0/bin/ar"
------------------------------------------------------------------------------------------------------

I've had something similar before - see CFG_LOCAL_RUST_ROOT substitution in rust.scm - but I thought I fixed it.

So the next step would have someone find out why it doesn't pick up the value from the environment variable "AR_x86_64_unknown_linux_gnu".
[rust.scm (text/x-scheme, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#28433; Package guix-patches. (Wed, 29 Nov 2017 08:05:02 GMT) Full text and rfc822 format available.

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

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: ng0 <ng0 <at> n0.is>
Cc: Ricardo Wurmus <rekado <at> elephly.net>,
 Ludovic Courtès <ludo <at> gnu.org>, 28433 <at> debbugs.gnu.org
Subject: Re: [bug#28433] [WIP] Rust update
Date: Wed, 29 Nov 2017 09:04:31 +0100
[Message part 1 (text/plain, inline)]
New version attached...

Rust's libbacktrace now picks up the x86_64 gcc but then that uses the i686 ld.
[rust.scm (text/x-scheme, attachment)]

bug closed, send any further explanations to 28433 <at> debbugs.gnu.org and Danny Milosavljevic <dannym <at> scratchpost.org> Request was from Danny Milosavljevic <dannym <at> scratchpost.org> to control <at> debbugs.gnu.org. (Sat, 23 Dec 2017 22:19:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 21 Jan 2018 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 90 days ago.

Previous Next


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