From mboxrd@z Thu Jan 1 00:00:00 1970 From: Efraim Flashner Subject: Re: Why do we not cross-compile bootstrap binaries? Date: Sun, 26 Nov 2017 11:03:04 +0200 Message-ID: <20171126090304.GH991@macbook41> References: <87lgiwsds8.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="dfmC41YZQlborXoK" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58348) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eIsqF-00046F-2V for guix-devel@gnu.org; Sun, 26 Nov 2017 04:03:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eIsqB-0007j1-Uq for guix-devel@gnu.org; Sun, 26 Nov 2017 04:03:11 -0500 Received: from flashner.co.il ([178.62.234.194]:34404) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eIsqB-0007i4-He for guix-devel@gnu.org; Sun, 26 Nov 2017 04:03:07 -0500 Content-Disposition: inline In-Reply-To: <87lgiwsds8.fsf@gmail.com> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Chris Marusich Cc: guix-devel@gnu.org --dfmC41YZQlborXoK Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 23, 2017 at 04:47:51PM -0800, Chris Marusich wrote: > Hi, >=20 > We have bootstrap binaries for various platforms. For example, commit > 3b88f3767d9f3ad2cc64173525cd53d429bfe7e7 adds bootstrap binaries for > aarch64-linux. Judging by the commit message, my guess is that these > bootstrap binaries were built (cross-compiled, I presume) using Guix at > commit 8f8f250bdca917b3ce38aa0902f01b19081859a4 and then checked into > the Git repository. >=20 That's correct. The aarch64 bootstrap binaries were cross compiled from x86_64 using the commit listed and then added in. Looking back at the early commit history, I believe x86_64 and i686 were bootstrapped from Nix and then rebootstrapped later. > My understanding is that we could choose, in theory, to cross-compile > the bootstrap binaries from a "base" platform. This choice would reduce > the number of bootstrap binaries we need to check into the Git > repository. However, my guess is that we do not want to treat one > particular platform as special: we would like to be able to bootstrap > everything from any supported architecture. For example, it would be > unfortunate if bootstrapping an armhf-linux machine required the use of > an x86_64-linux machine. To avoid this "asymmetry" in the bootstrap > path, we choose to check in the built artifacts instead of > cross-compiling them. >=20 The diverse double compilation project which aims to allow different starting points arrive at bit-identical binaries, which would make it so that it wouldn't matter which architecture the bootstrap binaries were built on. Additionally, between mes and stage0 there are efforts to bootstrap from human readable hex code, which would allow literally bootstrapping from zero, without the need of blessed bootstrap binaries. > Is my understanding correct? I couldn't find an explicit explanation of > the motivation for this choice by looking at email archives, source > code, or the manual, so I thought I'd ask here. >=20 The way I look at it, one architecture shouldn't have to depend on another architecture for its packages. Currently we only have support for haskell on Intel systems, those are the only systems which GHC has binary releases for and we need a binary bootstrap to build GHC. If we want to support Haskell on other architectures we can do like Debian (and I'm sure many other distributions) and cross-compile the bootstrap GHC, which would make aarch64's haskell dependant on x86_64. Gentoo has a couple of their own blessed bootstrap binaries for GHC that must've been cross compiled some time in the past, and those are used when bootstrapping GHC on a new install. There was also a talk from FOSDEM 2017 about the size of the bootstrap binaries once they're unpacked (200+ MB?) and the work up to then with bootstrapping from a lower base. --=20 Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7=9D = =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --dfmC41YZQlborXoK Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAloag0UACgkQQarn3Mo9 g1GSgg/+NpGJ97rsLCJuXTWyoljp7acPbIlCakgC9mKDvgGB57PeB0jn4583mt2F n6t0P+4vaHXisrWvAfXa9eBSaLB1yWL4Yio2yOPvTWpVtZ8QE+VFTrWsuV5ZGll4 wplrAM8h2PV4PcCVcfU/kKsjIOJY7v3nwdJlziByviwYzqGfhQxwKRK+6tIi+aF1 P+3yfWVp2U17zrCY/e+ZK7IFtNzWj47V4LCScRDkVxDz6zFVQsPawICKB6N2iOh8 iKy+T4ZQ45MyG+GW5ENw7isn5JMJc6BgLxWJpQLnkWSFTdmcQIQQNA/K6lngA9L8 0YV1LUfR/vE6ATRCT2uDj9oDc4fHDaZyQUiYa1QmLp6UdMjgtpMRqpb9157+hLBU sHoRMFIEglBZyYRSesFzR/no0Gvvu2T8887umAEn6G5S2xFGguOV1Jm7R0ey7FNb dqZSTb9XYBZgTdEntjDG/QaaDBuWCBakJNxciCiWPjFU13tITPJcMyKTmOdZCbkU LoUzzvQxdmVM2YOpTIweD8huZ3IW4tRCb9hXB7YLP1259hznWmDhxj5OzIWp48sq gekf7YA+jjpRlrqtyf6ULce+D/5VyT+Vgn0GwyWJ8z1K0smQBBez+jSZOB9mqE2B 3p54f1kSaHveUcBMHJpUKLcbqaosUEDjgDc9C3Y0i5e+IVNmW4E= =5Wri -----END PGP SIGNATURE----- --dfmC41YZQlborXoK--