unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Jelle Licht <jlicht@fsfe.org>
To: Nils Gillmann <niasterisk@grrlz.net>
Cc: guix-devel@gnu.org
Subject: Re: rust work in progress conflicts (was: Re: LLVM: "FileCheck" is missing)
Date: Wed, 04 May 2016 12:34:34 +0200	[thread overview]
Message-ID: <87oa8mt8lh.fsf@gmail.com> (raw)
In-Reply-To: <87k2kq6wma.fsf@grrlz.net>


I have taken the liberty to try my hand at finishing this, as I figured
it would be a good way for me to get more familiar with 'the Guix way'
of packaging things.

Wow, did I misjudge this rabbit hole though. It seems to be the case that
rust needs the (most recent) snapshotted binary stage-0 compiler as part
of the build process. This was not the case some years ago[1], but since
then, some 319 snapshots have been released.

Now there are two approaches which might make sense to me:

1) We package a recent stage-0 binary (thus adding yet another random
binary to the mix)

2) We bootstrap all the way from the original rust compiler, written in
ocaml. This would then presumably need to be repeated for each snapshot,
leading to about 319 iterative compiler build. On my kind-of-okay i7,
compiling a single rust iteration takes about 25 to 40 minutes.

I tentatively went with option 1, if only because I would like to see
results this decade still, and ran into several hurdles that became
quite manageable with help from the good people of #guix and
#rust-internals. One more issue yet remains: part of the rust
compilation process actually calls the 'cc linker'. This part does not
respect make flags, setenv calls or even rust's special configure flag
for setting cc.

Option 1 does not seem feasible at this point of time, but there is some
light at the end of the tunnel: rust is at some point going to follow a
convention that will allow bootstrapping compilers via 'master from
beta, beta from stable and stable from previous stable'[2].

I am currently thinking of a compromise; basically, at this moment go
for option 1, and once the policy previously described is properly
implemented by the rust team, start iteratively bootstrapping rust from
that point in time.


tldr: If we can get 'cc' in the build environment, we can have a 'dirty'
bootstrapped rust very soon. If we want to do it properly, it might take
a lot longer.  

WDYT?

[1]: https://news.ycombinator.com/item?id=8732669
[2]: https://botbot.me/mozilla/rust-internals/2016-04-29/?page=3, look
for eddyb

Nils Gillmann <niasterisk@grrlz.net> writes:

> Here is my work in progress rust.scm, it is on pause until the
> next release of rust as mentioned before:
>
>
> ~/projects/guix_project/guix/gnu/packages $ cat rust.scm
> ;;; GNU Guix --- Functional package management for GNU
> ;;; Copyright © 2016 Nils Gillmann <niasterisk@grrlz.net>
> ;;;
> ;;; 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 ((guix licenses) #:prefix license:)
>   #:use-module (guix packages)
>   #:use-module (guix download)
>   #:use-module (guix git-download)
>   #:use-module (guix utils)
>   #:use-module (guix build-system gnu)
>   ;; #:use-module (gnu packages gcc)
>   #:use-module (gnu packages perl)
>   #:use-module (gnu packages libffi)
>   #:use-module (gnu packages valgrind)
>   #:use-module (gnu packages version-control)
>   #:use-module (gnu packages curl)
>   #:use-module (gnu packages python)
>   #:use-module (gnu packages llvm))
>
> ;;(list
> ;; (string-append
> ;; "https://github.com/rust-lang/rust/archive/"
> ;; version ".tar.gz")
> ;;gh "1m2d1dc243s7ym8fq2yag3fr5jvki0q9c39llfwgcpq1gc8jvcn8"))))
>
> (define-public rustc
>   (package
>     (name "rustc")
>     (version "1.7.0")
>     (source (origin
>               (method url-fetch)
>               (uri (string-append
>                     "https://static.rust-lang.org/dist/" name "-"
>                     version "-src.tar.gz"))
>               (file-name (string-append name "-" version ".tar.gz"))
>               (sha256
>                (base32
>                 "0fpiggrnvdmmnp6b95ik16v1h972wir9d1ydv5v8cwbvv1cn1ybd"))))
>     (build-system gnu-build-system)
>     (arguments
>      `(#:phases
>        (alist-replace
>         'configure
>         (lambda* (#:key outputs #:allow-other-keys)
>           ;; This old `configure' script doesn't support
>           ;; variables passed as arguments.
>           (let ((out (assoc-ref outputs "out"))
>                 (llvm (assoc-ref %build-inputs "llvm")))
>             (setenv "CONFIG_SHELL" (which "bash"))
>             (zero?
>              (system* "./configure"
>                       (string-append "--prefix=" out)
>                       (string-append "--llvm-root=" llvm)))))
>         %standard-phases)))
>        ;; #:configure-flags
>        ;; (list
>        ;;  (string-append "--llvm-root="
>        ;;                 (assoc-ref %build-inputs "llvm")))))
>     (inputs
>      `(("python-2" ,python-2)
>        ("curl" ,curl)
>        ("git" ,git)
>        ("valgrind" ,valgrind)
>        ("libffi" ,libffi)
>        ("perl" ,perl)
>        ("llvm" ,llvm)))
>     (home-page "https://www.rust-lang.org/")
>     (synopsis
>      "The Rust Programming Language")
>     (description
>      "LOREM IPSUM BLA")
>     (license license:gpl3+)))

  reply	other threads:[~2016-05-04 10:35 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-25 17:45 LLVM: "FileCheck" is missing Danny Milosavljevic
2016-03-25 21:58 ` Nils Gillmann
2016-03-25 22:06 ` rust work in progress conflicts (was: Re: LLVM: "FileCheck" is missing) Nils Gillmann
2016-05-04 10:34   ` Jelle Licht [this message]
2016-05-05 13:35     ` rust work in progress conflicts Ludovic Courtès
2016-05-05 14:46       ` Alex Griffin
2016-05-06  9:05         ` Andy Wingo
2016-05-06  9:15           ` Andy Wingo
2016-05-06  9:59         ` Ludovic Courtès
2016-05-05 15:06     ` ng0
2016-07-28  8:28       ` ng0
2016-07-28 18:31         ` Eric Le Bihan
2016-07-29  9:03           ` Andreas Enge
2016-07-29 11:40             ` Vincent Legoll
2016-07-29 14:37               ` ng0
2016-07-30 10:04             ` Eric Le Bihan
2016-07-29 15:16           ` Rust Ludovic Courtès
2016-07-29 15:34             ` Rust Alex Griffin
2016-07-29 16:08               ` Rust Jelle Licht
2016-07-30 13:34               ` Rust Ludovic Courtès
2016-07-30 17:57                 ` Rust Pjotr Prins
2016-07-30 11:01             ` Rust Eric Le Bihan
2016-07-30 13:44               ` Rust Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87oa8mt8lh.fsf@gmail.com \
    --to=jlicht@fsfe.org \
    --cc=guix-devel@gnu.org \
    --cc=niasterisk@grrlz.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).