From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id MH2wGt3U0GCCFQAAgWs5BA (envelope-from ) for ; Mon, 21 Jun 2021 20:05:17 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id CNFMFt3U0GD/QgAAbx9fmQ (envelope-from ) for ; Mon, 21 Jun 2021 18:05:17 +0000 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 938D9B55B for ; Mon, 21 Jun 2021 20:05:16 +0200 (CEST) Received: from localhost ([::1]:47234 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lvOIN-0005Yh-7C for larch@yhetil.org; Mon, 21 Jun 2021 14:05:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51050) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvOIA-0005YW-OT for guix-patches@gnu.org; Mon, 21 Jun 2021 14:05:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:53579) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lvOIA-0007pj-Gu for guix-patches@gnu.org; Mon, 21 Jun 2021 14:05:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lvOIA-0005hL-D4 for guix-patches@gnu.org; Mon, 21 Jun 2021 14:05:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49158] Add ruby-for-crystal. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 21 Jun 2021 18:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49158 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: jgart , 49158@debbugs.gnu.org Cc: Raghav Gururajan , rprior@protonmail.com, mail@davie.li Received: via spool by 49158-submit@debbugs.gnu.org id=B49158.162429865521835 (code B ref 49158); Mon, 21 Jun 2021 18:05:02 +0000 Received: (at 49158) by debbugs.gnu.org; 21 Jun 2021 18:04:15 +0000 Received: from localhost ([127.0.0.1]:36892 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvOHO-0005g6-S9 for submit@debbugs.gnu.org; Mon, 21 Jun 2021 14:04:15 -0400 Received: from laurent.telenet-ops.be ([195.130.137.89]:51086) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvOHM-0005fy-T2 for 49158@debbugs.gnu.org; Mon, 21 Jun 2021 14:04:14 -0400 Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by laurent.telenet-ops.be with bizsmtp id Ku4B250040mfAB401u4BP0; Mon, 21 Jun 2021 20:04:11 +0200 Message-ID: <96173ec7e0043c7b85808f3bc2a42ad3410d9e19.camel@telenet.be> From: Maxime Devos Date: Mon, 21 Jun 2021 20:04:02 +0200 In-Reply-To: References: Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-kp+mDHKlYQlE+KR5HTkp" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1624298651; bh=NC05lHS3jd3ERl2hQDTIzHLtQVpXYwumvSIc8Kzj98o=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=t2M6lUng3hieS5053ZMhhMydFMOnOidoVUajrcE+VFic1LJwXzYa6SMOZNUR3mX+T esH/vVWkg2yo49paopFWSievOsFrgDt3NZzGXzuqqnSKTYk700Li/VB6tKGayNrJun aHTMPPvoGTNyeqpJRn8vvIq1w1hfM7GeF/VeuOkHlIvf+smM7MUzlcg5lVhjR79b9M OuzL4EEUiY71vlkMZjO+poJh9ANTfal71587RVyiCcQM+7QYh5HWxLR12F8bbAfBji 3NzB2jGQBQTfk+w10Zplv8gxO1EhQyWfcviweDGe+ZVFBaY/kQlgymW3nK0RluuDYJ MqqV+qQRvqSSQ== 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1624298717; 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=NC05lHS3jd3ERl2hQDTIzHLtQVpXYwumvSIc8Kzj98o=; b=P1L0JlnYSoTLdb6L7Qr5fYi1uqKj9U/8JwII5yGDCNwBqGr7CzxKtxTv/A+eIEoaeufE13 lhw4ByW/DbotqlXB88rsI7eE04aQdyerY4T9cvMXzXqszN+iaO3ZdStZS6UqlZAAIVCjeU hXSp9fPhT3W8H+cAZUCp2yiEBPrMMJripSjcauBes3ph8yamXF9FjeAaw78nNzrkwp7yUR EmB2fcbcJStC4unA4g+/6aiZIUS5LXOgwwTM1X9ZbA73H01D8sSKVTsOOKJl+FWyFK3Gyl ry7SxjGfad+uffXMD51nfMT+gWXeaAlOqlDS3zQh8chmK2TZlaYMgYABiBsuUA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1624298717; a=rsa-sha256; cv=none; b=KwM9n2EKzp1dbZQzTzqhycN681ds8+SrLoZE7tKaNMU7/e/rFxGM/P0L+7xdkO6+6eIUnu HCRUzIg/kj9THV/GMKpzddVPyq2tT3u/xbJeqnwJqlL53lGwY/evZ9XTN5b43Rkv34fxwm SlosP/tcqLC+saXYVtV5QR21qPHDN+pHatxVSMBt5cOW9al6gM2WorpQtd9XzlGDhaaYaV sqQeu7AvB6pZ3LxZ8sWr01bAN4Bh86qr6qxEljQ6nsS+0pS8gSxMSCMIvrH64iuzyP4eSP eLNeBQMla0WB1wOx1BfhIimxN5QNIGDc4NuiX4hpi3zkTCp5it6K3vq8eKYj2w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=t2M6lUng; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -3.42 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=t2M6lUng; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 938D9B55B X-Spam-Score: -3.42 X-Migadu-Scanner: scn0.migadu.com X-TUID: 6atfDQLaKYGh --=-kp+mDHKlYQlE+KR5HTkp Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable jgart via Guix-patches via schreef op ma 21-06-2021 om 16:19 [+0000]: > Hi Guix, >=20 > We've (Ryan, David, Raghav, and others) started packaging crystal for gui= x: https://crystal-lang.org/ >=20 > This patch adds an old version of ruby that is required by the crystal la= nguage bootstrap process. This is related to 49142. >=20 > This was an effort of the volunteers at the last guix packaging meetup ho= sted by LibreMiami. >=20 > Here are some notes, questions, and a list of dependencies regarding what= is needed > to finish a properly bootstraped crystal package: >=20 > https://github.com/ryanprior/guix-packages/blob/master/testing/crystal.or= g >=20 > We are trying to recreate this bootstrapping process in guix: >=20 > https://github.com/crystal-lang/bootstrap-script >=20 > There are 160 stages! >=20 > Some questions extracted from our notes follow: >=20 > Is it preferable to have 160 bootstrap packages, one for each stage, > or one big bootstrap package with 160 build-* stages, or somewhere inbetw= een? Definitely 160 separate bootstrap packages I'd say. Though the first 159 wouldn't be exported and would be hidden. Because: (1) presumably, building all these different versions of crystal would take a lot of time (2) if the build process OOMS, if there is a build failure at some stage, the user cancelled the build, and retried, then ideally Guix wouldn't start rebuilding the previous stages (3) so, 160 separate packages. > How best can we use Guile macros to clean up the large amount of code imp= lied by executing 160 stages of bootstrap logic? There doesn't seem to be much reason to use macro's here (except 'package' & 'define' itself) Basically, you'd do something similar to what's already done for Rust: (define* (crystal-bootstrapped-package base-crystal version checksum commit= ) "Bootstrap crystal VERSION with source checksum CHECKSUM and git commit C= OMMIT using BASE-CRYSTAL" (package (inherit base-crystal) (version version) (source (origin (inherit (package-source base-crystal)) (commit commit) (sha256 (base32 checksum)))))) To start the process, define an initial version crystal-stage1 like you'd do for any other packag= e. Then, for each N+1, define (define crystal-N+1 (crystal-bootstrapped-package crystal-N VERSION CHECKSU= M COMMIT)) Some crystals probably need somewhat different inputs, or require some fudg= ing in phases, so you might to occasionally modify the resulting package a litt= le: (define crystal-N+1 (package (inherit crystal-N) (inputs `(("stuff" ,libstuff) ,@(package-inputs crystal-N))) And export the final version: ;; Don't forget to remove the 'hiddenness' from crystal-160! (define-export crystal crystal-160) > Each stage needs a different checkout of the git repository - can we pres= erve info in .git > such that we can checkout again during the build, The .git directory isn't bit-for-bit reproducible (think different versions of git, different versions of compression libraries, different parallelism levels, etc. causing a slightly different pack), so no. Also, falling back to Software Heritage wouldn't work. > or do we want to have each checkout be an > independent input to the package? If you'll be using the 'crystal-bootstrapped-package' from above, then you'll automatically get independent inputs. Greetings, Maxime. --=-kp+mDHKlYQlE+KR5HTkp Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYNDUkhccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7l93AQDclY7uOIcsTlBHS0SYQUfbqjXG Or2pElxFZk1kQCA0GwD/cT4Qh/GVnNEsVJ9QZSFQzf1zHdktk5VAc1uzyKlpWAE= =Q+KF -----END PGP SIGNATURE----- --=-kp+mDHKlYQlE+KR5HTkp--