From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id UFIVEaHNeGJAeAAAbAwnHQ (envelope-from ) for ; Mon, 09 May 2022 10:15:29 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id mKLcEKHNeGLV1gAAauVa8A (envelope-from ) for ; Mon, 09 May 2022 10:15:29 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id BFB9D3B36C for ; Mon, 9 May 2022 10:15:27 +0200 (CEST) Received: from localhost ([::1]:48270 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnyYA-0007qG-Q5 for larch@yhetil.org; Mon, 09 May 2022 04:15:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44664) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnyXn-0007ou-B7 for guix-patches@gnu.org; Mon, 09 May 2022 04:15:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33830) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nnyXm-0006yd-EB for guix-patches@gnu.org; Mon, 09 May 2022 04:15:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nnyXm-0006Tm-9l for guix-patches@gnu.org; Mon, 09 May 2022 04:15:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55227] [PATCH core-updates 2/8] commencement: Add stage0-posix. Resent-From: Jan Nieuwenhuizen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 09 May 2022 08:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55227 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Thiago Jung Bauermann Cc: 55227@debbugs.gnu.org X-Debbugs-Original-Cc: 55227@debbugs.gnu.org, guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.165208405424813 (code B ref -1); Mon, 09 May 2022 08:15:02 +0000 Received: (at submit) by debbugs.gnu.org; 9 May 2022 08:14:14 +0000 Received: from localhost ([127.0.0.1]:55951 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nnyX0-0006S9-4L for submit@debbugs.gnu.org; Mon, 09 May 2022 04:14:14 -0400 Received: from lists.gnu.org ([209.51.188.17]:56230) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nnyWy-0006S1-Ob for submit@debbugs.gnu.org; Mon, 09 May 2022 04:14:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44430) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnyWy-00073k-GA for guix-patches@gnu.org; Mon, 09 May 2022 04:14:12 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47316) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnyWw-0006tA-Gb; Mon, 09 May 2022 04:14:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=1EPH2iE7kA2z+pxblWqMO1eYO6BQxc4mf42H3SBApNw=; b=KI3rUVq7RtYM4Q65klwb wPMRghvnKoh6Lhi17inOb3kzgVfXdEVwH2HL5ZIsB5z5CUx5sGKfsLbmO5ePqNEVFX6h31ciFflxb mAd7umH6cEl8e9+4ZvDL2iXhNQIztD/DBbpr6zVzO/ERbKQ1kc52694EWx3LIdS7qnNE0sF6U+01K dMLy9va3FIt/pSNhmAcPrEauLMN/vVgC5zduUcKDYZJ8HmRx6G+a+/RY8PH+3v7v7DtszWJGnR6Ln 4Lda9DH4pzBDnr5R0gRjTWE0Y/hZncF539xEWDIJLAbHnkp5CNR4rU3s9iXq3B7Ae5A9jzHxzF6m3 TFwGouJqyohqyg==; Received: from 2a02-a462-da03-1-fa3e-1174-c33f-9485.fixed6.kpn.net ([2a02:a462:da03:1:fa3e:1174:c33f:9485]:54974 helo=drakenbij.janneke.lilypond.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnyWw-000270-2Z; Mon, 09 May 2022 04:14:10 -0400 From: Jan Nieuwenhuizen Organization: AvatarAcademy.nl References: <20220502182434.32130-1-janneke@gnu.org> <20220502182434.32130-2-janneke@gnu.org> <87ee13nyho.fsf@kolabnow.com> X-Url: http://AvatarAcademy.nl Date: Mon, 09 May 2022 10:14:06 +0200 In-Reply-To: <87ee13nyho.fsf@kolabnow.com> (Thiago Jung Bauermann's message of "Mon, 09 May 2022 00:49:44 -0300") Message-ID: <87y1zbcecx.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1652084128; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=1EPH2iE7kA2z+pxblWqMO1eYO6BQxc4mf42H3SBApNw=; b=Pp2yi4/iX6EuWSiDNIK8523+tByyDcIYKw5uXSS69nMlgpjvCqhWtLFUudpVEfwJFMoWw1 5gpKqch+oGnljQQ7UcqulVBa7Rnyy/9ZShtz7L6X7zElyK0BO7YcfSC1b2g5NO49HaoBXP wW1yV0T5W8Xgc2NQkHL8oa4Ysqanaw19fM84eMzTz3gpiJ8pWXxM9sM+bPNTiMLPOpOV4P EdRGhSOeVaiOjY1Pq/PUyVhtcjHJdnu3A0IE7nngIY3hf9qKHhPoctkWKhkmcJSyHvy+oK FKSKiHhLvOoxxEOD5RDE2S281rG5dkUFexO9uzPL0NtnppQEFppNPR6i6WM3Fg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1652084128; a=rsa-sha256; cv=none; b=gQ3wgJYxpvGiZ7wxgMSdhBp+f7eNjjsKB13wWYHqQaqJ5Tn4198N3M1hUNYBYsUwHx8Xn4 WXRsBcFDquumY+31SrIkTwMEzokMETIsy9ql1tfReMgVDuZek746geY4ucRA9P2/JrMzat u8XijDES1MbWSaSLSgHXrEqsMnZeGJZN4yFu+h2ZoWw2nFD/aK0EPn+zHEtJgIuUzrw5+Q Ai03A4IhiV8nJ84zW9dXE+BvnJpV11TKKWoHom6ghwYHPboocpyg0W+1SLYS7VX9HRMcFv HrATFVnb6BH+4WNCKAf3ShPFXLTc1K31ubi0GZd28Nxuz7pxIxE9guhcXq2gLA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=KI3rUVq7; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -5.60 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=KI3rUVq7; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: BFB9D3B36C X-Spam-Score: -5.60 X-Migadu-Scanner: scn0.migadu.com X-TUID: 59KF22Hk/KWm --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Thiago Jung Bauermann writes: Hello Thiago, > This is great work! Thanks! > This is not an area I have experience in, so I didn't read it closely, > at least as of yet. I have only one minor comment: >> diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.s= cm >> index 663ffacd56..24e1e6ec8c 100644 >> --- a/gnu/packages/commencement.scm >> +++ b/gnu/packages/commencement.scm [..] >> + (stage0-cpu >> + (cond >> + ((or (string-prefix? "x86_64-linux" target) > > IMHO the code is clearer and less error prone if the (guix utils) > convenience functions are used to test the target rather than directly > doing string pattern matching. > > In this case, =E2=80=98target-x86-64?=E2=80=99 is the one. There's no nee= d to even pass > an argument to it since the default is what you need. > > The check for Linux could be done separately in the body of the builder > with =E2=80=98target-linux?=E2=80=99. What do you think? > >> + (string-prefix? "i686-linux" target)) > > Here it would be =E2=80=98target-x86-32?=E2=80=99. > >> + "x86") >> + ((or (string-prefix? "aarch64-linux" target) >> + (string-prefix? "armhf-linux" target)) > > This is a good case in point. There's a bug above: =E2=80=9Carmhf-linux= =E2=80=9D matches > 32-bit ARM when building natively because that's what's in > %current-target, but when cross-building %current-target-system will > contain =E2=80=9Carm-unknown-linux-gnueabihf=E2=80=9D and this branch won= 't be taken. > > Using =E2=80=98target-arm32?=E2=80=99 avoids the bug. Nice catch and good suggestion. Find a new version attached. Greetings Janneke --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=v2-0002-commencement-Add-stage0-posix.patch >From f013e88563f73a7513faa330c79eef2f653daf28 Mon Sep 17 00:00:00 2001 From: "Jan (janneke) Nieuwenhuizen" Date: Thu, 31 Dec 2020 18:25:21 +0100 Subject: [PATCH core-updates v2 2/8] commencement: Add stage0-posix. Stage0-posix is a skeleton for bootstrapping all of Stage0 for POSIX systems. On x86-linux, from the 357-byte hex0-seed binary from the bootstrap-seeds, it builds hex0, kaem, hex1, catm, hex2, M0, cc_x86, M1, M2, get_machine, (mescc-tools), and M2-Planet. * gnu/packages/commencement.scm (stage0-posix): New variable. --- gnu/packages/commencement.scm | 110 ++++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index 663ffacd56..7cb972f3bd 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -306,6 +306,116 @@ (define bootstrap-seeds M1, and M2-Planet.") (license license:gpl3+))) +(define stage0-posix + ;; The initial bootstrap package: no binary inputs except those from + ;; `bootstrap-seeds, for x86 a 357 byte binary seed: `x86/hex0-seed'. + (let ((mescc-tools-version "1.4.0") + (m2-planet-version "1.9.0")) + (package + (name "stage0-posix") + (version "1.4") + (source (bootstrap-origin + (origin + (method url-fetch) + (uri (string-append + "https://lilypond.org/janneke/guix/20220502/" + "stage0-posix-" version ".tar.gz")) + (sha256 + (base32 + "1ammifkj33205qrpfm84yb1c99lwgbn4jsl1hd08aab8c9ffz6p4"))))) + (supported-systems '("i686-linux" "x86_64-linux" + "arm-linux" "aarch64-linux" + "riscv64-linux")) + (native-inputs + `(("bootstrap-seeds" ,bootstrap-seeds) + ("mescc-tools" + ,(bootstrap-origin + (origin + (method url-fetch) + (uri (string-append + "https://lilypond.org/janneke/guix/20220502/" + "mescc-tools-" mescc-tools-version ".tar.gz")) + (sha256 + (base32 + "1xi6f48pf5bhajhfis189gpizxij7nbp1vzvsb1aafhz4skkiqvg"))))) + ("m2-planet" + ,(bootstrap-origin + (origin + (method url-fetch) + (uri (string-append + "https://lilypond.org/janneke/guix/20220502/" + "M2-Planet-" m2-planet-version ".tar.gz")) + (sha256 + (base32 + "1xrn69sc5nz4hwaishqyrcidp1ncxwib9zswl45x378ddz3mmk7g"))))) + ,@(%boot-gash-inputs))) + (build-system trivial-build-system) + (arguments + `(#:guile ,%bootstrap-guile + #:modules ((guix build utils)) + #:builder + (begin + (use-modules (guix build utils)) + (let* ((bootstrap-seeds (assoc-ref %build-inputs "bootstrap-seeds")) + (mescc-tools (assoc-ref %build-inputs "mescc-tools")) + (m2-planet (assoc-ref %build-inputs "m2-planet")) + (source (assoc-ref %build-inputs "source")) + (tar (assoc-ref %build-inputs "bootar")) + (bash (assoc-ref %build-inputs "bash")) + (coreutils (assoc-ref %build-inputs "coreutils")) + (guile (assoc-ref %build-inputs "guile")) + (out (assoc-ref %outputs "out")) + (bindir (string-append out "/bin")) + (target (or ,(%current-target-system) + ,(%current-system))) + (stage0-cpu + (cond + ((or ,(target-x86-64?) ,(target-x86-32?)) + "x86") + (,(target-arm?) + "armv7l") + (else + (error "stage0-posix: system not supported" target)))) + (kaem (string-append "../bootstrap-seeds/POSIX/" + stage0-cpu "/kaem-optional-seed"))) + (setenv "PATH" (string-append tar "/bin:" + coreutils "/bin:" + bash "/bin")) + (invoke "tar" "xvf" source) + (chdir (string-append "stage0-posix-" ,version)) + (copy-recursively bootstrap-seeds "bootstrap-seeds") + (invoke "tar" "xvf" mescc-tools) + (rmdir "mescc-tools") + (symlink (string-append "mescc-tools-" ,mescc-tools-version) + "mescc-tools") + (invoke "tar" "xvf" m2-planet) + (rmdir "M2-Planet") + (symlink (string-append "M2-Planet-" ,m2-planet-version) + "M2-Planet") + (rmdir "M2libc") + (symlink "M2-Planet/M2libc" "M2libc") + (mkdir-p bindir) + (with-directory-excursion stage0-cpu + (with-output-to-file "mes-m2.kaem" + (lambda _ (display ""))) + (with-output-to-file "mescc-tools-extra.kaem" + (lambda _ (display ""))) + (invoke kaem "kaem.run")) + (with-directory-excursion "bin" + (install-file "hex2" bindir) + (install-file "M1" bindir) + (install-file "blood-elf" bindir) + (install-file "kaem" bindir) + (install-file "get_machine" bindir) + (install-file "M2-Planet" bindir)))))) + (home-page "https://github.com/oriansj/stage0-posix/") + (synopsis "The initial bootstrap package, builds stage0 up to M2-Planet") + (description + "Starting from an 357-byte hex0 provided by the bootstrap-seeds, +stage0-posix builds hex0, kaem, hex1, catm, hex2, M0, cc_x86, M1, +M2, get_machine, (mescc-tools), and M2-Planet.") + (license license:gpl3+)))) + (define %bootstrap-mes-rewired (package (inherit mes) -- 2.35.1 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable --=20 Jan Nieuwenhuizen | GNU LilyPond https://lilypond.org Freelance IT https://JoyOfSource.com | Avatar=C2=AE https://AvatarAcademy.c= om --=-=-=--