Received: from magnesium.8pit.net (magnesium.8pit.net [45.76.88.171]) by nld3-dev1.alpinelinux.org (Postfix) with ESMTPS id B9CF4780ECF for <~alpine/devel@lists.alpinelinux.org>; Sun, 21 Nov 2021 09:07:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=opensmtpd; bh=UAI+RNPY9Z Tms+lFcIH1HcqTmU0rHxBH3bZCjwMvds0=; h=in-reply-to:references:from: subject:to:date; d=soeren-tempel.net; b=tBr/Xtokb8Z2ti1FI26uwsZ06Ck2DJ f+5rSoXecN5e49cyZeZmTgaM8jTExLmuLC7m8EToqdBIbDLaB+QojEC7ErZTcYMLvGN5WE cvOVCKBUmQ7gPac5wmai2SRcvGlZETeTUjR/3Aq9T235s4ANkSnMQyl+cPi0l/qmFxcWjB 8= Received: from localhost (ip5f5ae01d.dynamic.kabel-deutschland.de [95.90.224.29]) by magnesium.8pit.net (OpenSMTPD) with ESMTPSA id e0272f2d (TLSv1.3:AEAD-AES256-GCM-SHA384:256:YES) for <~alpine/devel@lists.alpinelinux.org>; Sun, 21 Nov 2021 10:07:35 +0100 (CET) Date: Sun, 21 Nov 2021 10:07:31 +0100 To: ~alpine/devel@lists.alpinelinux.org Subject: Re: Thoughts on self-hosting compilers in Alpine From: =?UTF-8?Q?S=C3=B6ren?= Tempel References: <33KG0XO61I4IL.2Z7RTAZ5J3SY6@8pit.net> <9c3ab565-3489-62e4-c15e-a7af3c2ef569@dereferenced.org> <2DGGIA6U0PY5D.3SO8BVCBQLL47@8pit.net> In-Reply-To: Message-Id: <2K3ZE76KZAQVW.2L66DX1M6N9IZ@8pit.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Ariadne Conill wrote: > Hi, Hi, > On Sat, 20 Nov 2021, S=C3=B6ren Tempel wrote: > Yes, but we need to do it regardless. I don't think this proposal really= =20 > solves that problem. I think this depends on a case-by-case basis on the specifics of the self-hosted compiler. So, for example, for the Cyclone Scheme compiler, there is no overhead involved in re-bootstrapping from the stage0. As such, I believe it to be easier (i.e. less work) to re-bootstrap from stage0 instead of adding versioned packages for the dynamic libraries on which it depends. Same thing with Go if we were to be using gcc-go as a stage0. > For Rust, this would mean that stage0 has to be current version minus=20 > one. That means to produce stage0, we would have to: >=20 > * Compile rust 1.29 with mrustc. > * Compile rust 1.30 with the rust 1.29, 1.31 with 1.30, so on, up to 1.54= =2E >=20 > This would literally take days of CPU time, even on our fastest builders.= To me, this more of an argument against the current Rust bootstrapping process rather than argument against my proposal. If Rust always needs the most recent compiler version to build rustc itself, my proposal may not be feasible for Rust for the time being. Other self-hosted compiler mitigate this problem through language standards and by not using recent language features in the compiler implementation (e.g. the Go compiler can still be built with Go 1.4). > I think Cyclone and Go are good candidates for proof of concept. I don't= =20 > think it will be possible to do it with Rust until mrustc or gcc-rust is=20= > more capable. I can only make qualified comments for packages I have worked on in the past. From the top of my head, I can think of the following additional packages for which this proposal is also feasible: * community/ghc where the stage0 should eventually be able to use the musl bindist provided by upstream or, alternatively, we could revive the Docker based cross-compilation setup as a stage0 [1]. * testing/idris2 where upstream provides autogenerated Chez Scheme files for bootstrapping purposes which could be used in the stage0. * community/cabal for which we already have community/cabal-bootstrap and could thus easily have them provide a virtual package with different provider_priorities. Greetings, S=C3=B6ren [1]: https://gitlab.alpinelinux.org/alpine/aports/-/commit/8488e8747aa7cb27= 5882157b8a4a53c274c71927