From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 6IKZHokF9WPcEQEAbAwnHQ (envelope-from ) for ; Tue, 21 Feb 2023 18:55:21 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id wJjOHokF9WMckQAA9RJhRA (envelope-from ) for ; Tue, 21 Feb 2023 18:55:21 +0100 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 B57E017E3C for ; Tue, 21 Feb 2023 18:55:20 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pUWr3-0006hw-RE; Tue, 21 Feb 2023 12:55:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pUWr2-0006hC-2M for guix-patches@gnu.org; Tue, 21 Feb 2023 12:55:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pUWr1-0005yV-EK for guix-patches@gnu.org; Tue, 21 Feb 2023 12:55:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pUWr0-0000mz-RM for guix-patches@gnu.org; Tue, 21 Feb 2023 12:55:02 -0500 Subject: bug#60386: [PATCH] gnu: Add guile-proba. Resent-From: Jelle Licht Original-Sender: "Debbugs-submit" Resent-To: guix-patches@gnu.org Resent-Date: Tue, 21 Feb 2023 17:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 60386 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Luis Felipe Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , 60386-done@debbugs.gnu.org Mail-Followup-To: 60386@debbugs.gnu.org, jlicht@fsfe.org, luis.felipe.la@protonmail.com Received: via spool by 60386-done@debbugs.gnu.org id=D60386.16770020652982 (code D ref 60386); Tue, 21 Feb 2023 17:55:02 +0000 Received: (at 60386-done) by debbugs.gnu.org; 21 Feb 2023 17:54:25 +0000 Received: from localhost ([127.0.0.1]:57210 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pUWqO-0000m1-P4 for submit@debbugs.gnu.org; Tue, 21 Feb 2023 12:54:25 -0500 Received: from mail1.fsfe.org ([217.69.89.151]:40216) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pUWqL-0000lo-DZ for 60386-done@debbugs.gnu.org; Tue, 21 Feb 2023 12:54:23 -0500 From: Jelle Licht DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fsfe.org; s=2021100501; t=1677002057; h=from:from: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: in-reply-to:in-reply-to:references:references; bh=u8zK92xaVJ2SoJyZpEwHlVuGllQ07CP2NFGibRe6GUE=; b=mkyWTRsHahZ0aJF1milPKfo3DOFqes07h+Lg3q7SRW2/PBmtHojj4+aoUtR7c0IH16jpx/ 26sNq1WQ12FczaLOcGUt15ln+ks/YjCr7xtWVGnfWrwU2fpS6OxY0xU/Lspl261sqRIpaW XXluZsEic1/TBGpiXjUXmhQJ5RCdD/I= In-Reply-To: References: <87edrti82j.fsf@gnu.org> <0R2fGew0iuJD4YBAaHVjCshZMF52BTBE0WeK7DfiPAO5ebcSRE6PWiix30uJUY35OigiDykEQF_ZpjNc18IoQatNgRXsz4_cx6oMriFDo8M=@protonmail.com> <87wn5cyjkw.fsf@gnu.org> <_jbPEie6ho5J8_1hgP63VBuPhumFn1hAzjkWOv0rD7BwHVYo7ZgAa7UAxkuXNRxGvPBwbz6xNBQ2S2TZMwbDnme8JVwnDqtwElWisSfBr8E=@protonmail.com> <87sffxr63g.fsf_-_@gnu.org> <87pmadr86d.fsf@fsfe.org> Date: Tue, 21 Feb 2023 18:54:15 +0100 Message-ID: <87bklmdhvc.fsf@fsfe.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1677002121; a=rsa-sha256; cv=none; b=sydA1X4u+NV87nc8zwhcWXaT6fcjCFAYrtTO0s9/KHCHzUUs61nYMRBdSplAyNulVfcs11 cClC6VNGmbJUuhYriuOwdNZeCPG598weamGiDERbD4MntykpohV8XbVc4/slpgtyC0qdUO SZPvQEq/i6Jn9ZT7ETn8oLcu97eLYbW50xj9+5MycvscdSMR/R32NGo1lyaj7i9LmyXcak xJo/zBTAXNLzOaWQG8iSQF2MzeSOL56ego4veBBxZ/wSXEHOlNUBbQuxCYR8xHjQvr0fIH WWzL4C8DX7WY5m/v+6nCLnpX8r/AIXKkS7YodmMpLsPHmj/lzyaNQ8MXGhrblQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=fsfe.org header.s=2021100501 header.b=mkyWTRsH; dmarc=fail reason="SPF not aligned (relaxed)" header.from=fsfe.org (policy=none); 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1677002121; 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: content-transfer-encoding:content-transfer-encoding:resent-to: 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=u8zK92xaVJ2SoJyZpEwHlVuGllQ07CP2NFGibRe6GUE=; b=habiq1eLTXpz5+DKX9/cwjvBGEvteo0vZE8wjTR822ikLAJbCvw85Wvo0APQSgHMYFtkT2 bbmUhs9VFE9QlmL60DQhUQOSCjn3YJ+A+OXYR3ixt8UqLGx8LtUtg1yuZ6BHE5+XiONqzQ k9smSu7O4wv9GN0WVGHYvmXOCibaOGipaP6H8CKs9hF69emP9K3uBfVWVheId2dCJFTWNj QGV0tTmTGQxBwOcoApCoVj6o8DEKU2yOh+MqLxperIMVfENCI98Hrsgb4cvBt02mLgawSN LQMj5+SbFCI8GLuP7ie7z3/pg/CiUrJHcEs9irTY1uEFMTFAz97Jcfkydb9/aw== X-Migadu-Spam-Score: 5.85 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=fsfe.org header.s=2021100501 header.b=mkyWTRsH; dmarc=fail reason="SPF not aligned (relaxed)" header.from=fsfe.org (policy=none); 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: B57E017E3C X-Spam-Score: 5.85 X-Migadu-Scanner: scn1.migadu.com X-TUID: eo5FM0d3LeHA Hi Luis, Pushed to master! Some comments still follow. Luis Felipe writes: > Hi Jelle, thanks for taking a look. > > I'm sending a new patch after this message, but I'm replying to your revi= ew below. > > > On Monday, February 13th, 2023 at 13:44, Jelle Licht wr= ote: > >> > + (native-inputs (list guile-3.0 texinfo)) >>=20 > >>=20 > >> I think guile should be a normal input. Other packages like this >> (e.g. guilescript, ccwl) seem to do it that way. > > I moved it to inputs now. But I placed it in native-inputs following the = guile-build-system documentation in the manual: > > "Packages built with =E2=80=98guile-build-system=E2=80=99 must provide a = Guile package in their =E2=80=98native-inputs=E2=80=99 field." > > Did I misunderstand or should that part of the manual be updated? You are correct, but in order to cleanly cross compile, we'd need to: - add guile to both inputs (for the shebang) and native-inputs (for cross compilation) - add all guile libraries to both propagated-inputs and native-inputs - ensure all guile libraries we depend on can be cross compiled. - rework the `(getenv ...)' trick again, to be constructed out of the guile libraries in (propagated-)inputs, instead of the native-inputs. A quick bit of research makes me think guix is one of few packages written in guile using autotools that supports cross compilation. I think we can just leave the entire cross-compilation thing to be done later, and then have it be done properly for all guile packages at once. >> > + (propagated-inputs (list guile-config guile-lib)) >> > + (arguments >> > + (list >> > + #:phases >> > + #~(modify-phases %standard-phases >> > + (add-after 'build 'check >> > + (lambda _ >> > + (invoke "guile" "proba.scm" "run" "tests"))) >> > + (add-after 'install 'install-wrapped-script >> > + (lambda* (#:key outputs #:allow-other-keys) >> > + (let* ((out (assoc-ref outputs "out")) >> > + (version (target-guile-effective-version)) >> > + (scm (string-append "/share/guile/site/" version)) >> > + (go (string-append "/lib/guile/" version "/site-ccache")) >> > + (bin-dir (string-append out "/bin")) >> > + (script (string-append bin-dir "/proba"))) >> > + (mkdir-p bin-dir) >> > + (copy-file "proba.scm" script) >> > + (chmod script #o555) >> > + (wrap-program script >> > + `("GUILE_LOAD_PATH" prefix + (,(string-append out scm))) +` ("GUILE_= LOAD_COMPILED_PATH" prefix >> > + (,(string-append out go))))))) >>=20 > >>=20 > >> This seems almost correct, as it extends the GUILE_LOAD_{,COMPILED}PATH >> at runtime; the user would for still need to have the guile-config and >> guile in their profile. Although guile-config is also listed as a >> propagated input, when the guile search paths specifications are not >> active, the following would not work: >>=20 > >> `guix shell --pure guile-proba -- proba run tests' >>=20 > >> You could have a look at the 'wrap phase of the ccwl package; they use >> the value of (getenv "GUILE_LOAD{,COMPILED}_PATH") retrieved while >> building the package to wrap their script. > > I added a new phase to set Guile load paths so that they take (getenv "GU= ILE_LOAD{,COMPILED}_PATH") into account, and modified the wrapping accordin= gly. In my test, running "guix shell --pure guile-proba -- proba run tests"= works now. > > >> > + (add-after 'install 'install-manual >> > + (lambda* (#:key outputs #:allow-other-keys) >> > + (let* ((out (assoc-ref outputs "out")) >> > + (info-dir (string-append out "/share/info"))) >> > + (mkdir-p info-dir) >> > + (invoke "makeinfo" "manual/main.texi") >> > + (install-file "guile-proba" info-dir))))) >>=20 > >> Nitpick, so feel free to ignore: >> You could split up building and installing the manual. > > I put building into a separate phase. > > >> > + #:not-compiled-file-regexp >> > + "((bogus|bogus-tests|packages|tests)\\/.*.scm|(proba|manifest).scm)$= ")) >>=20 > >>=20 > >> All of the files listed in this regex are still installed in >> /share/guile/site/3.0. Do you think it would be possible to ensure >> these files are not installed? > > It was possible. Now it looks like this: > > /gnu/store/xaqmf7n83h5dq9xv6is46ybjk98ssakr-guile-proba-0.3.0 > |-- bin > | `-- proba > |-- lib > | `-- guile > | `-- 3.0 > | `-- site-ccache > | `-- proba > | |-- cli.go > | |-- commands.go > | |-- runners.go > | |-- templates.go > | `-- utils.go > `-- share > |-- doc > | `-- guile-proba-0.3.0 > | |-- README.org > | `-- index.html > |-- guile > | `-- site > | `-- 3.0 > | `-- proba > | |-- cli.scm > | |-- commands.scm > | |-- runners.scm > | |-- templates.scm > | `-- utils.scm > `-- info > `-- guile-proba