From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Cross-building GuixSD (and maybe using pre-built toolchains) Date: Mon, 04 Jul 2016 15:48:17 +0200 Message-ID: <87shvpcy5a.fsf@gnu.org> References: <201607031651.28051.paul@boddie.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60942) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bK4Ec-0002X3-91 for guix-devel@gnu.org; Mon, 04 Jul 2016 09:48:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bK4EY-0004uA-0N for guix-devel@gnu.org; Mon, 04 Jul 2016 09:48:25 -0400 In-Reply-To: <201607031651.28051.paul@boddie.org.uk> (Paul Boddie's message of "Sun, 3 Jul 2016 16:51:27 +0200") 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: Paul Boddie Cc: guix-devel@gnu.org Hello, Paul Boddie skribis: > I was looking at the documentation, which is rather more helpful than mos= t=20 > distributions when it comes to describing how the actual distribution arc= hives=20 > are built, and I figured a few things out about guix-daemon. However, I'm= =20 > doing all my work in a chroot - I don't want to "make install" and popula= te=20 > various locations on my main system - and this doesn't seem to be entirel= y=20 > compatible with the recommended way the daemon is used. Specifically, the= =20 > daemon does not seem to be able to build anything unless I specify the -- > disable-chroot flag. How does guix-daemon fail exactly? If needed, could you strace it to get more details on what=E2=80=99s going on? > Are there any recommended methods of running guix-daemon in a chroot and = have=20 > it create new chroots, or do I have to use some kind of virtualisation or= =20 > container technology? Is any kind of fakeroot/fakechroot mechanism suppor= ted? I think few people do this, on the grounds that Guix is rather non-intrusive: it stores all its stuff in /gnu/store and /var/guix. So if you want to get rid of it, all you have to do is delete those two directories. The rest of the system is untouched. Now, if you really want it, I can=E2=80=99t think of any reason why guix-da= emon wouldn=E2=80=99t run in a chroot. It currently requires root privileges, precisely so that it can set up a chroot, separate name spaces, and so on, but that could work in a chroot too. > One thing that looks very promising is the ability to cross-bootstrap the= =20 > system, and I did manage to get that started for a new architecture (mips= el)=20 > by performing some modifications suggested in the documentation [1], runn= ing=20 > guix-daemon with the --disable-chroot flag, and then running this: > > guix build --target=3Dmipsel-linux-gnu bootstrap-tarballs > > However, not wanting to leave my computer switched on all night, I stoppe= d the=20 > build after a while. I can understand the need to bootstrap things like=20 > toolchains, but given that I am running Debian which has cross-toolchains= for=20 > mipsel, I wondered if I could short-circuit this process by employing pre- > built toolchains. Would this be possible? No. The approach we=E2=80=99re taking is to have a self-contained distro, = and that=E2=80=99s where we get all the fruits of the =E2=80=9Cfunctional parad= igm=E2=80=9D described in the manual. It=E2=80=99s surely an annoyance when bootstrapping an architecture for the first time. Once it=E2=80=99s in place though, it=E2=80=99s OK. You could= have build machines for that architecture publishing binaries to users (via =E2=80=98g= uix publish=E2=80=99). > Finally, it seems to be the case that the workflow involves building a=20 > bootstrapped minimal system and then natively building packages. Or have = I=20 > misunderstood the process? Correct, this is the process to port the distro to a new platform. > Is it possible to cross-build all of the packages in the distribution? That=E2=80=99s also an option: you can simply cross-build the packages that= you need and copy them to the target machine. We make sure core packages can be cross-built to the architectures we support (currently x86_64, i686, armhf, and mips64el). However, there=E2= =80=99s no guarantee that cross-building works for other targets, or that non-core packages cross-build at all. We=E2=80=99d definitely welcome patc= hes in this area, though. :-) HTH! Ludo=E2=80=99.