From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 0OMDKlSTeGL4+AAAbAwnHQ (envelope-from ) for ; Mon, 09 May 2022 06:06:44 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id EEkiKlSTeGKIhQAA9RJhRA (envelope-from ) for ; Mon, 09 May 2022 06:06:44 +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 200BC3E1D1 for ; Mon, 9 May 2022 06:06:44 +0200 (CEST) Received: from localhost ([::1]:57418 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnufS-0002nr-KQ for larch@yhetil.org; Mon, 09 May 2022 00:06:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53170) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnudq-0002mq-NE for guix-patches@gnu.org; Mon, 09 May 2022 00:05:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33517) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nnudq-0005uG-DW for guix-patches@gnu.org; Mon, 09 May 2022 00:05:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nnudq-0006Dt-6c for guix-patches@gnu.org; Mon, 09 May 2022 00:05:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55227] [PATCH core-updates 2/8] commencement: Add stage0-posix. Resent-From: Thiago Jung Bauermann Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 09 May 2022 04:05: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: "Jan (janneke) Nieuwenhuizen" 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.165206906023869 (code B ref -1); Mon, 09 May 2022 04:05:02 +0000 Received: (at submit) by debbugs.gnu.org; 9 May 2022 04:04:20 +0000 Received: from localhost ([127.0.0.1]:55647 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nnudA-0006Cv-2j for submit@debbugs.gnu.org; Mon, 09 May 2022 00:04:20 -0400 Received: from lists.gnu.org ([209.51.188.17]:38184) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nnud6-0006Cm-Ta for submit@debbugs.gnu.org; Mon, 09 May 2022 00:04:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52830) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnud1-0002hB-7N for guix-patches@gnu.org; Mon, 09 May 2022 00:04:14 -0400 Received: from mx.kolabnow.com ([212.103.80.155]:49878) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnucv-0005mX-6K; Mon, 09 May 2022 00:04:10 -0400 Received: from localhost (unknown [127.0.0.1]) by mx.kolabnow.com (Postfix) with ESMTP id 78A5B10C2; Mon, 9 May 2022 06:03:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-transfer-encoding:content-type:content-type:mime-version :message-id:in-reply-to:date:date:subject:subject:from:from :references:received:received:received; s=dkim20160331; t= 1652069035; x=1653883436; bh=qastRCW/YgIMdHPPT/TrWVluePhthYbhkNU JC6/LxAw=; b=ZmF6Q46eZw7VQl6i/aDfyvhd7Tc9PyDQ0lpJi8PhBzUz3vsV6gK hc+3ODjxyTmS65HD5Rk1N21bOmFd5CXn04HjhPec9vCbDDoOo6oiaiBAeJz99Bi/ Rk5MIS+1KOMIyfdUfmteGqWHP7I89WE3REwSG+j7gUsj4joFBCZG6UUUPykiwP7u c/CINT6fHQeHTGWdoG0BLcjdHBU2n7ODGSFX/1tMB0sPRLHnW7lTqV55ojos5MyK TJFcCdSRpdR6tqTCKgwQ22l1oePc4KdeNk0nBKlpMd0Gd+TImFHg+zw3j7/XWHDS 0ilUGopJTxlZbmTbZ15DyJf8PcP4wk7wb6eOTtU6Wu/7NR75EC2eJdtD2ICUBc2h gMzw5VaYmtWWqcW2BxZYcxJ3Il7EAbxX/ibrWIDzktGPH459vn/PLJ7RPtr0LxXi ynwhgzn1ViJ6Rw4113MdChaMUm2okI1XVtLqg967zx84X+XGHyl7wTaTjtD2OOBS poGm2wyeypZvxdcZR2NqshKiAPDVvNgc5eCNl5Gr8uBGp8fmXyX6jJBbinXBLY97 55Ep2tkoZzjnfK3XY/aZCQdXwLTZ3AU7s37pQ31QzkplpcDfla1jxXnenGC0vqbU MqN+iZzizfmi7Z+7gfSIk69DMlubErtED+7bY+MV4cbJgmr7OAydJVmA= X-Virus-Scanned: amavisd-new at mykolab.com Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out001.mykolab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TA214NTFrCX1; Mon, 9 May 2022 06:03:55 +0200 (CEST) Received: from int-mx001.mykolab.com (unknown [10.9.13.1]) by mx.kolabnow.com (Postfix) with ESMTPS id 2C2F7722; Mon, 9 May 2022 06:03:55 +0200 (CEST) Received: from ext-subm001.mykolab.com (unknown [10.9.6.1]) by int-mx001.mykolab.com (Postfix) with ESMTPS id 979AC112D; Mon, 9 May 2022 06:03:54 +0200 (CEST) References: <20220502182434.32130-1-janneke@gnu.org> <20220502182434.32130-2-janneke@gnu.org> Date: Mon, 09 May 2022 00:49:44 -0300 In-reply-to: <20220502182434.32130-2-janneke@gnu.org> Message-ID: <87ee13nyho.fsf@kolabnow.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=212.103.80.155; envelope-from=bauermann@kolabnow.com; helo=mx.kolabnow.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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" Reply-to: Thiago Jung Bauermann X-ACL-Warn: , Thiago Jung Bauermann via Guix-patches From: Thiago Jung Bauermann via Guix-patches via 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=1652069204; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: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=qastRCW/YgIMdHPPT/TrWVluePhthYbhkNUJC6/LxAw=; b=AcCEGkEdpnlF2cxYrCn/vKDfTLaBmVfVSc8Xi3xdqkS9XzUYJvx15EXXGFgteuY8MF/5x8 uLxZuGkCrZbNBU1VLYnD6BkpXL1sv/NpCnN8oP8vvLxL5gNpOCBDlnX6NCm2XLyNxMoxpF 8fLBFpuXYMgc8xy3dbzeus4Tzf5QUO2zzft96JUsvbuwy5pMxOHTs50lFJ9dt8hKtfEUAo kEZ2bXuUDG5baw/NqQKzhfqydDdngTCpUpFVo0/5lhhOQU6HOiAY6AZtbC4kkWGRugddym 0lXGJa36D61/3Z1Nm3Kv5WWopM3J8mNb6AhXCI3BNhVNqAiXuPXTdbPq0rsDAA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1652069204; a=rsa-sha256; cv=none; b=Q6se+9YpwJdLrDWfIPYb++SE06AxSnwm01KgStxY+ddFeGisvrKsWKAuXG0ncTMpTFCJVl 9HccqYteN25AaDDR0MWvvtRNhPW471minC7LB9o5duOphE0r+oYnmdXDUKsOj1mI7tpElc aLkwErllHA4xo1f+gYByXoKtKopGBwuzmw2/RelGr7nhadeKUMzWE8/tUQ6LJ+iz5Ln2XG EJkH+QMPhRStyuFy+bbMRTCAix7W+z9vn6msz+vqNSBM9z65XhSJByNcAL3tVNRSYS+Wzf RfWRYn5AAIO12kW/oAh+4vRnjC51uVhsawfy1mGA/FwqNFqOQeXa1WDE++gujw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=kolabnow.com header.s=dkim20160331 header.b=ZmF6Q46e; 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: -2.70 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=kolabnow.com header.s=dkim20160331 header.b=ZmF6Q46e; 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: 200BC3E1D1 X-Spam-Score: -2.70 X-Migadu-Scanner: scn0.migadu.com X-TUID: YrF6WcM35ki3 Hello Jan, This is great work! 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: "Jan (janneke) Nieuwenhuizen" writes: > Stage0-posix is a skeleton for bootstrapping all of Stage0 for POSIX syst= ems. > 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 | 109 ++++++++++++++++++++++++++++++++++ > 1 file changed, 109 insertions(+) > > diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm > index 663ffacd56..24e1e6ec8c 100644 > --- a/gnu/packages/commencement.scm > +++ b/gnu/packages/commencement.scm > @@ -306,6 +306,115 @@ (define bootstrap-seeds > M1, and M2-Planet.") > (license license:gpl3+))) >=20=20 > +(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= "))))) > + (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-s= eeds")) > + (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 (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 need = 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. > + "armv7l") > + (else > + (error "stage0-posix: system not supported" target)= ))) --=20 Thanks Thiago