From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Guix on macOS Date: Fri, 13 Oct 2017 14:55:46 +0200 Message-ID: <87bmlbp64m.fsf@gnu.org> References: <87bmldavre.fsf@gmail.com> <87efq8pwrf.fsf@gnu.org> <87mv4viknx.fsf@gmail.com> 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]:42744) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2zVJ-0003fn-AR for guix-devel@gnu.org; Fri, 13 Oct 2017 08:55:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e2zVG-0002gH-Lx for guix-devel@gnu.org; Fri, 13 Oct 2017 08:55:53 -0400 Received: from hera.aquilenet.fr ([141.255.128.1]:35131) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e2zVG-0002fD-Ck for guix-devel@gnu.org; Fri, 13 Oct 2017 08:55:50 -0400 In-Reply-To: <87mv4viknx.fsf@gmail.com> (Chris Marusich's message of "Fri, 13 Oct 2017 00:14:42 -0700") 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 Hi Chris, Chris Marusich skribis: > ludo@gnu.org (Ludovic Court=C3=A8s) writes: > >> First of all, it=E2=80=99s never been a goal of Guix to run on non-GNU s= ystems. >> Now, I have nothing against it in principle, as long as (1) this can be >> achieved in a maintainable way, and (2) the targeted user-land software >> is free and buildable from source. > > I understand, and I agree with your criteria. > > I don't want to use Guix on macOS to package, promote, or make it easy > to use non-free software. I also don't want to port Guix to macOS in a > way that's difficult to maintain. > > I want users and developers who are currently using macOS to be able to > easily use Guix and all the free software that it provides. To borrow > the language used in the "GNU Emacs FAQ for MS Windows", I hope that the > experience of using GNU Guix on macOS will give programmers a taste of > freedom, and that this will later inspire them to move to a free > operating system such as GNU/Linux (hopefully one that uses Guix, like > GuixSD!) [1]. I think this is a reasonable motivation. Understood. At the same time, one could hope that, if freedom is not enough, the nifty features of GuixSD, GNOME, the GNU toolchain, etc. would be enough of an incentive to switch. But hey, it=E2=80=99s complicated! > Currently, I hope that we can get Guix working on macOS via a plan like > the following: > > 1) On an x86_64-linux GuixSD system, use Guix to cross-build Guix for > the x86_64-darwin target [2]. We would use GNU libc. > > 2) Install the output of (1) on a macOS system, following a procedure > similar to the one in the manual for binary installation ((guix) > Binary Installation). > > Is this plan feasible?=20 In theory, yes. That=E2=80=99s roughly the plan outlined at . Now, glibc proper only supports Linux and the Hurd. Debian has a port of glibc to the kernel of FreeBSD (=E2=80=9CkFreeBSD=E2=80=9D). But AFAIK,= these are the only working ports of glibc. Ricardo mentioned a glibc port to Darwin (or XNU?), but I suspect that was very experimental no? So your best bet would be to cross-compile using the macOS libc, similar to what Jan did with MinGW cross-compilation support. But again, this is assuming that the macOS libc is free, and that both that libc and the GNU toolchain support cross-compilation. I don=E2=80=99t know if this is t= he case. > Please understand that I'm genuinely curious, and I just want to help. > I might be missing some information that's obvious to others. If > there are gaps in my understanding, please help me to fill them. Sure, I understand. It=E2=80=99s a perfectly valid question to ask! > I imagine that there might be other ways to get Guix working on macOS. > Here are some possibilities that I've thought of or that others have > already mentioned: > > * Compile Guix (and its bootstrap binaries, I guess?) natively for > x86_64-darwin on macOS using Xcode, etc. This seems undesirable for > a lot of reasons. Some reasons I can think of are: the build > process would rely on non-free software, it probably wouldn't be > easily reproducible, and it would probably place a significant > additional burden on the Guix maintainers. I suppose the only > saving grace in this case might be that once we had a working Guix > (with bootstrap binaries) for macOS, call it G1, we might be in a > position to use G1 to reproducibly build Guix (with GNU libc) on > macOS going forward. I agree that this is undesirable. :-) > * Run Guix compiled for x86_64-linux on macOS using some kind of a > shim layer. This is pretty vague, but not without precedent: > consider virtual machines, WINE, and similar technologies. This > seems undesirable for a lot of reasons. Some reasons I can think of > are: any solution like this would probably be fragile, and as far as > I know there is no turn-key solution for running ELF executables on > macOS, so we'd have to build our own, and building our own would > entail the same kinds of problems as mentioned in the previous > bullet point. Windows recently gained an in-kernel Linux syscall emulation, which means that (GNU/)Linux binaries can run unmodified on Windows. If macOS had a similar feature, that=E2=80=99d be perfect: we wouldn=E2=80= =99t have anything to do. Perhaps Docker-for-Mac actually provides something close to that? I really don=E2=80=99t know. >> I=E2=80=99m afraid this is not the answer you were looking for. WDYT? > > This is exactly what I was hoping for: the start of a discussion! If we > can get Guix working on macOS while meeting the criteria you mentioned, > I think it'd be great for the reasons I mentioned at the start of this > email. If it isn't feasible, then I'd like to understand why. Yes, let=E2=80=99s see! Thanks, Ludo=E2=80=99.