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

Reply via email to