Received: (at 61255) by debbugs.gnu.org; 27 Feb 2023 21:08:52 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Feb 27 16:08:52 2023 Received: from localhost ([127.0.0.1]:48963 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pWkjr-0003Qp-QJ for submit <at> debbugs.gnu.org; Mon, 27 Feb 2023 16:08:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36374) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1pWkjo-0003QT-LS; Mon, 27 Feb 2023 16:08:49 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1pWkjg-00076w-PM; Mon, 27 Feb 2023 16:08:40 -0500 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=zrptTSTnGSukJor6J5Bo6ZIFpgHrvvrjo8ueB2Kjodw=; b=RFsjXLohKHeDfIBteBj+ zTCnerXksdpomcB1OoRdN/i5A8kzJGFtuEYCxEy9MKXp7UWiIie9MKazTa4Dnyp8p4Dq2OgfRVhyt z/6D6xIhF8lbp3zw0QW4PQ3vjxg7+qLEt7mwX7yP0VgacP6lyTxn+dEN85iAQb+kNG8YOTkrcNI15 X/Nv8sAnO48VJvIrQe91IjqoCCa53NRSlE5GL3s5zOTIQHqG7N+kt17ky494bYTZ7/k+y9czwzg04 LNLZCRsjfW26qln5kuMlGtSDUWbm5BsqAPwwD9spM1WhrIpT42lF8hZ2evZtSC7WuF/uUeAEVPBA+ 2Oo1lUZ2h7kRGQ==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1pWkjg-00044J-8u; Mon, 27 Feb 2023 16:08:40 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN> To: Maxim Cournoyer <maxim.cournoyer@HIDDEN> Subject: Re: bug#61841: =?utf-8?B?4oCYZ3VpeCBzaGVsbOKAmQ==?= computes different package derivation than =?utf-8?B?4oCYZ3VpeCBidWlsZOKAmQ==?= References: <20230203221409.15886-2-maxim.cournoyer@HIDDEN> <20230203221409.15886-3-maxim.cournoyer@HIDDEN> <877cwyw7yc.fsf@HIDDEN> <87h6w2p02y.fsf@HIDDEN> <87a61ilpi6.fsf_-_@HIDDEN> <87fsb5wso1.fsf@HIDDEN> <877cw85qtq.fsf_-_@HIDDEN> <87k003i1pu.fsf_-_@HIDDEN> <87bklfkqmb.fsf@HIDDEN> Date: Mon, 27 Feb 2023 22:08:37 +0100 In-Reply-To: <87bklfkqmb.fsf@HIDDEN> (Maxim Cournoyer's message of "Mon, 27 Feb 2023 11:41:32 -0500") Message-ID: <87r0uahl4a.fsf_-_@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61255 Cc: Josselin Poiret <dev@HIDDEN>, Christopher Baines <mail@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, 61255 <at> debbugs.gnu.org, 61841 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Maxim Cournoyer <maxim.cournoyer@HIDDEN> skribis: > Ludovic Court=C3=A8s <ludo@HIDDEN> writes: [...] >> Commit 68775338a510f84e63657ab09242d79e726fa457 turned out to have >> unintended side effects: >> >> https://issues.guix.gnu.org/61841 > > Ugh. > >> I fixed it with: >> >> a516a0ba93 gexp: computed-file: Do not honor %guile-for-build. >> fee1d08f0d pack: Make sure tests can run without a world rebuild. >> >> Please take a look. > > Thank you. I still think it'd be nicer if computed-file had a means to > honor %guile-for-build rather than having to accommodate it specially as > you did in fee1d08f0d, so that it'd be symmetrical to gexp->derivation > in that regard. Why can't they? Like I wrote, =E2=80=98default-guile=E2=80=99 returns a package whereas =E2=80=98%guile-for-build=E2=80=99 returns a derivation. The latter is inherently lower-level: it=E2=80=99s used together with the monadic interface or with plain =E2=80=98derivation=E2=80=99, when we know = which system we=E2=80=99re targeting. The former is higher-level, system-independent; it must be used for <computed-file> and similar forms, which are system-independent. Ludo=E2=80=99.
guix-patches@HIDDEN
:bug#61255
; Package guix-patches
.
Full text available.Received: (at 61255) by debbugs.gnu.org; 27 Feb 2023 16:41:45 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Feb 27 11:41:45 2023 Received: from localhost ([127.0.0.1]:48660 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pWgZN-0005Qr-2R for submit <at> debbugs.gnu.org; Mon, 27 Feb 2023 11:41:45 -0500 Received: from mail-qt1-f175.google.com ([209.85.160.175]:35532) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <maxim.cournoyer@HIDDEN>) id 1pWgZI-0005QQ-92; Mon, 27 Feb 2023 11:41:43 -0500 Received: by mail-qt1-f175.google.com with SMTP id y10so2656204qtj.2; Mon, 27 Feb 2023 08:41:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=60uXvIPRzk8bf7E1jGypoW3k03KmuRuepv2cqHrgdIw=; b=NcANEFdg/cSsspV/d8CUIZCxx8isgyRLLo/+bIJo5kCIdc0eQNlguOjMjy8gUlttap MS2bXJy6OcgXJBQk39VCZHXxPmDpufaugMxbdm9zyWXNOLIEZHJ1zeA9TWIr2zjeeUlq lE0KifU2U80N5+fu5dsdVJRx5x80il8hAfa9HOsEGjLtxnOpJf0jhj2LWRZa3EUnV82J K2ocIgI4yJqzzKepHdvE1i2KXmVm7trI8d7EbLgz4LkfYgUHmmc4f4TKOM2pBKstzK16 37BmDewXFlUhPXEND4iq+JTADbqFKlm0zvPnTUZ8u8Nt8N76XSbbwfDrNudIu6T1walC 0Wvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=60uXvIPRzk8bf7E1jGypoW3k03KmuRuepv2cqHrgdIw=; b=6rJgdrNkSLYqUd65eKWHgGc04DtE+6Yodp3OLwYV7PTHzbrMu/LZ5WsQ+qvQtEcRUe AgJDtQRLHgF7b4dJ5CzTPS18zu3BGE5upwH+vg94vRwQLLx3eFAqlr1MRHR/Ywd23w5R 7Lc6Jge9sGqOYZEoThmHzjHzYl085vZnBz1EQLHNYDqiEE06DWN8ro7Zwr85RIHEvpb/ qyEshVWBOazpwX6dC8opheEnaoK1whAU44sPojPeclqFcv1yvBZUFMwEQey/1tgsFWtM PVfv8S+eNTgz0g+w+OFnOHTkVka7bAf4j10LRMvpmW2TSBvNltl61doJMV7BCDZjeweU jQTw== X-Gm-Message-State: AO0yUKX4A1tGLo55cJvXnfRMaoJZwaKwCdCnoArOGZ70nMt8r+8yO1ZY hwMtPnmGs4MVi7cL7FwWLIePzllujD+5afhK X-Google-Smtp-Source: AK7set+xyJjH6CDnIX3fuhZVYpowrrsKaepx5Tp07wVD3kdMlgAA1cuzwErn7nFm/BqasmEtEoo47Q== X-Received: by 2002:a05:622a:1646:b0:3bf:d8e2:ab0e with SMTP id y6-20020a05622a164600b003bfd8e2ab0emr7556444qtj.23.1677516094412; Mon, 27 Feb 2023 08:41:34 -0800 (PST) Received: from hurd (dsl-156-86.b2b2c.ca. [66.158.156.86]) by smtp.gmail.com with ESMTPSA id z2-20020ac86b82000000b003bfbf16ad08sm4855697qts.74.2023.02.27.08.41.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 08:41:33 -0800 (PST) From: Maxim Cournoyer <maxim.cournoyer@HIDDEN> To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN> Subject: Re: bug#61255: [PATCH 0/5] Add support for the RPM format to "guix pack" References: <20230203221409.15886-2-maxim.cournoyer@HIDDEN> <20230203221409.15886-3-maxim.cournoyer@HIDDEN> <877cwyw7yc.fsf@HIDDEN> <87h6w2p02y.fsf@HIDDEN> <87a61ilpi6.fsf_-_@HIDDEN> <87fsb5wso1.fsf@HIDDEN> <877cw85qtq.fsf_-_@HIDDEN> <87k003i1pu.fsf_-_@HIDDEN> Date: Mon, 27 Feb 2023 11:41:32 -0500 In-Reply-To: <87k003i1pu.fsf_-_@HIDDEN> ("Ludovic =?utf-8?Q?Court=C3=A8s?= =?utf-8?Q?=22's?= message of "Mon, 27 Feb 2023 16:10:05 +0100") Message-ID: <87bklfkqmb.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61255 Cc: Josselin Poiret <dev@HIDDEN>, Christopher Baines <mail@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, 61255 <at> debbugs.gnu.org, 61841 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hi Ludovic, Ludovic Court=C3=A8s <ludo@HIDDEN> writes: > Hi Maxim, > > Ludovic Court=C3=A8s <ludo@HIDDEN> skribis: > >> I=E2=80=99m really not sure what the impact of >> 68775338a510f84e63657ab09242d79e726fa457 is, nor whether it was the only >> solution to the problem. >> >> One thing that probably happens is that (default-guile) is now never >> used for <computed-file>, contrary to what was happening before. The >> spirit is that (default-guile) would be used as the default for all the >> declarative file-like objects; gexp compilers refer to (default-guile), >> not (%guile-for-build). >> >> Importantly, (%guile-for-build) is a derivation, possibly built for >> another system, whereas (default-guile) is a package, which allows >> =E2=80=98lower-object=E2=80=99 to return the derivation for the right sy= stem type. > > Commit 68775338a510f84e63657ab09242d79e726fa457 turned out to have > unintended side effects: > > https://issues.guix.gnu.org/61841 Ugh. > I fixed it with: > > a516a0ba93 gexp: computed-file: Do not honor %guile-for-build. > fee1d08f0d pack: Make sure tests can run without a world rebuild. > > Please take a look. Thank you. I still think it'd be nicer if computed-file had a means to honor %guile-for-build rather than having to accommodate it specially as you did in fee1d08f0d, so that it'd be symmetrical to gexp->derivation in that regard. Why can't they? > We should think about how to improve our processes to avoid such issues > in the future. I did raise concerns about this very patch late at night > during FOSDEM, 24h after submission, and reaffirmed my viewpoint days > later. I understand that delaying a nice patch series like this one is > unpleasant, but I think those concerns should have been taken into > account. You are right, I should have delayed this submission passed its 2 weeks, to let some extra time to look at alternatives w.r.t. the %guile-for-build patch. Apologies for being too eager! --=20 Thanks, Maxim
guix-patches@HIDDEN
:bug#61255
; Package guix-patches
.
Full text available.Received: (at 61255) by debbugs.gnu.org; 27 Feb 2023 15:10:45 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Feb 27 10:10:45 2023 Received: from localhost ([127.0.0.1]:48585 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pWf9I-0006NA-QK for submit <at> debbugs.gnu.org; Mon, 27 Feb 2023 10:10:45 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50870) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1pWf9G-0006Mp-O4; Mon, 27 Feb 2023 10:10:43 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1pWf9A-0005c2-8h; Mon, 27 Feb 2023 10:10:36 -0500 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=wlY93+LO28tGvZhbQLUE3MuU9GHYfJDIwjGtp9AIJ5M=; b=a9TsVGtDV6HKbX4Dz62Z 4uLHg2yuW+Kgx25BBu6maib48xOQngcF0i4FrdqDykB04dZur3Sua4iurzx0RtizgYJenMu5LHIgQ 4KJCatBv69zdCLuUOoLAErJ8TVfL1XH1frf2hi2jqOFx2a84jxF+hJTrL8srjhxxcLg0xmYHQo6dF r6YBGIAf0zbL2QyXQPQPXBMK9iuOLmBF+NK5Di7F6LdqQ3zlY89LW7Xu/FveBHGaIS4XUNJrRmr22 BnunCHN/OB5VVgQx/ANFIPV/zyE8bV878R/IjXbYEzEov2vGHU7CJN+b0uGcDueVn13UtB3CzE7oM Xiq+k4wx0BlSkQ==; Received: from [193.50.110.164] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1pWf8i-0003Ir-Jg; Mon, 27 Feb 2023 10:10:32 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN> To: Maxim Cournoyer <maxim.cournoyer@HIDDEN> Subject: Re: bug#61255: [PATCH 0/5] Add support for the RPM format to "guix pack" References: <20230203221409.15886-2-maxim.cournoyer@HIDDEN> <20230203221409.15886-3-maxim.cournoyer@HIDDEN> <877cwyw7yc.fsf@HIDDEN> <87h6w2p02y.fsf@HIDDEN> <87a61ilpi6.fsf_-_@HIDDEN> <87fsb5wso1.fsf@HIDDEN> <877cw85qtq.fsf_-_@HIDDEN> Date: Mon, 27 Feb 2023 16:10:05 +0100 In-Reply-To: <877cw85qtq.fsf_-_@HIDDEN> ("Ludovic =?utf-8?Q?Court=C3=A8s?= =?utf-8?Q?=22's?= message of "Thu, 23 Feb 2023 16:44:49 +0100") Message-ID: <87k003i1pu.fsf_-_@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61255 Cc: Josselin Poiret <dev@HIDDEN>, Christopher Baines <mail@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, 61255 <at> debbugs.gnu.org, 61841 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Hi Maxim, Ludovic Court=C3=A8s <ludo@HIDDEN> skribis: > I=E2=80=99m really not sure what the impact of > 68775338a510f84e63657ab09242d79e726fa457 is, nor whether it was the only > solution to the problem. > > One thing that probably happens is that (default-guile) is now never > used for <computed-file>, contrary to what was happening before. The > spirit is that (default-guile) would be used as the default for all the > declarative file-like objects; gexp compilers refer to (default-guile), > not (%guile-for-build). > > Importantly, (%guile-for-build) is a derivation, possibly built for > another system, whereas (default-guile) is a package, which allows > =E2=80=98lower-object=E2=80=99 to return the derivation for the right sys= tem type. Commit 68775338a510f84e63657ab09242d79e726fa457 turned out to have unintended side effects: https://issues.guix.gnu.org/61841 I fixed it with: a516a0ba93 gexp: computed-file: Do not honor %guile-for-build. fee1d08f0d pack: Make sure tests can run without a world rebuild. Please take a look. We should think about how to improve our processes to avoid such issues in the future. I did raise concerns about this very patch late at night during FOSDEM, 24h after submission, and reaffirmed my viewpoint days later. I understand that delaying a nice patch series like this one is unpleasant, but I think those concerns should have been taken into account. Ludo=E2=80=99.
guix-patches@HIDDEN
:bug#61255
; Package guix-patches
.
Full text available.Received: (at 61255) by debbugs.gnu.org; 24 Feb 2023 02:38:33 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 23 21:38:33 2023 Received: from localhost ([127.0.0.1]:35680 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pVNyi-0003ai-LR for submit <at> debbugs.gnu.org; Thu, 23 Feb 2023 21:38:33 -0500 Received: from mail-qv1-f50.google.com ([209.85.219.50]:37504) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <maxim.cournoyer@HIDDEN>) id 1pVNyg-0003aQ-SF for 61255 <at> debbugs.gnu.org; Thu, 23 Feb 2023 21:38:31 -0500 Received: by mail-qv1-f50.google.com with SMTP id y3so12702648qvn.4 for <61255 <at> debbugs.gnu.org>; Thu, 23 Feb 2023 18:38:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=lf6vOz67lv/lBor+vQ36EzgOGj1KE0cROmj21XQxYZ8=; b=jDjzbM560tjljVzg9fjmJX/LO7+awQZaudxV3oDxfIE6xbP8O8lvuS/M/WzxwejGww dXxDbDFFSSpFllzoh6SAHR6tgZYVr4Qr5plgfQ/5GAAut02FD0t7c4VO7qmsuJxM9b3n bpDaQVxotfwtVGj7t/+PBAlNDKiDtmzYYIxOr7zGZX1pvGErP9MCgIe7HEyk4wZuRNzA yNW7nzBcrhBws48JLU7aB19imHqB+E0u88OejQ6T29XfXXMKyJ5BtmqsQU2O+1peQ/+y 9EKc8v4WAwQqgiVmjx+wo6aWtcclrhr/SyqRnLx+Ewlg/1ph6ygia9Uncz2zFSy/BwXd fz4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=lf6vOz67lv/lBor+vQ36EzgOGj1KE0cROmj21XQxYZ8=; b=ABCc7D5PNkWBNLz9ccqLcpUcM0c4XtWKlLxOu+lFp2zcQ9Bt21BGmrEXUQfiaaN/He wC4erVPJk5NlZxheWyZf6L4rgPsvmlRsgaONDQPAhGN9xF3kIRX1i3JaX7k/37usUisH Gywv2TvhxYXOJpc2unx/h8ZccbmfexW5swOIfO9yhXleRZSAyPxR2cSSduljsINDQN0c wIZUj9VOQYsOBIaCylsZ+K7ayACD00ExxCdzzJQR7xm0ipl5cAcdlFr+i/bPbmGALnMm n7nNPeVYkb9cZTEKtQ6ACniEjNKWQQRrxPEq2gmPFM+Hb9J80WvZqQV4qh/W+wkuUqbM ZkDw== X-Gm-Message-State: AO0yUKWszpcpt4eMK/2IxKp29ECqOh5gfbG/13x8TXwzr0EPE2xVNpQx wp2LIetQ9j4Ge6o7+0nGJDt7uxqGDqjNrPDz X-Google-Smtp-Source: AK7set/bsp8YUjGhH/UIwgggM0gUXmO+bFSt5CSye9LSQQBbShgbSfrsLzTWWhh1V4ET/+uU8OCw2g== X-Received: by 2002:a05:6214:4118:b0:56b:7cb:bdcd with SMTP id kc24-20020a056214411800b0056b07cbbdcdmr24436103qvb.39.1677206304913; Thu, 23 Feb 2023 18:38:24 -0800 (PST) Received: from hurd (dsl-10-129-1.b2b2c.ca. [72.10.129.1]) by smtp.gmail.com with ESMTPSA id x191-20020a3763c8000000b007402fdda195sm8043592qkb.123.2023.02.23.18.38.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Feb 2023 18:38:24 -0800 (PST) From: Maxim Cournoyer <maxim.cournoyer@HIDDEN> To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN> Subject: Re: (%guile-for-build) default in =?utf-8?Q?=E2=80=98computed-fil?= =?utf-8?Q?e=E2=80=99?= References: <20230203221409.15886-2-maxim.cournoyer@HIDDEN> <20230203221409.15886-3-maxim.cournoyer@HIDDEN> <877cwyw7yc.fsf@HIDDEN> <87h6w2p02y.fsf@HIDDEN> <87a61ilpi6.fsf_-_@HIDDEN> <87fsb5wso1.fsf@HIDDEN> <877cw85qtq.fsf_-_@HIDDEN> Date: Thu, 23 Feb 2023 21:38:22 -0500 In-Reply-To: <877cw85qtq.fsf_-_@HIDDEN> ("Ludovic =?utf-8?Q?Court=C3=A8s?= =?utf-8?Q?=22's?= message of "Thu, 23 Feb 2023 16:44:49 +0100") Message-ID: <87leknhjoh.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61255 Cc: Josselin Poiret <dev@HIDDEN>, Christopher Baines <mail@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, 61255 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hi Ludovic, Ludovic Court=C3=A8s <ludo@HIDDEN> writes: > Hello! > > Maxim Cournoyer <maxim.cournoyer@HIDDEN> skribis: > >> Hi Ludovic! >> >> Ludovic Court=C3=A8s <ludo@HIDDEN> writes: >> >>> Hi Maxim, >>> >>> Maxim Cournoyer <maxim.cournoyer@HIDDEN> skribis: >>> >>>> Ludovic Court=C3=A8s <ludo@HIDDEN> writes: >>>> >>>>> Hello! >>>>> >>>>> Maxim Cournoyer <maxim.cournoyer@HIDDEN> skribis: >>>>> >>>>>> * guix/gexp.scm (computed-file): Set the default value of the #:guil= e argument >>>>>> to that of the %guile-for-build parameter. >>>>> >>>>> [...] >>>>> >>>>>> (define* (computed-file name gexp >>>>>> - #:key guile (local-build? #t) (options '())) >>>>>> + #:key (guile (%guile-for-build)) >>>>>> + (local-build? #t) (options '())) >>>>> >>>>> I think that would lead =E2=80=98computed-file=E2=80=99 to pick (%gui= le-for-build) at >>>>> the wrong time (time of call instead of time of lowering). >>>>> >>>>> Commit ab25eb7caaf5571cc9f8d6397a1eae127d7e29d1 made it #f such that >>>>> =E2=80=98gexp->derivation=E2=80=99 gets to resolve it at the =E2=80= =9Cright=E2=80=9D time. >>>> >>>> I see! I think you are right. Would making the change in the >>>> associated gexp compiler do the right thing? Currently it ignores the >>>> %guile-for-build fluid as set in the tests/pack.scm test suite for >>>> example. Something like this: >>> >>> I don=E2=80=99t fully understand the context. My preference would go t= o doing >>> like the =E2=80=98computed-file=E2=80=99 tests in =E2=80=98tests/gexp.s= cm=E2=80=99, where we explicitly >>> pass #:guile %bootstrap-guile. >> >> With the refactoring done in patch 3/5 ("pack: Extract >> populate-profile-root from self-contained-tarball/builder."), a >> computed-file is used in the factorized building block >> 'populate-profile-root'. Without this patch, the tests making use of it >> would attempt to build Guile & friends in the test store. >> >>> That said, it seems like patch #5 in this series doesn=E2=80=99t actual= ly use >>> =E2=80=98computed-file=E2=80=99 in =E2=80=98tests/pack.scm=E2=80=99, do= es it? >> >> It does, indirectly. >> >> I hope that helps! > > I=E2=80=99m really not sure what the impact of > 68775338a510f84e63657ab09242d79e726fa457 is, nor whether it was the only > solution to the problem. > > One thing that probably happens is that (default-guile) is now never > used for <computed-file>, contrary to what was happening before. The > spirit is that (default-guile) would be used as the default for all the > declarative file-like objects; gexp compilers refer to (default-guile), > not (%guile-for-build). > > Importantly, (%guile-for-build) is a derivation, possibly built for > another system, whereas (default-guile) is a package, which allows > =E2=80=98lower-object=E2=80=99 to return the derivation for the right sys= tem type. I assumed the purpose of the %guile-for-build fluid was to override the value of the guile used in some conditions, such as during tests (e.g. the '(set-guile-for-build (default-guile))' calls inside the store monad in tests/pack.scm). It's honored for gexp->derivation, but isn't honored for computed-file, which is supposed to be its declarative counterpart. This problem was only exposed when factoring out 'populate-profile-root' as a computed-file object in 68380db4c40a2ee1156349a87254fd7b1f1a52d5 ("pack: Extract populate-profile-root from self-contained-tarball/builder.") > Overall, I think this change should be reverted but of course, we should > find a solution to the problem you hit in the first place. > > I hope this makes sense to you. See the problem it solves below. If we revert this now, we'd have to mark the 'self-contained-tarball' as an expected fail until we find a a better solution. The problem it solves is this: after reverting the change with: > modified guix/gexp.scm > @@ -601,7 +601,7 @@ (define-gexp-compiler (computed-file-compiler (file <= computed-file>) > ;; gexp. > (match file > (($ <computed-file> name gexp guile options) > - (mlet %store-monad ((guile (lower-object (or guile (%guile-for-buil= d) > + (mlet %store-monad ((guile (lower-object (or guile ;(%guile-for-bui= ld) > (default-guile)) > system #:target #f))) > (apply gexp->derivation name gexp #:guile-for-build guile Running the pack.scm tests: $ make check TESTS=3Dtests/pack.scm Fails with a timeout, because the %guile-for-build is not honored by a computed-file derivation, and it goes on building the non-bootstrap build-side guile, gcc, etc. in the test store (see: pack.log): --8<---------------cut here---------------start------------->8--- gcc-10.3.0/gcc/targhooks.h gcc-10.3.0/gcc/testsuite/ gcc-10.3.0/gcc/testsuite/.gitattributes gcc-10.3.0/gcc/testsuite/ChangeLog gcc-10.3.0/gcc/testsuite/ChangeLog-1993-2007 gcc-10.3.0/gcc/testsuite/ChangeLog-2008 gcc-10.3.0/gcc/testsuite/ChangeLog-2009 gcc-10.3.0/gcc/testsuite/ChangeLog-2010 gcc-10.3.0/gcc/testsuite/ChangeLog-2011 gcc-10.3.0/gcc/testsuite/ChangeLog-2012 gcc-10.3.0/gcc/testsuite/ChangeLog-2013 gcc-10.3.0/gcc/testsuite/ChangeLog-2014 gcc-10.3.0/gcc/testsuite/ChangeLog-2015 gcc-10.3.0/gcc/testsuite/ChangeLog-2016 gcc-10.3.0/gcc/testsuite/ChangeLog-2017 gcc-10.3.0/gcc/testsuite/ChangeLog-2018 building of `/home/maxim/src/guix/test-tmp/store/hp86j4850ajphhs1hyryis5nj9= 3pv66l-gcc-10.3.0.tar.xz.drv' timed out after 300 seconds @ build-failed /home/maxim/src/guix/test-tmp/store/hp86j4850ajphhs1hyryis5n= j93pv66l-gcc-10.3.0.tar.xz.drv - timeout killing process 4149 cannot build derivation `/home/maxim/src/guix/test-tmp/store/82yb9zwxdwhmac= z36pjrrzzmgjgakavy-gcc-10.3.0.drv': 1 dependencies couldn't be built @ build-started /home/maxim/src/guix/test-tmp/store/8dfjl4594zgb7wi3icw8s9z= 3rr3pck6x-gcc-4.9.4.tar.xz.drv - x86_64-linux /home/maxim/src/guix/test-tmp= /var/log/guix/drvs/8d//fjl4594zgb7wi3icw8s9z3rr3pck6x-gcc-4.9.4.tar.xz.drv.= gz 4611 cannot build derivation `/home/maxim/src/guix/test-tmp/store/hcv6vh1gx5fkw6= 2l3nravi1aqhi8cq60-gcc-cross-boot0-10.3.0.drv': 1 dependencies couldn't be = built killing process 4611 cannot build derivation `/home/maxim/src/guix/test-tmp/store/1ihb1yadv4dfbq= hfcgn1cyvsl8444yaw-guile-3.0.7.drv': 1 dependencies couldn't be built cannot build derivation `/home/maxim/src/guix/test-tmp/store/6g7fhyr1b84b5q= g8nwn46hkrg55i8c2q-profile-directory.drv': 1 dependencies couldn't be built cannot build derivation `/home/maxim/src/guix/test-tmp/store/apm8bjvzs1n707= lagw0spzr2m2nc0p4v-pack.tar.gz.drv': 1 dependencies couldn't be built cannot build derivation `/home/maxim/src/guix/test-tmp/store/syiq7lmx3v0pkr= jp5wqd5kfapqpxpki3-check-tarball.drv': 1 dependencies couldn't be built test-name: self-contained-tarball location: /home/maxim/src/guix/tests/pack.scm:80 source: + (test-assert + "self-contained-tarball" + (let ((guile (package-derivation %store %bootstrap-guile))) + (run-with-store + %store + (mlet* %store-monad + ((profile + -> + (profile + (content + (packages->manifest (list %bootstrap-guile))) + (hooks '()) + (locales? #f))) + (tarball + (self-contained-tarball + "pack" + profile + #:symlinks + '(("/bin/Guile" -> "bin/guile")) + #:compressor + %gzip-compressor + #:archiver + %tar-bootstrap)) + (check (gexp->derivation + "check-tarball" + (with-imported-modules + '((guix build utils)) + (gexp (begin + (use-modules + (guix build utils) + (srfi srfi-1)) + (define store + (string-append + "." + (%store-directory) + "/")) + (define (canonical? file) + (let ((st (lstat file))) + (or (not (string-prefix? store file)) + (eq? 'symlink (stat:type st)) + (and (=3D 1 (stat:mtime st)) + (zero? (logand + 146 + (stat:mode st)))))= )) + (define bin + (string-append + "." + (ungexp profile) + "/bin")) + (setenv + "PATH" + (string-append + (ungexp %tar-bootstrap) + "/bin")) + (system* "tar" "xvf" (ungexp tarball)) + (mkdir (ungexp output)) + (exit (and (file-exists? + (string-append bin "/guile"= )) + (file-exists? store) + (every canonical? + (find-files + "." + (const #t) + #:directories? + #t)) + (string=3D? + (string-append + (ungexp %bootstrap-guile) + "/bin") + (readlink bin)) + (string=3D? + (string-append + ".." + (ungexp profile) + "/bin/guile") + (readlink "bin/Guile"))))))= )))) + (built-derivations (list check))) + #:guile-for-build + guile))) actual-value: #f actual-error: + (%exception + #<&store-protocol-error message: "build of `/home/maxim/src/guix/test-t= mp/store/syiq7lmx3v0pkrjp5wqd5kfapqpxpki3-check-tarball.drv' failed" status= : 101>) result: FAIL --8<---------------cut here---------------end--------------->8--- --=20 Thanks, Maxim
guix-patches@HIDDEN
:bug#61255
; Package guix-patches
.
Full text available.Received: (at 61255) by debbugs.gnu.org; 23 Feb 2023 15:47:30 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 23 10:47:30 2023 Received: from localhost ([127.0.0.1]:35028 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pVDog-0000ci-2C for submit <at> debbugs.gnu.org; Thu, 23 Feb 2023 10:47:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42504) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1pVDoe-0000cU-4b for 61255 <at> debbugs.gnu.org; Thu, 23 Feb 2023 10:47:28 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1pVDoY-0001nn-N0; Thu, 23 Feb 2023 10:47:22 -0500 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=itOqiUrLhwgQwGk/Fods00lxyt9YKJrSyjtpBkfxlZ0=; b=NNRhwq6pIL+bTy7cHrOD HHPUcjUIJ+rOKMAwo9QFJ+EZvBnIW14pCOIFN/rh/3yU0itHSj/0plJjVbVJjVBoY7B5JkSOa31yn wmbYh3Enlp5SUlZR+IHvPRfLslVadLtEz4V23t4z1iGmItit/B/LzLbgIACweHz2oAThm7yerGZkC ANiHfR/fNlc4iDYglCI12zexylSL9kD+6F72+oX1jhVdbQim8EZMOrbZ1neI8HPuNCJG3SdA1V7lY p58PB4dxYEoJv1ZYqVXBqpy7l89FvNacS/MWwVuO2Stm+Dn7cVFHNQ1Mu5qmpm0QSV1px5/wROR0N Sp9TaC5kWRj2mQ==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1pVDoY-0004sR-91; Thu, 23 Feb 2023 10:47:22 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN> To: Maxim Cournoyer <maxim.cournoyer@HIDDEN> Subject: Re: bug#61255: [PATCH 0/5] Add support for the RPM format to "guix pack" References: <20230203221409.15886-2-maxim.cournoyer@HIDDEN> <20230203221409.15886-5-maxim.cournoyer@HIDDEN> <87357alp9n.fsf_-_@HIDDEN> <878rgxws6l.fsf@HIDDEN> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Quintidi 5 =?utf-8?Q?Vent=C3=B4se?= an 231 de la =?utf-8?Q?R=C3=A9volution=2C?= jour du Bouc X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Thu, 23 Feb 2023 16:47:20 +0100 In-Reply-To: <878rgxws6l.fsf@HIDDEN> (Maxim Cournoyer's message of "Thu, 16 Feb 2023 10:22:58 -0500") Message-ID: <871qmg5qpj.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61255 Cc: 61255 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Hi, Maxim Cournoyer <maxim.cournoyer@HIDDEN> skribis: > Ludovic Court=C3=A8s <ludo@HIDDEN> writes: > >> Hi, >> >> Maxim Cournoyer <maxim.cournoyer@HIDDEN> skribis: >> >>> * tests/pack.scm: Fix indentation. >> >> [...] >> >>> (check (gexp->derivation >>> - "check-tarball" >>> - (with-imported-modules '((guix build utils)) >> >> [...] >> >>> + "check-tarball" >>> + (with-imported-modules '((guix build utils)) >> >> I=E2=80=99m not convinced by the indentation rule for =E2=80=98gexp->der= ivation=E2=80=99 added >> in 82daab42811a2e3c7684ebdf12af75ff0fa67b99: there=E2=80=99s no reason t= o treat >> =E2=80=98gexp->derivation=E2=80=99 differently from other procedures. > > The benefit I saw was that writing > > (gexp->derivation the-name > #~(begin > (the > (multi-line > (gexp))))) I understand, but you know, it=E2=80=99s best to avoid unilaterally changing established conventions. :-) If and when there=E2=80=99s consensus about this change, (guix read-print) should be updated. Ludo=E2=80=99.
guix-patches@HIDDEN
:bug#61255
; Package guix-patches
.
Full text available.Received: (at 61255) by debbugs.gnu.org; 23 Feb 2023 15:45:02 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 23 10:45:02 2023 Received: from localhost ([127.0.0.1]:35020 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pVDmI-0000Yl-0q for submit <at> debbugs.gnu.org; Thu, 23 Feb 2023 10:45:02 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50686) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1pVDmG-0000Y0-Al for 61255 <at> debbugs.gnu.org; Thu, 23 Feb 2023 10:45:01 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1pVDm9-0008DR-Fw; Thu, 23 Feb 2023 10:44:53 -0500 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=3UzwHy8EinxyHPlSzawyIExd9uUHcyPKbZnezqjed3w=; b=fUZje+A4K76siCJ4lwdB cxwasYy1EH71e69gAy84M6o3D6vMWXigIUK60TS+/pOyWQ4Xjmh5qCFmU1k/2Ik4PDvAv7Qmsge4b KINeeG3Y7ZgFgvWk4dkukXhe8iBWrjmqagk30oYluVFRYKLhst1KSPNfqOrYg77EE//8k/nvcECFb MlM0J9+BpBMAFGBL5/iK3fc1XzxNcWzf4MHEOrc6BIBPR+2Eruwer03DZjKVn78eQHqOvSwdCX/Bt hX97BVQL+GiFX5xMlQg7tnusRh4gTpyNcBr3kTUU2+QexqSF+NOMkNEX9gY5BhxMj2M/xTbhwFak4 YfYCb8/VDK8juQ==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1pVDm8-0004WL-K9; Thu, 23 Feb 2023 10:44:52 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN> To: Maxim Cournoyer <maxim.cournoyer@HIDDEN> Subject: (%guile-for-build) default in =?utf-8?Q?=E2=80=98computed-file?= =?utf-8?Q?=E2=80=99?= References: <20230203221409.15886-2-maxim.cournoyer@HIDDEN> <20230203221409.15886-3-maxim.cournoyer@HIDDEN> <877cwyw7yc.fsf@HIDDEN> <87h6w2p02y.fsf@HIDDEN> <87a61ilpi6.fsf_-_@HIDDEN> <87fsb5wso1.fsf@HIDDEN> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Quintidi 5 =?utf-8?Q?Vent=C3=B4se?= an 231 de la =?utf-8?Q?R=C3=A9volution=2C?= jour du Bouc X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Thu, 23 Feb 2023 16:44:49 +0100 In-Reply-To: <87fsb5wso1.fsf@HIDDEN> (Maxim Cournoyer's message of "Thu, 16 Feb 2023 10:12:30 -0500") Message-ID: <877cw85qtq.fsf_-_@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61255 Cc: Josselin Poiret <dev@HIDDEN>, Christopher Baines <mail@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, 61255 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Hello! Maxim Cournoyer <maxim.cournoyer@HIDDEN> skribis: > Hi Ludovic! > > Ludovic Court=C3=A8s <ludo@HIDDEN> writes: > >> Hi Maxim, >> >> Maxim Cournoyer <maxim.cournoyer@HIDDEN> skribis: >> >>> Ludovic Court=C3=A8s <ludo@HIDDEN> writes: >>> >>>> Hello! >>>> >>>> Maxim Cournoyer <maxim.cournoyer@HIDDEN> skribis: >>>> >>>>> * guix/gexp.scm (computed-file): Set the default value of the #:guile= argument >>>>> to that of the %guile-for-build parameter. >>>> >>>> [...] >>>> >>>>> (define* (computed-file name gexp >>>>> - #:key guile (local-build? #t) (options '())) >>>>> + #:key (guile (%guile-for-build)) >>>>> + (local-build? #t) (options '())) >>>> >>>> I think that would lead =E2=80=98computed-file=E2=80=99 to pick (%guil= e-for-build) at >>>> the wrong time (time of call instead of time of lowering). >>>> >>>> Commit ab25eb7caaf5571cc9f8d6397a1eae127d7e29d1 made it #f such that >>>> =E2=80=98gexp->derivation=E2=80=99 gets to resolve it at the =E2=80=9C= right=E2=80=9D time. >>> >>> I see! I think you are right. Would making the change in the >>> associated gexp compiler do the right thing? Currently it ignores the >>> %guile-for-build fluid as set in the tests/pack.scm test suite for >>> example. Something like this: >> >> I don=E2=80=99t fully understand the context. My preference would go to= doing >> like the =E2=80=98computed-file=E2=80=99 tests in =E2=80=98tests/gexp.sc= m=E2=80=99, where we explicitly >> pass #:guile %bootstrap-guile. > > With the refactoring done in patch 3/5 ("pack: Extract > populate-profile-root from self-contained-tarball/builder."), a > computed-file is used in the factorized building block > 'populate-profile-root'. Without this patch, the tests making use of it > would attempt to build Guile & friends in the test store. > >> That said, it seems like patch #5 in this series doesn=E2=80=99t actuall= y use >> =E2=80=98computed-file=E2=80=99 in =E2=80=98tests/pack.scm=E2=80=99, doe= s it? > > It does, indirectly. > > I hope that helps! I=E2=80=99m really not sure what the impact of 68775338a510f84e63657ab09242d79e726fa457 is, nor whether it was the only solution to the problem. One thing that probably happens is that (default-guile) is now never used for <computed-file>, contrary to what was happening before. The spirit is that (default-guile) would be used as the default for all the declarative file-like objects; gexp compilers refer to (default-guile), not (%guile-for-build). Importantly, (%guile-for-build) is a derivation, possibly built for another system, whereas (default-guile) is a package, which allows =E2=80=98lower-object=E2=80=99 to return the derivation for the right syste= m type. Overall, I think this change should be reverted but of course, we should find a solution to the problem you hit in the first place. I hope this makes sense to you. Ludo=E2=80=99.
guix-patches@HIDDEN
:bug#61255
; Package guix-patches
.
Full text available.Received: (at 61255-done) by debbugs.gnu.org; 20 Feb 2023 02:25:16 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sun Feb 19 21:25:16 2023 Received: from localhost ([127.0.0.1]:50065 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pTvrg-0007KF-A1 for submit <at> debbugs.gnu.org; Sun, 19 Feb 2023 21:25:16 -0500 Received: from mail-qt1-f174.google.com ([209.85.160.174]:43918) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <maxim.cournoyer@HIDDEN>) id 1pTvrd-0007Jy-QK for 61255-done <at> debbugs.gnu.org; Sun, 19 Feb 2023 21:25:14 -0500 Received: by mail-qt1-f174.google.com with SMTP id l5so1077313qtp.10 for <61255-done <at> debbugs.gnu.org>; Sun, 19 Feb 2023 18:25:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=PSz1tnRh8vf+nAqf0MbchUpePjIm7gqn24M402LD6w8=; b=D0JLzjbMl+FGlUvyM3lccRkj4Bxi6cB8lqJjIm6qZWNz45saPQltdthKY279m9gboi 72n9pqNMMz4Dsx26FaiezIrY2dlQ3Nfz83hECIHYorNDjIXIsmM1RqqUyMlFwGL1HVTM VKxXlwhjCO0cLVz1b6Lwwn7MBIWTgyKiHW/sMaqPF68L6ry+BK4DcEWeSj3rdnSl/XKI pi7CHgupm4Mz6vGXye6BDcgg9gZ+ne1zW6DWlluVVccEYqVi+3CkxIMbQi2cTvu6kaCq ky2uQS+Ie09xfU/wYztL5+fCp0AMH5Uaoc4TTDJW1jw7V0Hr/XtHRsx2dFf26ZY+Fkvy oxCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=PSz1tnRh8vf+nAqf0MbchUpePjIm7gqn24M402LD6w8=; b=JCSNbt/VvQ2jN0pTbcQFMcUTHFYfoXF24929+25LwtjaCcB6hLy8cKcWfnkFaZkaGK 2Rf4d8oDl+z4yQ/ZhUgohJAM1egCJIlO/E8H4EIG1tVMQucfU27DsVjy7VhqAuJqVQL7 f24Ajdclc/1+MnoCeg61m66oCTGLKm1/cvWkeEtli6XTSidKyqFe81SSOMZXqn6iZ2rI TAxEvfLIbR7l6VUmQkEi7h0bDW7SrsqhN+hVNyYQHwkz/He63++9A9iu1fkyTyOBxVvv w78J/Yck4DtUWV/OT92Ta6HTKPQoIOdfX6Elf4SYqrnkPq/WowuqDPa4oc698NGBJO6b 02/w== X-Gm-Message-State: AO0yUKWGqisWdoKXDzFyFVON8ta+S0FWCQe2gBIVMrGvleZvp1KAW4UV TMF3550O3LzfV7kFLCoUvsCeOFa7CL0SXQ== X-Google-Smtp-Source: AK7set/gVQ9uI+VMP4TdjOizayB/ofX1tVmWHN60tridGTAZPOG/QC56VXINoOEitvzPSzTthe9eBw== X-Received: by 2002:a05:622a:87:b0:3b9:d1c1:6da6 with SMTP id o7-20020a05622a008700b003b9d1c16da6mr11535549qtw.7.1676859907818; Sun, 19 Feb 2023 18:25:07 -0800 (PST) Received: from hurd (dsl-158-213.b2b2c.ca. [66.158.158.213]) by smtp.gmail.com with ESMTPSA id b11-20020ac84f0b000000b003b86d3ee49asm7975578qte.74.2023.02.19.18.25.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Feb 2023 18:25:07 -0800 (PST) From: Maxim Cournoyer <maxim.cournoyer@HIDDEN> To: "pelzflorian (Florian Pelz)" <pelzflorian@HIDDEN> Subject: Re: [bug#61255] [PATCH v2 8/8] news: Add entry for the new 'rpm' guix pack format. References: <87cz672y2f.fsf@HIDDEN> Date: Sun, 19 Feb 2023 21:25:05 -0500 In-Reply-To: <87cz672y2f.fsf@HIDDEN> (pelzflorian@HIDDEN's message of "Sat, 18 Feb 2023 09:10:48 +0100") Message-ID: <87mt59m5tq.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61255-done Cc: 61255-done <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hi, "pelzflorian (Florian Pelz)" <pelzflorian@HIDDEN> writes: > This message was not accepted by Gmail, it reports SPF/DKIM error, so I > resend. Well received! > Hi Maxim! Two things. First, could you include this German > translation? > >> (title >> (en "New @samp{rpm} format for the @command{guix pack} command")) > > (de "Neues Format @samp{rpm} f=C3=BCr den Befehl @command{guix pack}") > > >> (body >> (en "RPM archives (with the .rpm file extension) can now be produced > > (de "Sie k=C3=B6nnen jetzt auch RPM-Archive (mit der Dateinamenserweiteru= ng > .rpm) erzeugen mit dem Befehl @command{guix pack --format=3Drpm}. Damit > haben Sie einen alternativen Distributionsweg f=C3=BCr mit Guix erstellte > Software. Hier sehen Sie ein einfaches Beispiel, wie Sie ein > RPM-Archiv f=C3=BCr das Paket @code{hello} erzeugen: > > @example > guix pack --format=3Drpm --symlink=3D/usr/bin/hello=3Dbin/hello hello > @end example > > Siehe @command{info \"(guix.de) Aufruf von guix pack\"} f=C3=BCr mehr > Informationen.") Done, thank you! > =E2=80=94Other than that, I just tried using your patch to make hello.rpm= as in > the news example and to make another advent.rpm with open-adventure. To > my surprise, I could install both (on a fresh install of Fedora Server > x86_64 without Guix installed), even though hello and open-adventure > both reference /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33. > > From reading your documentation, I had not expected this. Perhaps you > should mention that it is possible to both run `sudo rpm -i hello.rpm` > and `sudo rpm -i advent.rpm` and it does not conflict? Thanks for sharing your feedback! I could reproduce the experiment in an old RHEL VM, and indeed, identical files do not seem to cause conflicts, which is awesome for our use case! I've modified the doc as follow: --8<---------------cut here---------------start------------->8--- modified doc/guix.texi @@ -6940,8 +6940,7 @@ RPM archive, for example. =20 The RPM format supports relocatable packages via the @option{--prefix} option of the @command{rpm} command, which can be handy to install an -RPM package to a specific prefix, making installing multiple -Guix-produced RPM packages side by side possible. +RPM package to a specific prefix. =20 @example guix pack -f rpm -R -C xz -S /usr/bin/hello=3Dbin/hello hello @@ -6952,11 +6951,10 @@ sudo rpm --install --prefix=3D/opt /gnu/store/...-h= ello.rpm @end example =20 @quotation Note -Similarly to Debian packages, two RPM packages with conflicting files -cannot be installed simultaneously. Contrary to Debian packages, RPM -supports relocatable packages, so file conflicts can be avoided by -installing the RPM packages under different installation prefixes, as -shown in the above example. +Contrary to Debian packages, conflicting but @emph{identical} files in +RPM packages can be installed simultaneously, which means multiple +@command{guix pack}-produced RPM packages can usually be installed side +by side without any problem. @end quotation =20 @quotation Warning --8<---------------cut here---------------end--------------->8--- =20 With this, I've now pushed the series to master, after running 'make check TESTS=3D"tests/rpm.scm tests/pack.scm"' one last time. Enjoy! Closing. --=20 Thanks, Maxim
Maxim Cournoyer <maxim.cournoyer@HIDDEN>
:Maxim Cournoyer <maxim.cournoyer@HIDDEN>
:Received: (at 61255) by debbugs.gnu.org; 17 Feb 2023 17:32:28 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 17 12:32:28 2023 Received: from localhost ([127.0.0.1]:41495 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pT4ay-0002r1-2n for submit <at> debbugs.gnu.org; Fri, 17 Feb 2023 12:32:28 -0500 Received: from mail-qt1-f182.google.com ([209.85.160.182]:33598) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <maxim.cournoyer@HIDDEN>) id 1pT4av-0002qn-Rl for 61255 <at> debbugs.gnu.org; Fri, 17 Feb 2023 12:32:26 -0500 Received: by mail-qt1-f182.google.com with SMTP id bc7so1376426qtb.0 for <61255 <at> debbugs.gnu.org>; Fri, 17 Feb 2023 09:32:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=VRfbtcaaNAy3rOoElyR9zgC3P6pGajhcwPJ7+flzF1g=; b=LRCx2Oc0AIxxIXZe4HAjcycUcKhka+tT9TihyhkKLdaass9l4P9UamQxsQ7UxWKjE0 B9HbY+dE+9O5Uj+aojyrUZTrsTVSp4skA8IyZ/9PjChKXR5yP55tuATXWsS39JiYULN7 5diOd+EE6k6fWuDVyOyNIOTdaoOc8Jy/dxoJSjKo5b5X4e6qfPTDX9jCNMB62cnU18hE kjxu97Cz9z2k5TLgkzF2aU3vYpsSxhfMwwSlh+KHblaMtw8B/a5TpmeDZSJ5oxFzIjrG /H0SCW6Y3/Y19wOh3gwovj/HNtp+d1cR8FWV+0hl470EBfz19kKknDiFupv4dYf1+V0+ J7kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=VRfbtcaaNAy3rOoElyR9zgC3P6pGajhcwPJ7+flzF1g=; b=d88Gf7hrPArEkgmzZiTn+dFgQKglpLBNgfAOwi1mC4Fj4LsBXcoFOFsH0+m/QgBFce RUtAs4fmFKsGQmKdzjYm08VbYYKmAXF0I3cVY6pt7jii+l73J/TNG00AYH88ziOolXwY sfZJE4/SzayQoZSBBjAU/FB/hrVKRkOZ6OommvZXeBks7GQBZg0FpYW2Wm99Xh1BLhA4 pucd8L21fnui6jvCNBTzLvtCMy2MVlgvuJ9m5/wFYFeHphXR9krErlOPm7uieIczFg0p Lc86K3+TeQOieNo9TyNjU+spUzLz6vfJAqvJBBEiCVYKaZz+zvVL20Et87kZ01UrFdrO xWUg== X-Gm-Message-State: AO0yUKVefT3tdo5MgQ+7Tih0OAVFb1kx6Oa2f0esqybOWPNitqlByDeM Oyx6fz4lOVsOf42CMl+24XQ= X-Google-Smtp-Source: AK7set9n60j/AdUiCpYQ649qGFg1r3a6ueuNyYcKqUzu9PRv7yXasThNcFAtlcMtE36flRAYf8ffXA== X-Received: by 2002:a05:622a:1051:b0:3b8:2ce4:3e9 with SMTP id f17-20020a05622a105100b003b82ce403e9mr3930058qte.32.1676655140224; Fri, 17 Feb 2023 09:32:20 -0800 (PST) Received: from hurd (dsl-157-123.b2b2c.ca. [66.158.157.123]) by smtp.gmail.com with ESMTPSA id r9-20020ac85c89000000b003b869f71eedsm3619142qta.66.2023.02.17.09.32.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Feb 2023 09:32:19 -0800 (PST) From: Maxim Cournoyer <maxim.cournoyer@HIDDEN> To: Julien Lepiller <julien@HIDDEN> Subject: Re: [PATCH v2 8/8] news: Add entry for the new 'rpm' guix pack format. References: <20230217014938.20919-1-maxim.cournoyer@HIDDEN> <20230217014938.20919-9-maxim.cournoyer@HIDDEN> <50D8E5E8-2030-4315-8325-13549A5B0072@HIDDEN> Date: Fri, 17 Feb 2023 12:32:18 -0500 In-Reply-To: <50D8E5E8-2030-4315-8325-13549A5B0072@HIDDEN> (Julien Lepiller's message of "Fri, 17 Feb 2023 07:34:57 +0100") Message-ID: <87a61crye5.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61255 Cc: ludo@HIDDEN, Florian Pelz <pelzflorian@HIDDEN>, 61255 <at> debbugs.gnu.org, Thiago Jung Bauermann <bauermann@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hi Julien! Julien Lepiller <julien@HIDDEN> writes: > French: > > Nouveau format @samp{rpm} pour la commande @command{guix pack} > > > Vous pouvez d=C3=A9sormais produire une archive RPM (avec l'extension .rp= m) > avec la commande @command{guix pack --format=3Drpm} qui propose donc une > nouvelle mani=C3=A8re de distribuer les logiciels construits avec > Guix. Voici un exemple permettant de g=C3=A9n=C3=A9rer une archive RPM po= ur le > paquet @code{hello} : > > @example > guix pack --format=3Drpm --symlink=3D/usr/bin/hello=3Dbin/hello hello > @end example > > Consultez @command{info \"(guix.fr) Invoquer guix pack\"} pour plus d'inf= ormations. Merci! Int=C3=A9gr=C3=A9 comme suit dans ma branche locale: --8<---------------cut here---------------start------------->8--- 1 file changed, 16 insertions(+), 3 deletions(-) etc/news.scm | 19 ++++++++++++++++--- modified etc/news.scm @@ -4,7 +4,7 @@ ;; Copyright =C2=A9 2019=E2=80=932021 Tobias Geerinckx-Rice <me@HIDDEN> ;; Copyright =C2=A9 2019, 2020 Miguel =C3=81ngel Arruga Vivas <rosen644835= @gmail.com> ;; Copyright =C2=A9 2019, 2020 Konrad Hinsen <konrad.hinsen@HIDDEN> -;; Copyright =C2=A9 2019, 2020, 2021 Julien Lepiller <julien@HIDDEN> +;; Copyright =C2=A9 2019, 2020, 2021, 2023 Julien Lepiller <julien@lepille= r.eu> ;; Copyright =C2=A9 2019=E2=80=932023 Florian Pelz <pelzflorian@pelzfloria= n.de> ;; Copyright =C2=A9 2020, 2022 Marius Bakke <marius@HIDDEN> ;; Copyright =C2=A9 2020, 2021 Mathieu Othacehe <m.othacehe@HIDDEN> @@ -28,7 +28,8 @@ =20 (entry (commit "63622d2a234b707be5df07d8290a81b3247947e7") (title - (en "New @samp{rpm} format for the @command{guix pack} command")) + (en "New @samp{rpm} format for the @command{guix pack} command") + (fr "Nouveau format @samp{rpm} pour la commande @command{guix pac= k}")) (body (en "RPM archives (with the .rpm file extension) can now be produ= ced via the @command{guix pack --format=3Drpm} command, providing an alternati= ve @@ -39,7 +40,19 @@ guix pack --format=3Drpm --symlink=3D/usr/bin/hello=3Dbin/hello hello @end example =20 -See @command{info \"(guix) Invoking guix pack\"} for more information."))) +See @command{info \"(guix) Invoking guix pack\"} for more information.") + (fr "Vous pouvez d=C3=A9sormais produire une archive RPM (avec l'= extension +.rpm) avec la commande @command{guix pack --format=3Drpm} qui propose +donc une nouvelle mani=C3=A8re de distribuer les logiciels construits avec +Guix. Voici un exemple permettant de g=C3=A9n=C3=A9rer une archive RPM po= ur le +paquet @code{hello} : + +@example +guix pack --format=3Drpm --symlink=3D/usr/bin/hello=3Dbin/hello hello +@end example + +Consultez @command{info \"(guix.fr) Invoquer guix pack\"} pour plus +d'informations."))) =20 (entry (commit "137b91f03bbb7f1df71cf10c4f79ae57fbcea400") (title --8<---------------cut here---------------end--------------->8--- --=20 Thanks, Maxim
guix-patches@HIDDEN
:bug#61255
; Package guix-patches
.
Full text available.Received: (at 61255) by debbugs.gnu.org; 17 Feb 2023 15:13:15 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 17 10:13:14 2023 Received: from localhost ([127.0.0.1]:41011 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pT2QE-0002KM-NM for submit <at> debbugs.gnu.org; Fri, 17 Feb 2023 10:13:14 -0500 Received: from relay.yourmailgateway.de ([185.244.194.184]:49433) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <pelzflorian@HIDDEN>) id 1pT2QB-0002KC-Um for 61255 <at> debbugs.gnu.org; Fri, 17 Feb 2023 10:13:13 -0500 Received: from relay01-mors.netcup.net (localhost [127.0.0.1]) by relay01-mors.netcup.net (Postfix) with ESMTPS id 4PJFgV362Tz8vfb; Fri, 17 Feb 2023 16:13:10 +0100 (CET) Authentication-Results: relay01-mors.netcup.net; dkim=permerror (bad message/signature format) Received: from policy02-mors.netcup.net (unknown [46.38.225.35]) by relay01-mors.netcup.net (Postfix) with ESMTPS id 4PJFgV2hWZz7wbZ; Fri, 17 Feb 2023 16:13:10 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at policy02-mors.netcup.net X-Spam-Flag: NO X-Spam-Score: -2.9 X-Spam-Level: X-Spam-Status: No, score=-2.9 required=6.31 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9] autolearn=ham autolearn_force=no Received: from mxe217.netcup.net (unknown [10.243.12.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by policy02-mors.netcup.net (Postfix) with ESMTPS id 4PJFgS5vKWz8sZj; Fri, 17 Feb 2023 16:13:08 +0100 (CET) Received: from florianrock64 (ip92344de0.dynamic.kabel-deutschland.de [146.52.77.224]) by mxe217.netcup.net (Postfix) with ESMTPSA id E3FE88067A; Fri, 17 Feb 2023 16:12:59 +0100 (CET) From: "pelzflorian (Florian Pelz)" <pelzflorian@HIDDEN> To: Maxim Cournoyer <maxim.cournoyer@HIDDEN> Subject: Re: [PATCH v2 8/8] news: Add entry for the new 'rpm' guix pack format. References: <20230217014938.20919-1-maxim.cournoyer@HIDDEN> <20230217014938.20919-9-maxim.cournoyer@HIDDEN> Date: Fri, 17 Feb 2023 16:12:56 +0100 In-Reply-To: <20230217014938.20919-9-maxim.cournoyer@HIDDEN> (Maxim Cournoyer's message of "Fri, 17 Feb 2023 02:49:37 +0100") Message-ID: <87ttzkba13.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: E3FE88067A X-Spamd-Result: default: False [-4.09 / 15.00]; BAYES_HAM(-5.49)[99.97%]; SUSPICIOUS_RECIPS(1.50)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:3209, ipnet:146.52.0.0/16, country:DE]; FROM_HAS_DN(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TAGGED_RCPT(0.00)[]; ARC_NA(0.00)[] X-Rspamd-Server: rspamd-worker-8404 X-NC-CID: RdXzIM3tTN+zeGdZEJJ712seRqp07yFIfu0wF+mY+q2Jy+RRObYjExsr X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 61255 Cc: ludo@HIDDEN, Julien Lepiller <julien@HIDDEN>, 61255 <at> debbugs.gnu.org, Thiago Jung Bauermann <bauermann@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hi Maxim! Two things. First, could you include this German translation? > (title > (en "New @samp{rpm} format for the @command{guix pack} command")) (de "Neues Format @samp{rpm} f=C3=BCr den Befehl @command{guix pack}") > (body > (en "RPM archives (with the .rpm file extension) can now be produced (de "Sie k=C3=B6nnen jetzt auch RPM-Archive (mit der Dateinamenserweiterung .rpm) erzeugen mit dem Befehl @command{guix pack --format=3Drpm}. Damit haben Sie einen alternativen Distributionsweg f=C3=BCr mit Guix erstellte Software. Hier sehen Sie ein einfaches Beispiel, wie Sie ein RPM-Archiv f=C3=BCr das Paket @code{hello} erzeugen: @example guix pack --format=3Drpm --symlink=3D/usr/bin/hello=3Dbin/hello hello @end example Siehe @command{info \"(guix.de) Aufruf von guix pack\"} f=C3=BCr mehr Informationen.") =E2=80=94Other than that, I just tried using your patch to make hello.rpm a= s in the news example and to make another advent.rpm with open-adventure. To my surprise, I could install both (on a fresh install of Fedora Server x86_64 without Guix installed), even though hello and open-adventure both reference /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33. From reading your documentation, I had not expected this. Perhaps you should mention that it is possible to both run `sudo rpm -i hello.rpm` and `sudo rpm -i advent.rpm` and it does not conflict? Regards, Florian
guix-patches@HIDDEN
:bug#61255
; Package guix-patches
.
Full text available.Received: (at 61255) by debbugs.gnu.org; 17 Feb 2023 06:35:44 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 17 01:35:44 2023 Received: from localhost ([127.0.0.1]:38288 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pSuLQ-0001Kg-5D for submit <at> debbugs.gnu.org; Fri, 17 Feb 2023 01:35:44 -0500 Received: from lepiller.eu ([89.234.186.109]:39850) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <julien@HIDDEN>) id 1pSuLN-0001KW-SL for 61255 <at> debbugs.gnu.org; Fri, 17 Feb 2023 01:35:43 -0500 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id d2e5ac17; Fri, 17 Feb 2023 06:35:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:cc:subject:in-reply-to:references:message-id:mime-version :content-type:content-transfer-encoding; s=dkim; bh=o1rOricVlBms vLB6AoLjD/Bs448JylekiNIdxuAKXRk=; b=FAhbZim5Qr4wUiHsa4NxwF7f3Igo HpOwiIV6MssZDtl/KkaR94O8IxTpBV1UeaqsWroOiwRdMiKlUybQEGxkZGr1urvQ vVkxPYrubz+3y2FiWqLMNdSh+Hp9Acsp7CV5pQ8P89Ln7jimXUOvP271yrVN9gAU EcftRSu0wYyARA66cTWh/G6+BpZnvcRQsODDfLyBE4K7qIi5I3trfocrvGVgu+8m ZKzDlM/rnCPrbjZ3f4tZOPjCDC2GO8ePnOHnxCFQE1NUqpavoFlSJ+TkK/9iEese zOrwqNWimRSE3AYfFQ+UdlneHYFZRKwcm47oDNwikZpD9iNCMy3+6HUUGA== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id d1510b3d (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 17 Feb 2023 06:35:38 +0000 (UTC) Date: Fri, 17 Feb 2023 07:34:57 +0100 From: Julien Lepiller <julien@HIDDEN> To: Maxim Cournoyer <maxim.cournoyer@HIDDEN>, 61255 <at> debbugs.gnu.org Subject: =?US-ASCII?Q?Re=3A_=5BPATCH_v2_8/8=5D_news=3A_Add_entry_?= =?US-ASCII?Q?for_the_new_=27rpm=27_guix_pack_format=2E?= User-Agent: K-9 Mail for Android In-Reply-To: <20230217014938.20919-9-maxim.cournoyer@HIDDEN> References: <20230217014938.20919-1-maxim.cournoyer@HIDDEN> <20230217014938.20919-9-maxim.cournoyer@HIDDEN> Message-ID: <50D8E5E8-2030-4315-8325-13549A5B0072@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 61255 Cc: ludo@HIDDEN, Florian Pelz <pelzflorian@HIDDEN>, Thiago Jung Bauermann <bauermann@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) French: Nouveau format @samp{rpm} pour la commande @command{guix pack} Vous pouvez d=C3=A9sormais produire une archive RPM (avec l'extension =2Er= pm) avec la commande @command{guix pack --format=3Drpm} qui propose donc un= e nouvelle mani=C3=A8re de distribuer les logiciels construits avec Guix=2E= Voici un exemple permettant de g=C3=A9n=C3=A9rer une archive RPM pour le p= aquet @code{hello} : @example guix pack --format=3Drpm --symlink=3D/usr/bin/hello=3Dbin/hello hello @end example Consultez @command{info \"(guix=2Efr) Invoquer guix pack\"} pour plus d'in= formations=2E Le 17 f=C3=A9vrier 2023 02:49:37 GMT+01:00, Maxim Cournoyer <maxim=2Ecourn= oyer@gmail=2Ecom> a =C3=A9crit=C2=A0: >* etc/news=2Escm: Add entry=2E > >--- > >Changes in v2: >- New commit > > etc/news=2Escm | 17 ++++++++++++++++- > 1 file changed, 16 insertions(+), 1 deletion(-) > >diff --git a/etc/news=2Escm b/etc/news=2Escm >index 211a176170=2E=2E1eefdd1636 100644 >--- a/etc/news=2Escm >+++ b/etc/news=2Escm >@@ -9,7 +9,7 @@ > ;; Copyright =C2=A9 2020, 2022 Marius Bakke <marius@gnu=2Eorg> > ;; Copyright =C2=A9 2020, 2021 Mathieu Othacehe <m=2Eothacehe@gmail=2Eco= m> > ;; Copyright =C2=A9 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu=2Eorg> >-;; Copyright =C2=A9 2020, 2021, 2022 Maxim Cournoyer <maxim=2Ecournoyer@= gmail=2Ecom> >+;; Copyright =C2=A9 2020, 2021, 2022, 2023 Maxim Cournoyer <maxim=2Ecour= noyer@gmail=2Ecom> > ;; Copyright =C2=A9 2021 Leo Famulari <leo@famulari=2Ename> > ;; Copyright =C2=A9 2021 Zhu Zihao <all_but_last@163=2Ecom> > ;; Copyright =C2=A9 2021 Chris Marusich <cmmarusich@gmail=2Ecom> >@@ -26,6 +26,21 @@ > (channel-news > (version 0) >=20 >+ (entry (commit "63622d2a234b707be5df07d8290a81b3247947e7") >+ (title >+ (en "New @samp{rpm} format for the @command{guix pack} command"= )) >+ (body >+ (en "RPM archives (with the =2Erpm file extension) can now be p= roduced >+via the @command{guix pack --format=3Drpm} command, providing an alterna= tive >+distribution path for software built with Guix=2E Here is a simple exam= ple that >+generates an RPM archive for the @code{hello} package: >+ >+@example >+guix pack --format=3Drpm --symlink=3D/usr/bin/hello=3Dbin/hello hello >+@end example >+ >+See @command{info \"(guix) Invoking guix pack\"} for more information=2E= "))) >+ > (entry (commit "137b91f03bbb7f1df71cf10c4f79ae57fbcea400") > (title > (en "New @option{--with-version} package transformation option"= )
guix-patches@HIDDEN
:bug#61255
; Package guix-patches
.
Full text available.Received: (at 61255) by debbugs.gnu.org; 17 Feb 2023 01:50:33 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 16 20:50:33 2023 Received: from localhost ([127.0.0.1]:38089 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pSptQ-0007UC-KG for submit <at> debbugs.gnu.org; Thu, 16 Feb 2023 20:50:33 -0500 Received: from mail-qt1-f173.google.com ([209.85.160.173]:41962) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <maxim.cournoyer@HIDDEN>) id 1pSptH-0007T4-V6 for 61255 <at> debbugs.gnu.org; Thu, 16 Feb 2023 20:50:24 -0500 Received: by mail-qt1-f173.google.com with SMTP id z5so4150519qtn.8 for <61255 <at> debbugs.gnu.org>; Thu, 16 Feb 2023 17:50:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=h6eeWVhFS4/P4mj5jVKi+2tCRKAgXHX5V9OpJjZRF4k=; b=QRPZ/tOKLdw5Em6ZMrdX31SORvJxT1sylPmMNEBpd3bGdAKw9/wCuvzTPNjp/wloXe IRhmHv2BKyxpNazDq5Ja67F/ZaszPntWPXL6F1DF30Z2QpBovHyt+F0ZLNi+dagQ+NBc BEtKFZV9MR3P+BrMHyTnlDqjYEHbD5OBYNF/BacWHHRFM1aWLlzGhBUhnPJf1nmjgYdh V0G0NkEiM/ccgpXXrHk/7T8z6WkymVrbzBJKu/n5P7M0TPtNGw9HTmwffFP6KJhZfidM Y8DVT9m31gmy6CWN6Qc32l9dBIDgFAHhj57FqaCTluFPOzZaQ98FYi+W+38aTjmqZSQF CYDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=h6eeWVhFS4/P4mj5jVKi+2tCRKAgXHX5V9OpJjZRF4k=; b=R+61tv09FBF0lPrwY8gP/bxobTrW9FNKC6W0Zi30QxlhTHuMeR8VC4Bc/8VBcR0kPb 85HmulFD26cCwEaFkv+Ktrv9YOl0PWRGqv3EDvidXItqTnRqH/xD/6O2ue7iBYEfywoi fHPpcYNHFdCpuHNaQ14ddvItnCQEqdssKjBTmMb4RJHskLpZeDBmB/DtCa480fQMzO+6 kFQmQeXzupGvqOgLGqVPs4+f7ofgBtjtIALLV5PzNkJ7Abaiw4rFFIXiszX/pSeeqooX JXKQmcfAu6rmZmecRB6yCecTUcirt/zt0MPyo0RN5C0doQKgvely+FzGWDrAj5RVXD5a fHMQ== X-Gm-Message-State: AO0yUKXOgIXE9x5CejlfYSaX6ju9EyApe7PGk5SvqAI8c6IW6E63oj3v xaO5V0ZlZCFdGgILiC4cfdJltpTSkfp8oLo0 X-Google-Smtp-Source: AK7set83HT0KMkUV0e/ZfuFnlTXtbwqWxEqi9HaW+mW5o3hcGfjkK8GTEXdC1hWvEZyvy61NO2IE8Q== X-Received: by 2002:ac8:5b4e:0:b0:3b9:b7c9:f0ce with SMTP id n14-20020ac85b4e000000b003b9b7c9f0cemr31636qtw.38.1676598618247; Thu, 16 Feb 2023 17:50:18 -0800 (PST) Received: from localhost.localdomain (dsl-152-188.b2b2c.ca. [66.158.152.188]) by smtp.gmail.com with ESMTPSA id g66-20020a37b645000000b0073b425f6e33sm2316242qkf.100.2023.02.16.17.50.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 17:50:17 -0800 (PST) From: Maxim Cournoyer <maxim.cournoyer@HIDDEN> To: 61255 <at> debbugs.gnu.org Subject: [PATCH v2 8/8] news: Add entry for the new 'rpm' guix pack format. Date: Fri, 17 Feb 2023 02:49:37 +0100 Message-Id: <20230217014938.20919-9-maxim.cournoyer@HIDDEN> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230217014938.20919-1-maxim.cournoyer@HIDDEN> References: <20230217014938.20919-1-maxim.cournoyer@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61255 Cc: Julien Lepiller <julien@HIDDEN>, ludo@HIDDEN, Florian Pelz <pelzflorian@HIDDEN>, Maxim Cournoyer <maxim.cournoyer@HIDDEN>, Thiago Jung Bauermann <bauermann@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * etc/news.scm: Add entry. --- Changes in v2: - New commit etc/news.scm | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/etc/news.scm b/etc/news.scm index 211a176170..1eefdd1636 100644 --- a/etc/news.scm +++ b/etc/news.scm @@ -9,7 +9,7 @@ ;; Copyright © 2020, 2022 Marius Bakke <marius@HIDDEN> ;; Copyright © 2020, 2021 Mathieu Othacehe <m.othacehe@HIDDEN> ;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@HIDDEN> -;; Copyright © 2020, 2021, 2022 Maxim Cournoyer <maxim.cournoyer@HIDDEN> +;; Copyright © 2020, 2021, 2022, 2023 Maxim Cournoyer <maxim.cournoyer@HIDDEN> ;; Copyright © 2021 Leo Famulari <leo@HIDDEN> ;; Copyright © 2021 Zhu Zihao <all_but_last@HIDDEN> ;; Copyright © 2021 Chris Marusich <cmmarusich@HIDDEN> @@ -26,6 +26,21 @@ (channel-news (version 0) + (entry (commit "63622d2a234b707be5df07d8290a81b3247947e7") + (title + (en "New @samp{rpm} format for the @command{guix pack} command")) + (body + (en "RPM archives (with the .rpm file extension) can now be produced +via the @command{guix pack --format=rpm} command, providing an alternative +distribution path for software built with Guix. Here is a simple example that +generates an RPM archive for the @code{hello} package: + +@example +guix pack --format=rpm --symlink=/usr/bin/hello=bin/hello hello +@end example + +See @command{info \"(guix) Invoking guix pack\"} for more information."))) + (entry (commit "137b91f03bbb7f1df71cf10c4f79ae57fbcea400") (title (en "New @option{--with-version} package transformation option") -- 2.39.1
guix-patches@HIDDEN
:bug#61255
; Package guix-patches
.
Full text available.Received: (at 61255) by debbugs.gnu.org; 17 Feb 2023 01:50:32 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 16 20:50:32 2023 Received: from localhost ([127.0.0.1]:38087 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pSptQ-0007UA-AD for submit <at> debbugs.gnu.org; Thu, 16 Feb 2023 20:50:32 -0500 Received: from mail-qv1-f42.google.com ([209.85.219.42]:44821) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <maxim.cournoyer@HIDDEN>) id 1pSptG-0007Sx-HY for 61255 <at> debbugs.gnu.org; Thu, 16 Feb 2023 20:50:22 -0500 Received: by mail-qv1-f42.google.com with SMTP id ks14so355292qvb.11 for <61255 <at> debbugs.gnu.org>; Thu, 16 Feb 2023 17:50:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FINmKnixy4cvcTNdQpEc/ZQRC4RvZ6cTnUdv0W5G1hw=; b=qE7EgwFv3P/rtaFDLdfRvppPqan7RIPmeuJFKji4g99yV0tFRDf4l49Yhwzn+JxGIq y5ILsetCPb8wW23YgZcRZnujNFzwjzznqNbGdkvO2cPxwTkgWPKu1kp6WjMjxSOftxUG W4A1SlGiYe8Co+uMkT0fEOiZvJQTB2j0wF0HZLwpdcrVbljYYseoAeoglFuzCLG2wMw2 8FwmDi1VBLam80KBYtJVr2nXCQMcY4R/71i2FAf3bOSAfx//UF+APg795+Fve0nYlQ/+ sEX0XnpP9/G5dXvXzEn0hXvG0xTuwVIKWGT1369KIUVeSYL31P31N6aCs9vJ0XWTL8LO 0XFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FINmKnixy4cvcTNdQpEc/ZQRC4RvZ6cTnUdv0W5G1hw=; b=rGnY8Vti0Tm84XpPIKYfUCBrdq8Bp4WpgsrhITaMJb902CUxx8ImJHBJK8nzaV7gQx 4/QMidAPj3W2DsA1DUY6UjRTtSnhWWMFN3Wl+MTNRF24Fa1T9c80UQtdX1bF2PUj9Ls1 R93cbWKNn9/aP1VhOyZs4Xg4lxv+c3qh0mnVDbM60HbRRSdRA/t6KldfbDNf4voLBndn fGJtAxZQgcjmQ8jBHtgi3uuyW7p7HTVd45r5Kip7UcnUx8EhNX75vWG3tpiyPR8b6N8C hJLN+TQ1v8Q02ZPjUoXeyn8WbArWHjSp0Jbvp7YAW7KvEi9k1Si8VKHB+sbMVF62X7jl BYCg== X-Gm-Message-State: AO0yUKWcvpVaRuTL8c6s1oN17DDAyfQN7N8pBHveRh7Awb3x8RcxGszg +WKvLKz8dCdfgkVHEFBxRDf/q8AVYwMbKjXi X-Google-Smtp-Source: AK7set9Dg2fuVwF9YROLtyvOLDccIRXK0qQMzWugT/1j6YFKXcY46yaS2qGJgRJzTdC8J1JlUf1/Og== X-Received: by 2002:a05:6214:5299:b0:56e:a6f1:8db with SMTP id kj25-20020a056214529900b0056ea6f108dbmr15979899qvb.20.1676598616931; Thu, 16 Feb 2023 17:50:16 -0800 (PST) Received: from localhost.localdomain (dsl-152-188.b2b2c.ca. [66.158.152.188]) by smtp.gmail.com with ESMTPSA id g66-20020a37b645000000b0073b425f6e33sm2316242qkf.100.2023.02.16.17.50.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 17:50:16 -0800 (PST) From: Maxim Cournoyer <maxim.cournoyer@HIDDEN> To: 61255 <at> debbugs.gnu.org Subject: [PATCH v2 7/8] etc: Add a news entry snippet. Date: Fri, 17 Feb 2023 02:49:36 +0100 Message-Id: <20230217014938.20919-8-maxim.cournoyer@HIDDEN> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230217014938.20919-1-maxim.cournoyer@HIDDEN> References: <20230217014938.20919-1-maxim.cournoyer@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61255 Cc: ludo@HIDDEN, Maxim Cournoyer <maxim.cournoyer@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * etc/snippets/yas/scheme-mode/guix-news-entry: New file. --- Changes in v2: - New commit etc/snippets/yas/scheme-mode/guix-news-entry | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 etc/snippets/yas/scheme-mode/guix-news-entry diff --git a/etc/snippets/yas/scheme-mode/guix-news-entry b/etc/snippets/yas/scheme-mode/guix-news-entry new file mode 100644 index 0000000000..7f5bb21c50 --- /dev/null +++ b/etc/snippets/yas/scheme-mode/guix-news-entry @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: guix-news-entry +# key: entry... +# -- +(entry (commit "$1") + (title + (en "$2")) + (body + (en "$3"))) -- 2.39.1
guix-patches@HIDDEN
:bug#61255
; Package guix-patches
.
Full text available.Received: (at 61255) by debbugs.gnu.org; 17 Feb 2023 01:50:26 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 16 20:50:26 2023 Received: from localhost ([127.0.0.1]:38084 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pSptH-0007Th-GC for submit <at> debbugs.gnu.org; Thu, 16 Feb 2023 20:50:26 -0500 Received: from mail-qt1-f179.google.com ([209.85.160.179]:41948) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <maxim.cournoyer@HIDDEN>) id 1pSptB-0007RV-HW for 61255 <at> debbugs.gnu.org; Thu, 16 Feb 2023 20:50:20 -0500 Received: by mail-qt1-f179.google.com with SMTP id z5so4150479qtn.8 for <61255 <at> debbugs.gnu.org>; Thu, 16 Feb 2023 17:50:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FxZh5C5H5Ti/EsCYT6/qCXEoU7R3AOxI0YpFHpwGGts=; b=guSKT9IK4WdH18i38Pq8+AvO3eZeKzxK5bng0wl49PvTjd7rp+NT4JUnT1Cmcnw/UY DxnyEtqH3yQox2HGams5Bk61ZzDHqKFQt6MRR5snriHHvsG/Tyk0Z+6uuNr3e2krjl3p FcMd5HRpKenWKLUPAclARhySfm63Q5mDJ/GV+l7fqiOFn5s9+hrqGIxW4/yaCKWT0uJR zHly6O6P4744imNoKJR9XjJHxharzvtH4wUC/sGNXeSKvq/pL/czqkxfwH65ccGXrOHe hXGtp5MGMyRFKdJaVSZzLHHIrGv+NO9zPQva+pIo40FNBfGM7/FjU9oIxhIOXvG8+WoJ +ICg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FxZh5C5H5Ti/EsCYT6/qCXEoU7R3AOxI0YpFHpwGGts=; b=5P4VSH40qHx7mYosVPvuMP59PN2Rw9s91p0GhXl2UO4okCo0hR1YNrGf4KtZXKVbv7 BjfQH0Z4oW8/Hlkp1PcpKbSNy4YTuhbJemdKjI/JiKqrYNHSvxApINGG2JmmoH3v8c25 L9j5+zd8XDqBust5+owDQ7w/x9uM8Rpig/3e0gcUQVxfeN5d9Goi8WMez8Q/TlidKVHf YYL7GkJAaqqoBlvxUw5FWNgbBrXmSruv4ArRMlJ+FjKgHVVl3JDSfFyZ60dsiB8Mq+2Q 6DlZOPKetkBoUyY8JBwchnuOagJ1etw3G0C7Q3sBd+m98o5FKQnO406kMO9u8TTx1XLs ciNA== X-Gm-Message-State: AO0yUKXsTeFocYc+nYp9F2YnCPxKzJ2iX+nVl6nVrSIERpWOJRbT7RKt 0mOHw2FucyhZJG2ceN9lMUKiL9S+BPyw8Ued X-Google-Smtp-Source: AK7set+YzC8rE6XoXWPzDREkW/4prcMOWjeHsyM5UDbKnH5cR6jtfG3pzj0ajIxdUtNgAqdbieheig== X-Received: by 2002:a05:622a:246:b0:3b8:6814:ea20 with SMTP id c6-20020a05622a024600b003b86814ea20mr11975241qtx.67.1676598615625; Thu, 16 Feb 2023 17:50:15 -0800 (PST) Received: from localhost.localdomain (dsl-152-188.b2b2c.ca. [66.158.152.188]) by smtp.gmail.com with ESMTPSA id g66-20020a37b645000000b0073b425f6e33sm2316242qkf.100.2023.02.16.17.50.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 17:50:15 -0800 (PST) From: Maxim Cournoyer <maxim.cournoyer@HIDDEN> To: 61255 <at> debbugs.gnu.org Subject: [PATCH v2 6/8] pack: Add RPM format. Date: Fri, 17 Feb 2023 02:49:35 +0100 Message-Id: <20230217014938.20919-7-maxim.cournoyer@HIDDEN> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230217014938.20919-1-maxim.cournoyer@HIDDEN> References: <20230217014938.20919-1-maxim.cournoyer@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61255 Cc: Josselin Poiret <dev@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Maxim Cournoyer <maxim.cournoyer@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, ludo@HIDDEN, Christopher Baines <mail@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * guix/rpm.scm: New file. * guix/scripts/pack.scm (rpm-archive): New procedure. (%formats): Register it. (show-formats): Add it. (guix-pack): Register supported extra-options for the rpm format. * tests/pack.scm (rpm-for-tests): New variable. ("rpm archive can be installed/uninstalled"): New test. * tests/rpm.scm: New test. * doc/guix.texi (Invoking guix pack): Document it. --- Changes in v2: - Use let-keywords instead of custom keyword-ref - Adjust commentary block in (guix rpm) - Adjust long define indentation in (guix scripts pack) - Separate guix pack / rpm --install example blocks Makefile.am | 2 + doc/guix.texi | 48 +++- guix/rpm.scm | 623 ++++++++++++++++++++++++++++++++++++++++++ guix/scripts/pack.scm | 230 +++++++++++++++- tests/pack.scm | 57 +++- tests/rpm.scm | 86 ++++++ 6 files changed, 1033 insertions(+), 13 deletions(-) create mode 100644 guix/rpm.scm create mode 100644 tests/rpm.scm diff --git a/Makefile.am b/Makefile.am index 5ce6cc84f4..8e3815b9c2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -111,6 +111,7 @@ MODULES = \ guix/derivations.scm \ guix/grafts.scm \ guix/repl.scm \ + guix/rpm.scm \ guix/transformations.scm \ guix/inferior.scm \ guix/describe.scm \ @@ -535,6 +536,7 @@ SCM_TESTS = \ tests/pypi.scm \ tests/read-print.scm \ tests/records.scm \ + tests/rpm.scm \ tests/scripts.scm \ tests/search-paths.scm \ tests/services.scm \ diff --git a/doc/guix.texi b/doc/guix.texi index 44e2165a82..11f6b3636f 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -6896,6 +6896,7 @@ such file or directory'' message. @end quotation @item deb +@cindex Debian, build a .deb package with guix pack This produces a Debian archive (a package with the @samp{.deb} file extension) containing all the specified binaries and symbolic links, that can be installed on top of any dpkg-based GNU(/Linux) distribution. @@ -6912,7 +6913,8 @@ guix pack -f deb -C xz -S /usr/bin/hello=bin/hello hello Because archives produced with @command{guix pack} contain a collection of store items and because each @command{dpkg} package must not have conflicting files, in practice that means you likely won't be able to -install more than one such archive on a given system. +install more than one such archive on a given system. You can +nonetheless pack as many Guix packages as you want in one such archive. @end quotation @quotation Warning @@ -6923,6 +6925,50 @@ shared by other software, such as a Guix installation or other, non-deb packs. @end quotation +@item rpm +@cindex RPM, build an RPM archive with guix pack +This produces an RPM archive (a package with the @samp{.rpm} file +extension) containing all the specified binaries and symbolic links, +that can be installed on top of any RPM-based GNU/Linux distribution. +The RPM format embeds checksums for every file it contains, which the +@command{rpm} command uses to validate the integrity of the archive. + +Advanced RPM-related options are revealed via the +@option{--help-rpm-format} option. These options allow embedding +maintainer scripts that can run before or after the installation of the +RPM archive, for example. + +The RPM format supports relocatable packages via the @option{--prefix} +option of the @command{rpm} command, which can be handy to install an +RPM package to a specific prefix, making installing multiple +Guix-produced RPM packages side by side possible. + +@example +guix pack -f rpm -R -C xz -S /usr/bin/hello=bin/hello hello +@end example + +@example +sudo rpm --install --prefix=/opt /gnu/store/...-hello.rpm +@end example + +@quotation Note +Similarly to Debian packages, two RPM packages with conflicting files +cannot be installed simultaneously. Contrary to Debian packages, RPM +supports relocatable packages, so file conflicts can be avoided by +installing the RPM packages under different installation prefixes, as +shown in the above example. +@end quotation + +@quotation Warning +@command{rpm} assumes ownership of any files contained in the pack, +which means it will remove @file{/gnu/store} upon uninstalling a +Guix-generated RPM package, unless the RPM package was installed with +the @option{--prefix} option of the @command{rpm} command. It is unwise +to install Guix-produced @samp{.rpm} packages on a system where +@file{/gnu/store} is shared by other software, such as a Guix +installation or other, non-rpm packs. +@end quotation + @end table @cindex relocatable binaries diff --git a/guix/rpm.scm b/guix/rpm.scm new file mode 100644 index 0000000000..1cb8326a9b --- /dev/null +++ b/guix/rpm.scm @@ -0,0 +1,623 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2023 Maxim Cournoyer <maxim.cournoyer@HIDDEN> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (guix rpm) + #:autoload (gcrypt hash) (hash-algorithm file-hash md5) + #:use-module (guix build utils) + #:use-module (ice-9 format) + #:use-module (ice-9 match) + #:use-module (ice-9 textual-ports) + #:use-module (rnrs bytevectors) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-9) + #:use-module (srfi srfi-26) + #:use-module (srfi srfi-71) + #:use-module (srfi srfi-171) + #:export (generate-lead + generate-signature + generate-header + assemble-rpm-metadata + + ;; XXX: These are internals, but the inline disabling trick + ;; doesn't work on them. + make-header-entry + header-entry? + header-entry-tag + header-entry-count + header-entry-value + + bytevector->hex-string + + fhs-directory?)) + +;;; Commentary: +;;; +;;; This module provides the building blocks required to construct RPM +;;; archives. It is intended to be importable on the build side, so shouldn't +;;; depend on (guix diagnostics) or other host-side-only modules. +;;; +;;; Code: + +(define (gnu-system-triplet->machine-type triplet) + "Return the machine component of TRIPLET, a GNU system triplet." + (first (string-split triplet #\-))) + +(define (gnu-machine-type->rpm-arch type) + "Return the canonical RPM architecture string, given machine TYPE." + (match type + ("arm" "armv7hl") + ("powerpc" "ppc") + ("powerpc64le" "ppc64le") + (machine machine))) ;unchanged + +(define (gnu-machine-type->rpm-number type) + "Translate machine TYPE to its corresponding RPM integer value." + ;; Refer to the rpmrc.in file in the RPM source for the complete + ;; translation tables. + (match type + ((or "i486" "i586" "i686" "x86_64") 1) + ((? (cut string-prefix? "powerpc" <>)) 5) + ("mips64el" 11) + ((? (cut string-prefix? "arm" <>)) 12) + ("aarch64" 19) + ((? (cut string-prefix? "riscv" <>)) 22) + (_ (error "no RPM number known for machine type" type)))) + +(define (u16-number->u8-list number) + "Return a list of byte values made of NUMBER, a 16 bit unsigned integer." + (let ((bv (uint-list->bytevector (list number) (endianness big) 2))) + (bytevector->u8-list bv))) + +(define (u32-number->u8-list number) + "Return a list of byte values made of NUMBER, a 32 bit unsigned integer." + (let ((bv (uint-list->bytevector (list number) (endianness big) 4))) + (bytevector->u8-list bv))) + +(define (s32-number->u8-list number) + "Return a list of byte values made of NUMBER, a 32 bit signed integer." + (let ((bv (sint-list->bytevector (list number) (endianness big) 4))) + (bytevector->u8-list bv))) + +(define (u8-list->u32-number lst) + "Return the 32 bit unsigned integer corresponding to the 4 bytes in LST." + (bytevector-u32-ref (u8-list->bytevector lst) 0 (endianness big))) + + +;;; +;;; Lead section. +;;; + +;; Refer to the docs/manual/format.md file of the RPM source for the details +;; regarding the binary format of an RPM archive. +(define* (generate-lead name-version #:key (target %host-type)) + "Generate a RPM lead u8-list that uses NAME-VERSION, the name and version +string of the package, and TARGET, a GNU triplet used to derive the target +machine type." + (define machine-type (gnu-system-triplet->machine-type target)) + (define magic (list #xed #xab #xee #xdb)) + (define file-format-version (list 3 0)) ;3.0 + (define type (list 0 0)) ;0 for binary packages + (define arch-number (u16-number->u8-list + (gnu-machine-type->rpm-number machine-type))) + ;; The 66 bytes from 10 to 75 are for the name-version-release string. + (define name + (let ((padding-bytes (make-list (- 66 (string-length name-version)) 0))) + (append (bytevector->u8-list (string->utf8 name-version)) + padding-bytes))) + ;; There is no OS number corresponding to GNU/Hurd (GNU), only Linux, per + ;; rpmrc.in. + (define os-number (list 0 1)) + + ;; For RPM format 3.0, the signature type is 5, which means a "Header-style" + ;; signature. + (define signature-type (list 0 5)) + + (define reserved-bytes (make-list 16 0)) + + (append magic file-format-version type arch-number name + os-number signature-type reserved-bytes)) + + +;;; +;;; Header section. +;;; + +(define header-magic (list #x8e #xad #xe8)) +(define header-version (list 1)) +(define header-reserved (make-list 4 0)) ;4 reserved bytes +;;; Every header starts with 8 bytes made by the header magic number, the +;;; header version and 4 reserved bytes. +(define header-intro (append header-magic header-version header-reserved)) + +;;; Header entry data types. +(define NULL 0) +(define CHAR 1) +(define INT8 2) +(define INT16 3) ;2-bytes aligned +(define INT32 4) ;4-bytes aligned +(define INT64 5) ;8-bytes aligned +(define STRING 6) +(define BIN 7) +(define STRING_ARRAY 8) +(define I18NSTRIN_TYPE 9) + +;;; Header entry tags. +(define-record-type <rpm-tag> + (make-rpm-tag number type) + rpm-tag? + (number rpm-tag-number) + (type rpm-tag-type)) + +;;; The following are internal tags used to identify the data sections. +(define RPMTAG_HEADERSIGNATURES (make-rpm-tag 62 BIN)) ;signature header +(define RPMTAG_HEADERIMMUTABLE (make-rpm-tag 63 BIN)) ;main/data header +(define RPMTAG_HEADERI18NTABLE (make-rpm-tag 100 STRING_ARRAY)) + +;;; Subset of RPM tags from include/rpm/rpmtag.h. +(define RPMTAG_NAME (make-rpm-tag 1000 STRING)) +(define RPMTAG_VERSION (make-rpm-tag 1001 STRING)) +(define RPMTAG_RELEASE (make-rpm-tag 1002 STRING)) +(define RPMTAG_SUMMARY (make-rpm-tag 1004 STRING)) +(define RPMTAG_SIZE (make-rpm-tag 1009 INT32)) +(define RPMTAG_LICENSE (make-rpm-tag 1014 STRING)) +(define RPMTAG_OS (make-rpm-tag 1021 STRING)) +(define RPMTAG_ARCH (make-rpm-tag 1022 STRING)) +(define RPMTAG_PREIN (make-rpm-tag 1023 STRING)) +(define RPMTAG_POSTIN (make-rpm-tag 1024 STRING)) +(define RPMTAG_PREUN (make-rpm-tag 1025 STRING)) +(define RPMTAG_POSTUN (make-rpm-tag 1026 STRING)) +(define RPMTAG_FILESIZES (make-rpm-tag 1028 INT32)) +(define RPMTAG_FILEMODES (make-rpm-tag 1030 INT16)) +(define RPMTAG_FILEDIGESTS (make-rpm-tag 1035 STRING_ARRAY)) +(define RPMTAG_FILELINKTOS (make-rpm-tag 1036 STRING_ARRAY)) +(define RPMTAG_FILEUSERNAME (make-rpm-tag 1039 STRING_ARRAY)) +(define RPMTAG_GROUPNAME (make-rpm-tag 1040 STRING_ARRAY)) +(define RPMTAG_PREFIXES (make-rpm-tag 1098 STRING_ARRAY)) +(define RPMTAG_DIRINDEXES (make-rpm-tag 1116 INT32)) +(define RPMTAG_BASENAMES (make-rpm-tag 1117 STRING_ARRAY)) +(define RPMTAG_DIRNAMES (make-rpm-tag 1118 STRING_ARRAY)) +(define RPMTAG_PAYLOADFORMAT (make-rpm-tag 1124 STRING)) +(define RPMTAG_PAYLOADCOMPRESSOR (make-rpm-tag 1125 STRING)) +(define RPMTAG_LONGFILESIZES (make-rpm-tag 5008 INT64)) +(define RPMTAG_LONGSIZE (make-rpm-tag 5009 INT64)) +;;; The algorithm used to compute the digest of each file, e.g. RPM_HASH_MD5. +(define RPMTAG_FILEDIGESTALGO (make-rpm-tag 5011 INT32)) +;;; RPMTAG_ENCODING specifies the encoding used for strings, e.g. "utf-8". +(define RPMTAG_ENCODING (make-rpm-tag 5062 STRING)) +;;; Compressed payload digest. Its type is a string array, but currently in +;;; practice it is equivalent to STRING, since only the first element is used. +(define RPMTAG_PAYLOADDIGEST (make-rpm-tag 5092 STRING_ARRAY)) +;;; The algorithm used to compute the payload digest, e.g. RPM_HASH_SHA256. +(define RPMTAG_PAYLOADDIGESTALGO (make-rpm-tag 5093 INT32)) +;;; The following are taken from the rpmHashAlgo_e enum in rpmcrypto.h. +(define RPM_HASH_MD5 1) +(define RPM_HASH_SHA256 8) + +;;; Other useful internal definitions. +(define REGION_TAG_COUNT 16) ;number of bytes +(define INT32_MAX (1- (expt 2 32))) ;4294967295 bytes (unsigned) + +(define (rpm-tag->u8-list tag) + "Return the u8 list corresponding to RPM-TAG, a <rpm-tag> object." + (append (u32-number->u8-list (rpm-tag-number tag)) + (u32-number->u8-list (rpm-tag-type tag)))) + +(define-record-type <header-entry> + (make-header-entry tag count value) + header-entry? + (tag header-entry-tag) ;<rpm-tag> + (count header-entry-count) ;number (u32) + (value header-entry-value)) ;string|number|list|... + +(define (entry-type->alignement type) + "Return the byte alignment of TYPE, an RPM header entry type." + (cond ((= INT16 type) 2) + ((= INT32 type) 4) + ((= INT64 type) 8) + (else 1))) + +(define (next-aligned-offset offset alignment) + "Return the next position from OFFSET which satisfies ALIGNMENT." + (if (= 0 (modulo offset alignment)) + offset + (next-aligned-offset (1+ offset) alignment))) + +(define (header-entry->data entry) + "Return the data of ENTRY, a <header-entry> object, as a u8 list." + (let* ((tag (header-entry-tag entry)) + (count (header-entry-count entry)) + (value (header-entry-value entry)) + (number (rpm-tag-number tag)) + (type (rpm-tag-type tag))) + (cond + ((= STRING type) + (unless (string? value) + (error "expected string value for STRING type, got" value)) + (unless (= 1 count) + (error "count must be 1 for STRING type")) + (let ((value (cond ((= (rpm-tag-number RPMTAG_VERSION) number) + ;; Hyphens are not allowed in version strings. + (string-map (match-lambda + (#\- #\+) + (c c)) + value)) + (else value)))) + (append (bytevector->u8-list (string->utf8 value)) + (list 0)))) ;strings must end with null byte + ((= STRING_ARRAY type) + (unless (list? value) + (error "expected a list of strings for STRING_ARRAY type, got" value)) + (unless (= count (length value)) + (error "expected count to be equal to" (length value) 'got count)) + (append-map (lambda (s) + (append (bytevector->u8-list (string->utf8 s)) + (list 0))) ;null byte separated + value)) + ((member type (list INT8 INT16 INT32)) + (if (= 1 count) + (unless (number? value) + (error "expected number value for scalar INT type; got" value)) + (unless (list? value) + (error "expected list value for array INT type; got" value))) + (if (list? value) + (cond ((= INT8 type) value) + ((= INT16 type) (append-map u16-number->u8-list value)) + ((= INT32 type) (append-map u32-number->u8-list value)) + (else (error "unexpected type" type))) + (cond ((= INT8 type) (list value)) + ((= INT16 type) (u16-number->u8-list value)) + ((= INT32 type) (u32-number->u8-list value)) + (else (error "unexpected type" type))))) + ((= BIN type) + (unless (list? value) + (error "expected list value for BIN type; got" value)) + value) + (else (error "unimplemented type" type))))) + +(define (make-header-index+data entries) + "Return the index and data sections as u8 number lists, via multiple values. +An index is composed of four u32 (16 bytes total) quantities, in order: tag, +type, offset and count." + (match (fold (match-lambda* + ((entry (offset . (index . data))) + (let* ((tag (header-entry-tag entry)) + (tag-number (rpm-tag-number tag)) + (tag-type (rpm-tag-type tag)) + (count (header-entry-count entry)) + (data* (header-entry->data entry)) + (alignment (entry-type->alignement tag-type)) + (aligned-offset (next-aligned-offset offset alignment)) + (padding (make-list (- aligned-offset offset) 0))) + (cons (+ aligned-offset (length data*)) + (cons (append index + (u32-number->u8-list tag-number) + (u32-number->u8-list tag-type) + (u32-number->u8-list aligned-offset) + (u32-number->u8-list count)) + (append data padding data*)))))) + '(0 . (() . ())) + entries) + ((offset . (index . data)) + (values index data)))) + +;; Prevent inlining of the variables/procedures accessed by unit tests. +(set! make-header-index+data make-header-index+data) +(set! RPMTAG_ARCH RPMTAG_ARCH) +(set! RPMTAG_LICENSE RPMTAG_LICENSE) +(set! RPMTAG_NAME RPMTAG_NAME) +(set! RPMTAG_OS RPMTAG_OS) +(set! RPMTAG_RELEASE RPMTAG_RELEASE) +(set! RPMTAG_SUMMARY RPMTAG_SUMMARY) +(set! RPMTAG_VERSION RPMTAG_VERSION) + +(define (wrap-in-region-tags header region-tag) + "Wrap HEADER, a header provided as u8-list with REGION-TAG." + (let* ((type (rpm-tag-type region-tag)) + (header-intro (take header 16)) + (header-rest (drop header 16)) + ;; Increment the existing index value to account for the added region + ;; tag index. + (index-length (1+ (u8-list->u32-number + (drop-right (drop header-intro 8) 4)))) ;bytes 8-11 + ;; Increment the data length value to account for the added region + ;; tag data. + (data-length (+ REGION_TAG_COUNT + (u8-list->u32-number + (take-right header-intro 4))))) ;last 4 bytes of intro + (unless (member region-tag (list RPMTAG_HEADERSIGNATURES + RPMTAG_HEADERIMMUTABLE)) + (error "expected RPMTAG_HEADERSIGNATURES or RPMTAG_HEADERIMMUTABLE, got" + region-tag)) + (append (drop-right header-intro 8) ;strip existing index and data lengths + (u32-number->u8-list index-length) + (u32-number->u8-list data-length) + ;; Region tag (16 bytes). + (u32-number->u8-list (rpm-tag-number region-tag)) ;number + (u32-number->u8-list type) ;type + (u32-number->u8-list (- data-length REGION_TAG_COUNT)) ;offset + (u32-number->u8-list REGION_TAG_COUNT) ;count + ;; Immutable region. + header-rest + ;; Region tag trailer (16 bytes). Note: the trailer offset value + ;; is an enforced convention; it has no practical use. + (u32-number->u8-list (rpm-tag-number region-tag)) ;number + (u32-number->u8-list type) ;type + (s32-number->u8-list (* -1 index-length 16)) ;negative offset + (u32-number->u8-list REGION_TAG_COUNT)))) ;count + +(define (bytevector->hex-string bv) + (format #f "~{~2,'0x~}" (bytevector->u8-list bv))) + +(define (files->md5-checksums files) + "Return the MD5 checksums (formatted as hexadecimal strings) for FILES." + (let ((file-md5 (cut file-hash (hash-algorithm md5) <>))) + (map (lambda (f) + (or (and=> (false-if-exception (file-md5 f)) + bytevector->hex-string) + ;; Only regular files (e.g., not directories) can have their + ;; checksum computed. + "")) + files))) + +(define (strip-leading-dot name) + "Remove the leading \".\" from NAME, if present. If a single \".\" is +encountered, translate it to \"/\"." + (match name + ("." "/") ;special case + ((? (cut string-prefix? "." <>)) + (string-drop name 1)) + (x name))) + +;;; An extensive list of required and optional FHS directories, per its 3.0 +;;; revision. +(define %fhs-directories + (list "/bin" "/boot" "/dev" + "/etc" "/etc/opt" "/etc/X11" "/etc/sgml" "/etc/xml" + "/home" "/root" "/lib" "/media" "/mnt" + "/opt" "/opt/bin" "/opt/doc" "/opt/include" + "/opt/info" "/opt/lib" "/opt/man" + "/run" "/sbin" "/srv" "/sys" "/tmp" + "/usr" "/usr/bin" "/usr/include" "/usr/libexec" + "/usr/share/color" "/usr/share/dict" "/usr/share/doc" "/usr/share/games" + "/usr/share/info" "/usr/share/locale" "/usr/share/man" "/usr/share/misc" + "/usr/share/nls" "/usr/share/ppd" "/usr/share/sgml" + "/usr/share/terminfo" "/usr/share/tmac" "/usr/share/xml" + "/usr/share/zoneinfo" "/usr/local" "/usr/local/bin" "/usr/local/etc" + "/usr/local/games" "/usr/local/include" "/usr/local/lib" + "/usr/local/man" "/usr/local/sbin" "/usr/local/sbin" "/usr/local/share" + "/usr/local/src" "/var" "/var/account" "/var/backups" + "/var/cache" "/var/cache/fonts" "/var/cache/man" "/var/cache/www" + "/var/crash" "/var/cron" "/var/games" "/var/mail" "/var/msgs" + "/var/lib" "/var/lib/color" "/var/lib/hwclock" "/var/lib/misc" + "/var/local" "/var/lock" "/var/log" "/var/opt" "/var/preserve" + "/var/run" "/var/spool" "/var/spool/lpd" "/var/spool/mqueue" + "/var/spool/news" "/var/spool/rwho" "/var/spool/uucp" + "/var/tmp" "/var/yp")) + +(define (fhs-directory? file-name) + "Predicate to check if FILE-NAME is a known File Hierarchy Standard (FHS) +directory." + (member (strip-leading-dot file-name) %fhs-directories)) + +(define (directory->file-entries directory) + "Return the file lists triplet header entries for the files found under +DIRECTORY." + (with-directory-excursion directory + ;; Skip the initial "." directory, as its name would get concatenated with + ;; the "./" dirname and fail to match "." in the payload. + (let* ((files (cdr (find-files "." #:directories? #t))) + (file-stats (map lstat files)) + (directories + (append (list ".") + (filter-map (match-lambda + ((index . file) + (let ((st (list-ref file-stats index))) + (and (eq? 'directory (stat:type st)) + file)))) + (list-transduce (tenumerate) rcons files)))) + ;; Omit any FHS directories found in FILES to avoid the RPM package + ;; from owning them. This can occur when symlinks directives such + ;; as "/usr/bin/hello -> bin/hello" are used. + (package-files package-file-stats + (unzip2 (reverse + (fold (lambda (file stat res) + (if (fhs-directory? file) + res + (cons (list file stat) res))) + '() files file-stats)))) + + ;; When provided with the index of a file, the directory index must + ;; return the index of the corresponding directory entry. + (dirindexes (map (lambda (d) + (list-index (cut string=? <> d) directories)) + (map dirname package-files))) + ;; The files owned are those appearing in 'basenames'; own them + ;; all. + (basenames (map basename package-files)) + ;; The directory names must end with a trailing "/". + (dirnames (map (compose strip-leading-dot (cut string-append <> "/")) + directories)) + ;; Note: All the file-related entries must have the same length as + ;; the basenames entry. + (symlink-targets (map (lambda (f) + (if (symbolic-link? f) + (readlink f) + "")) ;unused + package-files)) + (file-modes (map stat:mode package-file-stats)) + (file-sizes (map stat:size package-file-stats)) + (file-md5s (files->md5-checksums package-files))) + (let ((basenames-length (length basenames)) + (dirindexes-length (length dirindexes))) + (unless (= basenames-length dirindexes-length) + (error "length mismatch for dirIndexes; expected/actual" + basenames-length dirindexes-length)) + (append + (if (> (apply max file-sizes) INT32_MAX) + (list (make-header-entry RPMTAG_LONGFILESIZES (length file-sizes) + file-sizes) + (make-header-entry RPMTAG_LONGSIZE 1 + (reduce + 0 file-sizes))) + (list (make-header-entry RPMTAG_FILESIZES (length file-sizes) + file-sizes) + (make-header-entry RPMTAG_SIZE 1 (reduce + 0 file-sizes)))) + (list + (make-header-entry RPMTAG_FILEMODES (length file-modes) file-modes) + (make-header-entry RPMTAG_FILEDIGESTS (length file-md5s) file-md5s) + (make-header-entry RPMTAG_FILEDIGESTALGO 1 RPM_HASH_MD5) + (make-header-entry RPMTAG_FILELINKTOS (length symlink-targets) + symlink-targets) + (make-header-entry RPMTAG_FILEUSERNAME basenames-length + (make-list basenames-length "root")) + (make-header-entry RPMTAG_GROUPNAME basenames-length + (make-list basenames-length "root")) + ;; The dirindexes, basenames and dirnames tags form the so-called RPM + ;; "path triplet". + (make-header-entry RPMTAG_DIRINDEXES dirindexes-length dirindexes) + (make-header-entry RPMTAG_BASENAMES basenames-length basenames) + (make-header-entry RPMTAG_DIRNAMES (length dirnames) dirnames))))))) + +(define (make-header entries) + "Return the u8 list of a RPM header containing ENTRIES, a list of +<rpm-entry> objects." + (let* ((entries (sort entries (lambda (x y) + (< (rpm-tag-number (header-entry-tag x)) + (rpm-tag-number (header-entry-tag y)))))) + (count (length entries)) + (index data (make-header-index+data entries))) + (append header-intro ;8 bytes + (u32-number->u8-list count) ;4 bytes + (u32-number->u8-list (length data)) ;4 bytes + ;; Now starts the header index, which can contain up to 32 entries + ;; of 16 bytes each. + index data))) + +(define* (generate-header name version + payload-digest + payload-directory + payload-compressor + #:key + relocatable? + prein-file postin-file + preun-file postun-file + (target %host-type) + (release "0") + (license "N/A") + (summary "RPM archive generated by GNU Guix.") + (os "Linux")) ;see rpmrc.in + "Return the u8 list corresponding to the Header section. PAYLOAD-DIGEST is +the SHA256 checksum string of the compressed payload. PAYLOAD-DIRECTORY is +the directory containing the payload files. PAYLOAD-COMPRESSOR is the name of +the compressor used to compress the CPIO payload, such as \"none\", \"gz\", +\"xz\" or \"zstd\"." + (let* ((rpm-arch (gnu-machine-type->rpm-arch + (gnu-system-triplet->machine-type target))) + (file->string (cut call-with-input-file <> get-string-all)) + (prein-script (and=> prein-file file->string)) + (postin-script (and=> postin-file file->string)) + (preun-script (and=> preun-file file->string)) + (postun-script (and=> postun-file file->string))) + (wrap-in-region-tags + (make-header (append + (list (make-header-entry RPMTAG_HEADERI18NTABLE 1 (list "C")) + (make-header-entry RPMTAG_NAME 1 name) + (make-header-entry RPMTAG_VERSION 1 version) + (make-header-entry RPMTAG_RELEASE 1 release) + (make-header-entry RPMTAG_SUMMARY 1 summary) + (make-header-entry RPMTAG_LICENSE 1 license) + (make-header-entry RPMTAG_OS 1 os) + (make-header-entry RPMTAG_ARCH 1 rpm-arch)) + (directory->file-entries payload-directory) + (if relocatable? + ;; Note: RPMTAG_PREFIXES must not have a trailing + ;; slash, unless it's '/'. This allows installing the + ;; package via 'rpm -i --prefix=/tmp', for example. + (list (make-header-entry RPMTAG_PREFIXES 1 (list "/"))) + '()) + (if prein-script + (list (make-header-entry RPMTAG_PREIN 1 prein-script)) + '()) + (if postin-script + (list (make-header-entry RPMTAG_POSTIN 1 postin-script)) + '()) + (if preun-script + (list (make-header-entry RPMTAG_PREUN 1 preun-script)) + '()) + (if postun-script + (list (make-header-entry RPMTAG_POSTUN 1 postun-script)) + '()) + (if (string=? "none" payload-compressor) + '() + (list (make-header-entry RPMTAG_PAYLOADCOMPRESSOR 1 + payload-compressor))) + (list (make-header-entry RPMTAG_ENCODING 1 "utf-8") + (make-header-entry RPMTAG_PAYLOADFORMAT 1 "cpio") + (make-header-entry RPMTAG_PAYLOADDIGEST 1 + (list payload-digest)) + (make-header-entry RPMTAG_PAYLOADDIGESTALGO 1 + RPM_HASH_SHA256)))) + RPMTAG_HEADERIMMUTABLE))) + + +;;; +;;; Signature section +;;; + +;;; Header sha256 checksum. +(define RPMSIGTAG_SHA256 (make-rpm-tag 273 STRING)) +;;; Uncompressed payload size. +(define RPMSIGTAG_PAYLOADSIZE (make-rpm-tag 1007 INT32)) +;;; Header and compressed payload combined size. +(define RPMSIGTAG_SIZE (make-rpm-tag 1000 INT32)) +;;; Uncompressed payload size (when size > max u32). +(define RPMSIGTAG_LONGARCHIVESIZE (make-rpm-tag 271 INT64)) +;;; Header and compressed payload combined size (when size > max u32). +(define RPMSIGTAG_LONGSIZE (make-rpm-tag 270 INT64)) +;;; Extra space reserved for signatures (typically 32 bytes). +(define RPMSIGTAG_RESERVEDSPACE (make-rpm-tag 1008 BIN)) + +(define (generate-signature header-sha256 + header+compressed-payload-size + ;; uncompressed-payload-size + ) + "Return the u8 list representing a signature header containing the +HEADER-SHA256 (a string) and the PAYLOAD-SIZE, which is the combined size of +the header and compressed payload." + (define size-tag (if (> header+compressed-payload-size INT32_MAX) + RPMSIGTAG_LONGSIZE + RPMSIGTAG_SIZE)) + (wrap-in-region-tags + (make-header (list (make-header-entry RPMSIGTAG_SHA256 1 header-sha256) + (make-header-entry size-tag 1 + header+compressed-payload-size) + ;; (make-header-entry RPMSIGTAG_PAYLOADSIZE 1 + ;; uncompressed-payload-size) + ;; Reserve 32 bytes of extra space in case users would + ;; like to add signatures, as done in rpmGenerateSignature. + (make-header-entry RPMSIGTAG_RESERVEDSPACE 32 + (make-list 32 0)))) + RPMTAG_HEADERSIGNATURES)) + +(define (assemble-rpm-metadata lead signature header) + "Align and append the various u8 list components together, and return the +result as a bytevector." + (let* ((offset (+ (length lead) (length signature))) + (header-offset (next-aligned-offset offset 8)) + (padding (make-list (- header-offset offset) 0))) + ;; The Header is 8-bytes aligned. + (u8-list->bytevector (append lead signature padding header)))) diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index 77425e5b0f..701e41ff1a 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -5,7 +5,7 @@ ;;; Copyright © 2018 Chris Marusich <cmmarusich@HIDDEN> ;;; Copyright © 2018 Efraim Flashner <efraim@HIDDEN> ;;; Copyright © 2020 Tobias Geerinckx-Rice <me@HIDDEN> -;;; Copyright © 2020, 2021, 2022 Maxim Cournoyer <maxim.cournoyer@HIDDEN> +;;; Copyright © 2020, 2021, 2022, 2023 Maxim Cournoyer <maxim.cournoyer@HIDDEN> ;;; Copyright © 2020 Eric Bavier <bavier@HIDDEN> ;;; Copyright © 2022 Alex Griffin <a@HIDDEN> ;;; @@ -67,6 +67,7 @@ (define-module (guix scripts pack) self-contained-tarball debian-archive + rpm-archive docker-image squashfs-image @@ -856,6 +857,166 @@ (define tar (string-append #+archiver "/bin/tar")) ;;; +;;; RPM archive format. +;;; +(define* (rpm-archive name profile + #:key target + (profile-name "guix-profile") + entry-point + (compressor (first %compressors)) + deduplicate? + localstatedir? + (symlinks '()) + archiver + (extra-options '())) + "Return a RPM archive (.rpm) containing a store initialized with the closure +of PROFILE, a derivation. The archive contains /gnu/store. SYMLINKS must be +a list of (SOURCE -> TARGET) tuples denoting symlinks to be added to the pack. +ARCHIVER and ENTRY-POINT are not used. RELOCATABLE?, PREIN-FILE, POSTIN-FILE, +PREUN-FILE and POSTUN-FILE can be provided via EXTRA-OPTIONS." + (when entry-point + (warning (G_ "entry point not supported in the '~a' format~%") 'rpm)) + + (define root (populate-profile-root profile + #:profile-name profile-name + #:target target + #:localstatedir? localstatedir? + #:deduplicate? deduplicate? + #:symlinks symlinks)) + + (define payload + (let* ((raw-cpio-file-name "payload.cpio") + (compressed-cpio-file-name (string-append raw-cpio-file-name + (compressor-extension + compressor)))) + (computed-file compressed-cpio-file-name + (with-imported-modules (source-module-closure + '((guix build utils) + (guix cpio) + (guix rpm))) + #~(begin + (use-modules (guix build utils) + (guix cpio) + (guix rpm) + (srfi srfi-1)) + + ;; Make sure non-ASCII file names are properly handled. + #+(set-utf8-locale profile) + + (define %root (if #$localstatedir? "." #$root)) + + (when #$localstatedir? + ;; Fix the permission of the Guix database file, which was made + ;; read-only when copied to the store in populate-profile-root. + (copy-recursively #$root %root) + (chmod (string-append %root "/var/guix/db/db.sqlite") #o644)) + + (call-with-output-file #$raw-cpio-file-name + (lambda (port) + (with-directory-excursion %root + ;; The first "." entry is discarded. + (write-cpio-archive + (remove fhs-directory? + (cdr (find-files "." #:directories? #t))) + port)))) + (when #+(compressor-command compressor) + (apply invoke (append #+(compressor-command compressor) + (list #$raw-cpio-file-name)))) + (copy-file #$compressed-cpio-file-name #$output))) + #:local-build? #f))) ;allow offloading + + (define build + (with-extensions (list guile-gcrypt) + (with-imported-modules `(((guix config) => ,(make-config.scm)) + ,@(source-module-closure + `((gcrypt hash) + (guix build utils) + (guix profiles) + (guix rpm)) + #:select? not-config?)) + #~(begin + (use-modules (gcrypt hash) + (guix build utils) + (guix profiles) + (guix rpm) + (ice-9 binary-ports) + (ice-9 match) ;for manifest->friendly-name + (ice-9 optargs) + (rnrs bytevectors) + (srfi srfi-1)) + + (define machine-type + (and=> (or #$target %host-type) + (lambda (triplet) + (first (string-split triplet #\-))))) + + #$(procedure-source manifest->friendly-name) + + (define manifest (profile-manifest #$profile)) + + (define single-entry ;manifest entry + (match (manifest-entries manifest) + ((entry) + entry) + (_ #f))) + + (define name + (or (and=> single-entry manifest-entry-name) + (manifest->friendly-name manifest))) + + (define version + (or (and=> single-entry manifest-entry-version) "0.0.0")) + + (define lead + (generate-lead (string-append name "-" version) + #:target (or #$target %host-type))) + + (define payload-digest + (bytevector->hex-string (file-sha256 #$payload))) + + (let-keywords '#$extra-options #f ((relocatable? #f) + (prein-file #f) + (postin-file #f) + (preun-file #f) + (postun-file #f)) + + (let ((header (generate-header name version + payload-digest + #$root + #$(compressor-name compressor) + #:target (or #$target %host-type) + #:relocatable? relocatable? + #:prein-file prein-file + #:postin-file postin-file + #:preun-file preun-file + #:postun-file postun-file))) + + (define header-sha256 + (bytevector->hex-string (sha256 (u8-list->bytevector header)))) + + (define payload-size (stat:size (stat #$payload))) + + (define header+compressed-payload-size + (+ (length header) payload-size)) + + (define signature + (generate-signature header-sha256 + header+compressed-payload-size)) + + ;; Serialize the archive components to a file. + (call-with-input-file #$payload + (lambda (in) + (call-with-output-file #$output + (lambda (out) + (put-bytevector out (assemble-rpm-metadata lead + signature + header)) + (sendfile out in payload-size))))))))))) + + (gexp->derivation (string-append name ".rpm") build)) + + +;;; ;;; Compiling C programs. ;;; @@ -1187,7 +1348,8 @@ (define %formats `((tarball . ,self-contained-tarball) (squashfs . ,squashfs-image) (docker . ,docker-image) - (deb . ,debian-archive))) + (deb . ,debian-archive) + (rpm . ,rpm-archive))) (define (show-formats) ;; Print the supported pack formats. @@ -1201,18 +1363,22 @@ (define (show-formats) docker Tarball ready for 'docker load'")) (display (G_ " deb Debian archive installable via dpkg/apt")) + (display (G_ " + rpm RPM archive installable via rpm/yum")) (newline)) +(define (required-option symbol) + "Return an SYMBOL option that requires a value." + (option (list (symbol->string symbol)) #t #f + (lambda (opt name arg result . rest) + (apply values + (alist-cons symbol arg result) + rest)))) + (define %deb-format-options - (let ((required-option (lambda (symbol) - (option (list (symbol->string symbol)) #t #f - (lambda (opt name arg result . rest) - (apply values - (alist-cons symbol arg result) - rest)))))) - (list (required-option 'control-file) - (required-option 'postinst-file) - (required-option 'triggers-file)))) + (list (required-option 'control-file) + (required-option 'postinst-file) + (required-option 'triggers-file))) (define (show-deb-format-options) (display (G_ " @@ -1231,6 +1397,32 @@ (define (show-deb-format-options/detailed) (newline) (exit 0)) +(define %rpm-format-options + (list (required-option 'prein-file) + (required-option 'postin-file) + (required-option 'preun-file) + (required-option 'postun-file))) + +(define (show-rpm-format-options) + (display (G_ " + --help-rpm-format list options specific to the RPM format"))) + +(define (show-rpm-format-options/detailed) + (display (G_ " + --prein-file=FILE + Embed the provided prein script")) + (display (G_ " + --postin-file=FILE + Embed the provided postin script")) + (display (G_ " + --preun-file=FILE + Embed the provided preun script")) + (display (G_ " + --postun-file=FILE + Embed the provided postun script")) + (newline) + (exit 0)) + (define %options ;; Specifications of the command-line options. (cons* (option '(#\h "help") #f #f @@ -1307,7 +1499,12 @@ (define %options (lambda args (show-deb-format-options/detailed))) + (option '("help-rpm-format") #f #f + (lambda args + (show-rpm-format-options/detailed))) + (append %deb-format-options + %rpm-format-options %transformation-options %standard-build-options %standard-cross-build-options @@ -1325,6 +1522,7 @@ (define (show-help) (show-transformation-options-help) (newline) (show-deb-format-options) + (show-rpm-format-options) (newline) (display (G_ " -f, --format=FORMAT build a pack in the given FORMAT")) @@ -1483,6 +1681,16 @@ (define (process-file-arg opts name) (process-file-arg opts 'postinst-file) #:triggers-file (process-file-arg opts 'triggers-file))) + ('rpm + (list #:relocatable? relocatable? + #:prein-file + (process-file-arg opts 'prein-file) + #:postin-file + (process-file-arg opts 'postin-file) + #:preun-file + (process-file-arg opts 'preun-file) + #:postun-file + (process-file-arg opts 'postun-file))) (_ '()))) (target (assoc-ref opts 'target)) (bootstrap? (assoc-ref opts 'bootstrap?)) diff --git a/tests/pack.scm b/tests/pack.scm index a02924b7d2..734ae1c69b 100644 --- a/tests/pack.scm +++ b/tests/pack.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@HIDDEN> ;;; Copyright © 2018 Ricardo Wurmus <rekado@HIDDEN> -;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@HIDDEN> +;;; Copyright © 2021, 2023 Maxim Cournoyer <maxim.cournoyer@HIDDEN> ;;; ;;; This file is part of GNU Guix. ;;; @@ -28,13 +28,16 @@ (define-module (test-pack) #:use-module (guix tests) #:use-module (guix gexp) #:use-module (guix modules) + #:use-module (guix utils) #:use-module (gnu packages) #:use-module ((gnu packages base) #:select (glibc-utf8-locales)) #:use-module (gnu packages bootstrap) + #:use-module ((gnu packages package-management) #:select (rpm)) #:use-module ((gnu packages compression) #:select (squashfs-tools)) #:use-module ((gnu packages debian) #:select (dpkg)) #:use-module ((gnu packages guile) #:select (guile-sqlite3)) #:use-module ((gnu packages gnupg) #:select (guile-gcrypt)) + #:use-module ((gnu packages linux) #:select (fakeroot)) #:use-module (srfi srfi-64)) (define %store @@ -59,6 +62,17 @@ (define %tar-bootstrap %bootstrap-coreutils&co) (define %ar-bootstrap %bootstrap-binutils) +;;; This is a variant of the RPM package configured so that its database can +;;; be created on a writable location readily available inside the build +;;; container ("/tmp"). +(define rpm-for-tests + (package + (inherit rpm) + (arguments (substitute-keyword-arguments (package-arguments rpm) + ((#:configure-flags flags '()) + #~(cons "--localstatedir=/tmp" + (delete "--localstatedir=/var" #$flags))))))) + (test-begin "pack") @@ -355,6 +369,47 @@ (define hard-links (stat "postinst")))))) (assert (file-exists? "triggers")) + (mkdir #$output)))))) + (built-derivations (list check)))) + + (unless store (test-skip 1)) + (test-assertm "rpm archive can be installed/uninstalled" store + (mlet* %store-monad + ((guile (set-guile-for-build (default-guile))) + (profile (profile-derivation (packages->manifest + (list %bootstrap-guile)) + #:hooks '() + #:locales? #f)) + (rpm-pack (rpm-archive "rpm-pack" profile + #:compressor %gzip-compressor + #:symlinks '(("/bin/guile" -> "bin/guile")) + #:extra-options '(#:relocatable? #t))) + (check + (gexp->derivation "check-rpm-pack" + (with-imported-modules (source-module-closure + '((guix build utils))) + #~(begin + (use-modules (guix build utils)) + + (define fakeroot #+(file-append fakeroot "/bin/fakeroot")) + (define rpm #+(file-append rpm-for-tests "/bin/rpm")) + (mkdir-p "/tmp/lib/rpm") + + ;; Install the RPM package. This causes RPM to validate the + ;; signatures, header as well as the file digests, which + ;; makes it a rather thorough test. + (mkdir "test-prefix") + (invoke fakeroot rpm "--install" + (string-append "--prefix=" (getcwd) "/test-prefix") + #$rpm-pack) + + ;; Invoke the installed Guile command. + (invoke "./test-prefix/bin/guile" "--version") + + ;; Uninstall the RPM package. + (invoke fakeroot rpm "--erase" "guile-bootstrap") + + ;; Required so the above is run. (mkdir #$output)))))) (built-derivations (list check))))) diff --git a/tests/rpm.scm b/tests/rpm.scm new file mode 100644 index 0000000000..f40b36fe60 --- /dev/null +++ b/tests/rpm.scm @@ -0,0 +1,86 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2023 Maxim Cournoyer <maxim.cournoyer@HIDDEN> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (test-rpm) + #:use-module (guix rpm) + #:use-module (rnrs bytevectors) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) + #:use-module (srfi srfi-64) + #:use-module (srfi srfi-71)) + +;; For white-box testing. +(define-syntax-rule (expose-internal name) + (define name (@@ (guix rpm) name))) + +(expose-internal RPMTAG_ARCH) +(expose-internal RPMTAG_LICENSE) +(expose-internal RPMTAG_NAME) +(expose-internal RPMTAG_OS) +(expose-internal RPMTAG_RELEASE) +(expose-internal RPMTAG_SUMMARY) +(expose-internal RPMTAG_VERSION) +(expose-internal header-entry-count) +(expose-internal header-entry-tag) +(expose-internal header-entry-value) +(expose-internal header-entry?) +(expose-internal make-header) +(expose-internal make-header-entry) +(expose-internal make-header-index+data) + +(test-begin "rpm") + +(test-equal "lead must be 96 bytes long" + 96 + (length (generate-lead "hello-2.12.1"))) + +(define header-entries + (list (make-header-entry RPMTAG_NAME 1 "hello") + (make-header-entry RPMTAG_VERSION 1 "2.12.1") + (make-header-entry RPMTAG_RELEASE 1 "0") + (make-header-entry RPMTAG_SUMMARY 1 + "Hello, GNU world: An example GNU package") + (make-header-entry RPMTAG_LICENSE 1 "GPL 3 or later") + (make-header-entry RPMTAG_OS 1 "Linux") + (make-header-entry RPMTAG_ARCH 1 "x86_64"))) + +(define expected-header-index-length + (* 16 (length header-entries))) ;16 bytes per index entry + +(define expected-header-data-length + (+ (length header-entries) ;to account for null bytes + (fold + 0 (map (compose string-length (cut header-entry-value <>)) + header-entries)))) + +(let ((index data (make-header-index+data header-entries))) + (test-equal "header index" + expected-header-index-length + (length index)) + + ;; This test depends on the fact that only STRING entries are used, and that + ;; they are composed of single byte characters and the delimiting null byte. + (test-equal "header data" + expected-header-data-length + (length data))) + +(test-equal "complete header section" + (+ 16 ;leading magic + count bytes + expected-header-index-length expected-header-data-length) + (length (make-header header-entries))) + +(test-end) -- 2.39.1
guix-patches@HIDDEN
:bug#61255
; Package guix-patches
.
Full text available.Received: (at 61255) by debbugs.gnu.org; 17 Feb 2023 01:50:23 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 16 20:50:23 2023 Received: from localhost ([127.0.0.1]:38082 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pSptG-0007TY-P4 for submit <at> debbugs.gnu.org; Thu, 16 Feb 2023 20:50:23 -0500 Received: from mail-qv1-f44.google.com ([209.85.219.44]:42691) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <maxim.cournoyer@HIDDEN>) id 1pSptD-0007ST-BN for 61255 <at> debbugs.gnu.org; Thu, 16 Feb 2023 20:50:20 -0500 Received: by mail-qv1-f44.google.com with SMTP id mg2so2949346qvb.9 for <61255 <at> debbugs.gnu.org>; Thu, 16 Feb 2023 17:50:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=H28IU027B5mobg/w9lJc7r/jjUV6999My1fazfgY6hw=; b=g7CS0EJTXbJ/5nGEmxjXVw2Y6H9f9M/DGi4Pc/K9f8KV8LnLJdPlpPRklFrAPpIlXp JVYhjUtSUsuOyNCL8GSWXeKwOZcJcUxc+LsaJsnN2bA3HThhapLkWlmFS0y3Yh/jdyPs 2J0xmcAJLfTwJ7/AVMFcui8cvCSEFBZa3/krfRcRLtJeZKwm0ccZOlfscSWWyvgTWw2b jnWjNK1Sd8fJlOZ5RXuN5AAqx4BgU8NX/4D+jGK9wXNB9U9GBNCcbD5Idsaizzjy2h4d lMamrJH1y+6oar3ns8dVVnk5rJNpbrTKqr+1eji24bUREHFWXf9DdZs54E3nR9mx3Y+q EDYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=H28IU027B5mobg/w9lJc7r/jjUV6999My1fazfgY6hw=; b=QF0rIpXefRWd59lxt73TrOXpoPz+LTjSR0ylI6jgqXM7q4zzzuIrJXVbcQiuimszeI 6zr3PY0s2+FG79w6rdgRLK9tqsGu3H5PDZmCj98jiw2MuL2wP83BmVFr6CDwbQ3lTkKs Mf9oxG0oVVDOrvf74XOxOyvV0rTa0vznv7X2Eg9qQ4mhFPrSWwV+qmgh2/Lyh3ZU31Mr 4jXf0x9yADxvPUZmUzq60Syy7eyd+lCUXBqkKL66uBVfzJPhFrz0R7wcALx1nTriJpRG /PWreMW40gY13x6Z+XVURxBKhHSkCt343LVOyQfve21tSElPqvupOv7K46Unhx8EkArH YRNg== X-Gm-Message-State: AO0yUKWdDcwxNKJCQv0oAFXbKbM5lIRMQEJzICjuai8a+96CFn7ohHi5 JIL0sszCk845LxnWWZWcpHRNp/UCWFeQ+mHx X-Google-Smtp-Source: AK7set+uYLWE+vtJkWfIcK5tO8Da009msUYlpAYU0vimFtueOorRjsEYCzOV1VnZs017ZotM2R+KXg== X-Received: by 2002:a05:6214:c8b:b0:56e:b16d:ec9b with SMTP id r11-20020a0562140c8b00b0056eb16dec9bmr14151850qvr.21.1676598613569; Thu, 16 Feb 2023 17:50:13 -0800 (PST) Received: from localhost.localdomain (dsl-152-188.b2b2c.ca. [66.158.152.188]) by smtp.gmail.com with ESMTPSA id g66-20020a37b645000000b0073b425f6e33sm2316242qkf.100.2023.02.16.17.50.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 17:50:13 -0800 (PST) From: Maxim Cournoyer <maxim.cournoyer@HIDDEN> To: 61255 <at> debbugs.gnu.org Subject: [PATCH v2 5/8] tests: pack: Fix indentation. Date: Fri, 17 Feb 2023 02:49:34 +0100 Message-Id: <20230217014938.20919-6-maxim.cournoyer@HIDDEN> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230217014938.20919-1-maxim.cournoyer@HIDDEN> References: <20230217014938.20919-1-maxim.cournoyer@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61255 Cc: ludo@HIDDEN, Maxim Cournoyer <maxim.cournoyer@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * tests/pack.scm: Fix indentation. --- Changes in v2: - Better make use of the new indentation rule tests/pack.scm | 279 ++++++++++++++++++++++++------------------------- 1 file changed, 137 insertions(+), 142 deletions(-) diff --git a/tests/pack.scm b/tests/pack.scm index a4c388d93e..a02924b7d2 100644 --- a/tests/pack.scm +++ b/tests/pack.scm @@ -74,44 +74,43 @@ (define %ar-bootstrap %bootstrap-binutils) -> "bin/guile")) #:compressor %gzip-compressor #:archiver %tar-bootstrap)) - (check (gexp->derivation - "check-tarball" - (with-imported-modules '((guix build utils)) - #~(begin - (use-modules (guix build utils) - (srfi srfi-1)) - - (define store - ;; The unpacked store. - (string-append "." (%store-directory) "/")) - - (define (canonical? file) - ;; Return #t if FILE is read-only and its mtime is 1. - (let ((st (lstat file))) - (or (not (string-prefix? store file)) - (eq? 'symlink (stat:type st)) - (and (= 1 (stat:mtime st)) - (zero? (logand #o222 - (stat:mode st))))))) - - (define bin - (string-append "." #$profile "/bin")) - - (setenv "PATH" - (string-append #$%tar-bootstrap "/bin")) - (system* "tar" "xvf" #$tarball) - (mkdir #$output) - (exit - (and (file-exists? (string-append bin "/guile")) - (file-exists? store) - (every canonical? - (find-files "." (const #t) - #:directories? #t)) - (string=? (string-append #$%bootstrap-guile "/bin") - (readlink bin)) - (string=? (string-append ".." #$profile - "/bin/guile") - (readlink "bin/Guile"))))))))) + (check (gexp->derivation "check-tarball" + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils) + (srfi srfi-1)) + + (define store + ;; The unpacked store. + (string-append "." (%store-directory) "/")) + + (define (canonical? file) + ;; Return #t if FILE is read-only and its mtime is 1. + (let ((st (lstat file))) + (or (not (string-prefix? store file)) + (eq? 'symlink (stat:type st)) + (and (= 1 (stat:mtime st)) + (zero? (logand #o222 + (stat:mode st))))))) + + (define bin + (string-append "." #$profile "/bin")) + + (setenv "PATH" + (string-append #$%tar-bootstrap "/bin")) + (system* "tar" "xvf" #$tarball) + (mkdir #$output) + (exit + (and (file-exists? (string-append bin "/guile")) + (file-exists? store) + (every canonical? + (find-files "." (const #t) + #:directories? #t)) + (string=? (string-append #$%bootstrap-guile "/bin") + (readlink bin)) + (string=? (string-append ".." #$profile + "/bin/guile") + (readlink "bin/Guile"))))))))) (built-derivations (list check)))) ;; The following test needs guile-sqlite3, libgcrypt, etc. as a consequence of @@ -131,17 +130,16 @@ (define bin #:locales? #f)) (tarball (self-contained-tarball "tar-pack" profile #:localstatedir? #t)) - (check (gexp->derivation - "check-tarball" - #~(let ((bin (string-append "." #$profile "/bin"))) - (setenv "PATH" - (string-append #$%tar-bootstrap "/bin")) - (system* "tar" "xvf" #$tarball) - (mkdir #$output) - (exit - (and (file-exists? "var/guix/db/db.sqlite") - (string=? (string-append #$%bootstrap-guile "/bin") - (readlink bin)))))))) + (check (gexp->derivation "check-tarball" + #~(let ((bin (string-append "." #$profile "/bin"))) + (setenv "PATH" + (string-append #$%tar-bootstrap "/bin")) + (system* "tar" "xvf" #$tarball) + (mkdir #$output) + (exit + (and (file-exists? "var/guix/db/db.sqlite") + (string=? (string-append #$%bootstrap-guile "/bin") + (readlink bin)))))))) (built-derivations (list check)))) (unless store (test-skip 1)) @@ -154,45 +152,44 @@ (define bin ("λ" regular (data "lambda"))))) (tarball (self-contained-tarball "tar-pack" tree #:localstatedir? #t)) - (check (gexp->derivation - "check-tarball" - (with-extensions (list guile-sqlite3 guile-gcrypt) - (with-imported-modules (source-module-closure - '((guix store database))) - #~(begin - (use-modules (guix store database) - (rnrs io ports) - (srfi srfi-1)) - - (define (valid-file? basename data) - (define file - (string-append "./" #$tree "/" basename)) - - (string=? (call-with-input-file (pk 'file file) - get-string-all) - data)) - - (setenv "PATH" - (string-append #$%tar-bootstrap "/bin")) - (system* "tar" "xvf" #$tarball) - - (sql-schema - #$(local-file (search-path %load-path - "guix/store/schema.sql"))) - (with-database "var/guix/db/db.sqlite" db - ;; Make sure non-ASCII file names are properly - ;; handled. - (setenv "GUIX_LOCPATH" - #+(file-append glibc-utf8-locales - "/lib/locale")) - (setlocale LC_ALL "en_US.utf8") - - (mkdir #$output) - (exit - (and (every valid-file? - '("α" "λ") - '("alpha" "lambda")) - (integer? (path-id db #$tree))))))))))) + (check (gexp->derivation "check-tarball" + (with-extensions (list guile-sqlite3 guile-gcrypt) + (with-imported-modules (source-module-closure + '((guix store database))) + #~(begin + (use-modules (guix store database) + (rnrs io ports) + (srfi srfi-1)) + + (define (valid-file? basename data) + (define file + (string-append "./" #$tree "/" basename)) + + (string=? (call-with-input-file (pk 'file file) + get-string-all) + data)) + + (setenv "PATH" + (string-append #$%tar-bootstrap "/bin")) + (system* "tar" "xvf" #$tarball) + + (sql-schema + #$(local-file (search-path %load-path + "guix/store/schema.sql"))) + (with-database "var/guix/db/db.sqlite" db + ;; Make sure non-ASCII file names are properly + ;; handled. + (setenv "GUIX_LOCPATH" + #+(file-append glibc-utf8-locales + "/lib/locale")) + (setlocale LC_ALL "en_US.utf8") + + (mkdir #$output) + (exit + (and (every valid-file? + '("α" "λ") + '("alpha" "lambda")) + (integer? (path-id db #$tree))))))))))) (built-derivations (list check)))) (unless store (test-skip 1)) @@ -206,34 +203,33 @@ (define file (tarball (docker-image "docker-pack" profile #:symlinks '(("/bin/Guile" -> "bin/guile")) #:localstatedir? #t)) - (check (gexp->derivation - "check-tarball" - (with-imported-modules '((guix build utils)) - #~(begin - (use-modules (guix build utils) - (ice-9 match)) - - (define bin - (string-append "." #$profile "/bin")) - - (setenv "PATH" (string-append #$%tar-bootstrap "/bin")) - (mkdir "base") - (with-directory-excursion "base" - (invoke "tar" "xvf" #$tarball)) - - (match (find-files "base" "layer.tar") - ((layer) - (invoke "tar" "xvf" layer))) - - (when - (and (file-exists? (string-append bin "/guile")) - (file-exists? "var/guix/db/db.sqlite") - (file-is-directory? "tmp") - (string=? (string-append #$%bootstrap-guile "/bin") - (pk 'binlink (readlink bin))) - (string=? (string-append #$profile "/bin/guile") - (pk 'guilelink (readlink "bin/Guile")))) - (mkdir #$output))))))) + (check (gexp->derivation "check-tarball" + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils) + (ice-9 match)) + + (define bin + (string-append "." #$profile "/bin")) + + (setenv "PATH" (string-append #$%tar-bootstrap "/bin")) + (mkdir "base") + (with-directory-excursion "base" + (invoke "tar" "xvf" #$tarball)) + + (match (find-files "base" "layer.tar") + ((layer) + (invoke "tar" "xvf" layer))) + + (when + (and (file-exists? (string-append bin "/guile")) + (file-exists? "var/guix/db/db.sqlite") + (file-is-directory? "tmp") + (string=? (string-append #$%bootstrap-guile "/bin") + (pk 'binlink (readlink bin))) + (string=? (string-append #$profile "/bin/guile") + (pk 'guilelink (readlink "bin/Guile")))) + (mkdir #$output))))))) (built-derivations (list check)))) (unless store (test-skip 1)) @@ -247,32 +243,31 @@ (define bin (image (squashfs-image "squashfs-pack" profile #:symlinks '(("/bin" -> "bin")) #:localstatedir? #t)) - (check (gexp->derivation - "check-tarball" - (with-imported-modules '((guix build utils)) - #~(begin - (use-modules (guix build utils) - (ice-9 match)) - - (define bin - (string-append "." #$profile "/bin")) - - (setenv "PATH" - (string-append #$squashfs-tools "/bin")) - (invoke "unsquashfs" #$image) - (with-directory-excursion "squashfs-root" - (when (and (file-exists? (string-append bin - "/guile")) - (file-exists? "var/guix/db/db.sqlite") - (string=? (string-append #$%bootstrap-guile "/bin") - (pk 'binlink (readlink bin))) - - ;; This is a relative symlink target. - (string=? (string-drop - (string-append #$profile "/bin") - 1) - (pk 'guilelink (readlink "bin")))) - (mkdir #$output)))))))) + (check (gexp->derivation "check-tarball" + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils) + (ice-9 match)) + + (define bin + (string-append "." #$profile "/bin")) + + (setenv "PATH" + (string-append #$squashfs-tools "/bin")) + (invoke "unsquashfs" #$image) + (with-directory-excursion "squashfs-root" + (when (and (file-exists? (string-append bin + "/guile")) + (file-exists? "var/guix/db/db.sqlite") + (string=? (string-append #$%bootstrap-guile "/bin") + (pk 'binlink (readlink bin))) + + ;; This is a relative symlink target. + (string=? (string-drop + (string-append #$profile "/bin") + 1) + (pk 'guilelink (readlink "bin")))) + (mkdir #$output)))))))) (built-derivations (list check)))) (unless store (test-skip 1)) -- 2.39.1
guix-patches@HIDDEN
:bug#61255
; Package guix-patches
.
Full text available.Received: (at 61255) by debbugs.gnu.org; 17 Feb 2023 01:50:22 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 16 20:50:22 2023 Received: from localhost ([127.0.0.1]:38079 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pSptF-0007TR-Tv for submit <at> debbugs.gnu.org; Thu, 16 Feb 2023 20:50:22 -0500 Received: from mail-qt1-f179.google.com ([209.85.160.179]:36646) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <maxim.cournoyer@HIDDEN>) id 1pSptB-0007SL-OK for 61255 <at> debbugs.gnu.org; Thu, 16 Feb 2023 20:50:18 -0500 Received: by mail-qt1-f179.google.com with SMTP id t16so1643382qto.3 for <61255 <at> debbugs.gnu.org>; Thu, 16 Feb 2023 17:50:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8VLxJVE57sZmOJ+oUoHvH7thL7kwQUzlNFV9XRValZs=; b=GcixnO65hnGgz2J6PisOryWe/i22YkpB9tLl66cqAL01RWsnierEfCvCG7f92hpKvj 3kOQq+yKJTv9M5vLehTO5I/Uqc1kgTrVetJfmSnz18OIihkFbAabaC8zzPnNLAERBjVc 8Hzdr+FZfZSB9FccD7JUQl5tSC4xjj8HmBC8Ya2+BQSmLIMqEsRiH/CTq0peSurExkfi R2Brfy00n9iolWKOLJRF7Tny/8KPBDWKxBttEiyPfM+4gBInhiD/ge9f78fUR10cKWM7 5jgyEhubL2S8cDTM3GiFutecCKGQhtRtPZUgrq9s84zI26Y4VE5rue4xS7Uz0GaxXcpz wqsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8VLxJVE57sZmOJ+oUoHvH7thL7kwQUzlNFV9XRValZs=; b=VUIbxYYenknsmMZlwgotD+npGqHB9Kp2BAzjcmNqSrVhDH70GSNXWL+YCAGYFe8eG5 Yle9q3OplmtfAqq5W89JExkG6qYS278ygW3pzixDuylA7ZLetkHp6EU6vmZCJGke37HU 8/zqMrBocSjGBbVcqko5bArjM8PQAAnH0d2hxnLBZ7kKNA+Zb5nd62joVLaj/Wh5xf90 UZnvc7aWIzykbEO9sKJcGY10MfH1Ilow2OlUh74+a8QCuquyOFmZrNWx2RvF7N2lXSpN n4EYd0kK+ttQ6LyoPQJDjaqOfYZuErzsPrVkSqQQ/1YQscziBXCaJ7oybrIbZ/2iUlXB 2FWQ== X-Gm-Message-State: AO0yUKX4RUPDBrLLQSIn3QZnykc/3C5G75rSnM78o1yzowKLXWEV1p9L Av89azvNrv4Vv0xVGOdi/HCOUDWnwv/QZjAO X-Google-Smtp-Source: AK7set8FQlg32saswZBu/Nb+dsKTtyR2ps28au2UbFRv3bEyNNxeERwOQkPWR0UZzbzuMNgRzjUzyw== X-Received: by 2002:ac8:57cf:0:b0:3ac:fba0:cde with SMTP id w15-20020ac857cf000000b003acfba00cdemr12581276qta.22.1676598612100; Thu, 16 Feb 2023 17:50:12 -0800 (PST) Received: from localhost.localdomain (dsl-152-188.b2b2c.ca. [66.158.152.188]) by smtp.gmail.com with ESMTPSA id g66-20020a37b645000000b0073b425f6e33sm2316242qkf.100.2023.02.16.17.50.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 17:50:11 -0800 (PST) From: Maxim Cournoyer <maxim.cournoyer@HIDDEN> To: 61255 <at> debbugs.gnu.org Subject: [PATCH v2 4/8] pack: Extract populate-profile-root from self-contained-tarball/builder. Date: Fri, 17 Feb 2023 02:49:33 +0100 Message-Id: <20230217014938.20919-5-maxim.cournoyer@HIDDEN> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230217014938.20919-1-maxim.cournoyer@HIDDEN> References: <20230217014938.20919-1-maxim.cournoyer@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61255 Cc: Josselin Poiret <dev@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Maxim Cournoyer <maxim.cournoyer@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, ludo@HIDDEN, Christopher Baines <mail@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) This allows more code to be reused between the various archive writers. * guix/scripts/pack.scm (set-utf8-locale): New top-level procedure, extracted from... (populate-profile-root): New procedure, extracted from... (self-contained-tarball/builder): ... here. Add #:target argument. Call populate-profile-root. [LOCALSTATEDIR?]: Set db.sqlite file permissions. (self-contained-tarball): Call self-contained-tarball/builder with the TARGET argument, and set #:local-build? to #f for the gexp-derivation call. Remove now extraneous #:target and #:references-graphs arguments from the gexp->derivation call. (debian-archive): Call self-contained-tarball/builder with the #:target argument. Fix indentation. Remove now extraneous #:target and #:references-graphs arguments from the gexp->derivation call. --- (no changes since v1) guix/scripts/pack.scm | 230 ++++++++++++++++++++++++------------------ 1 file changed, 134 insertions(+), 96 deletions(-) diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index e552cb108a..77425e5b0f 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -194,104 +194,144 @@ (define (symlink-spec-option-parser opt name arg result) (leave (G_ "~a: invalid symlink specification~%") arg)))) - -;;; -;;; Tarball format. -;;; -(define* (self-contained-tarball/builder profile - #:key (profile-name "guix-profile") - (compressor (first %compressors)) - localstatedir? - (symlinks '()) - (archiver tar) - (extra-options '())) - "Return the G-Expression of the builder used for self-contained-tarball." +(define (set-utf8-locale profile) + "Configure the environment to use the \"en_US.utf8\" locale provided by the +GLIBC-UT8-LOCALES package." + ;; Arrange to not depend on 'glibc-utf8-locales' when using '--bootstrap'. + (and (or (not (profile? profile)) + (profile-locales? profile)) + #~(begin + (setenv "GUIX_LOCPATH" + #+(file-append glibc-utf8-locales "/lib/locale")) + (setlocale LC_ALL "en_US.utf8")))) + +(define* (populate-profile-root profile + #:key (profile-name "guix-profile") + target + localstatedir? + deduplicate? + (symlinks '())) + "Populate the root profile directory with SYMLINKS and a Guix database, when +LOCALSTATEDIR? is set. When DEDUPLICATE? is true, deduplicate the store +items, which relies on hard links." (define database (and localstatedir? (file-append (store-database (list profile)) "/db/db.sqlite"))) - (define set-utf8-locale - ;; Arrange to not depend on 'glibc-utf8-locales' when using '--bootstrap'. - (and (or (not (profile? profile)) - (profile-locales? profile)) - #~(begin - (setenv "GUIX_LOCPATH" - #+(file-append glibc-utf8-locales "/lib/locale")) - (setlocale LC_ALL "en_US.utf8")))) - (define (import-module? module) ;; Since we don't use deduplication support in 'populate-store', don't ;; import (guix store deduplication) and its dependencies, which includes - ;; Guile-Gcrypt. That way we can run tests with '--bootstrap'. + ;; Guile-Gcrypt, unless DEDUPLICATE? is #t. This makes it possible to run + ;; tests with '--bootstrap'. (and (not-config? module) - (not (equal? '(guix store deduplication) module)))) - - (with-imported-modules (source-module-closure - `((guix build pack) - (guix build store-copy) - (guix build utils) - (guix build union) - (gnu build install)) - #:select? import-module?) + (or deduplicate? (not (equal? '(guix store deduplication) module))))) + + (computed-file "profile-directory" + (with-imported-modules (source-module-closure + `((guix build pack) + (guix build store-copy) + (guix build utils) + (guix build union) + (gnu build install)) + #:select? import-module?) + #~(begin + (use-modules (guix build pack) + (guix build store-copy) + (guix build utils) + ((guix build union) #:select (relative-file-name)) + (gnu build install) + (srfi srfi-1) + (srfi srfi-26) + (ice-9 match)) + + (define symlink->directives + ;; Return "populate directives" to make the given symlink and its + ;; parent directories. + (match-lambda + ((source '-> target) + (let ((target (string-append #$profile "/" target)) + (parent (dirname source))) + ;; Never add a 'directory' directive for "/" so as to + ;; preserve its ownership when extracting the archive (see + ;; below), and also because this would lead to adding the + ;; same entries twice in the tarball. + `(,@(if (string=? parent "/") + '() + `((directory ,parent))) + ;; Use a relative file name for compatibility with + ;; relocatable packs. + (,source -> ,(relative-file-name parent target))))))) + + (define directives + ;; Fully-qualified symlinks. + (append-map symlink->directives '#$symlinks)) + + ;; Make sure non-ASCII file names are properly handled. + #+(set-utf8-locale profile) + + ;; Note: there is not much to gain here with deduplication and there + ;; is the overhead of the '.links' directory, so turn it off by + ;; default. Furthermore GNU tar < 1.30 sometimes fails to extract + ;; tarballs with hard links: + ;; <http://lists.gnu.org/archive/html/bug-tar/2017-11/msg00009.html>. + (populate-store (list "profile") #$output + #:deduplicate? #$deduplicate?) + + (when #+localstatedir? + (install-database-and-gc-roots #$output #+database #$profile + #:profile-name #$profile-name)) + + ;; Create SYMLINKS. + (for-each (cut evaluate-populate-directive <> #$output) + directives))) + #:local-build? #f + #:options (list #:references-graphs `(("profile" ,profile)) + #:target target))) + + +;;; +;;; Tarball format. +;;; +(define* (self-contained-tarball/builder profile + #:key (profile-name "guix-profile") + target + localstatedir? + deduplicate? + symlinks + compressor + archiver) + "Return a GEXP that can build a self-contained tarball." + + (define root (populate-profile-root profile + #:profile-name profile-name + #:target target + #:localstatedir? localstatedir? + #:deduplicate? deduplicate? + #:symlinks symlinks)) + + (with-imported-modules (source-module-closure '((guix build pack) + (guix build utils))) #~(begin (use-modules (guix build pack) - (guix build store-copy) - (guix build utils) - ((guix build union) #:select (relative-file-name)) - (gnu build install) - (srfi srfi-1) - (srfi srfi-26) - (ice-9 match)) - - (define %root "root") - - (define symlink->directives - ;; Return "populate directives" to make the given symlink and its - ;; parent directories. - (match-lambda - ((source '-> target) - (let ((target (string-append #$profile "/" target)) - (parent (dirname source))) - ;; Never add a 'directory' directive for "/" so as to - ;; preserve its ownership when extracting the archive (see - ;; below), and also because this would lead to adding the - ;; same entries twice in the tarball. - `(,@(if (string=? parent "/") - '() - `((directory ,parent))) - ;; Use a relative file name for compatibility with - ;; relocatable packs. - (,source -> ,(relative-file-name parent target))))))) - - (define directives - ;; Fully-qualified symlinks. - (append-map symlink->directives '#$symlinks)) + (guix build utils)) ;; Make sure non-ASCII file names are properly handled. - #+set-utf8-locale + #+(set-utf8-locale profile) (define tar #+(file-append archiver "/bin/tar")) - ;; Note: there is not much to gain here with deduplication and there - ;; is the overhead of the '.links' directory, so turn it off. - ;; Furthermore GNU tar < 1.30 sometimes fails to extract tarballs - ;; with hard links: - ;; <http://lists.gnu.org/archive/html/bug-tar/2017-11/msg00009.html>. - (populate-store (list "profile") %root #:deduplicate? #f) - - (when #+localstatedir? - (install-database-and-gc-roots %root #+database #$profile - #:profile-name #$profile-name)) + (define %root (if #$localstatedir? "." #$root)) - ;; Create SYMLINKS. - (for-each (cut evaluate-populate-directive <> %root) - directives) + (when #$localstatedir? + ;; Fix the permission of the Guix database file, which was made + ;; read-only when copied to the store in populate-profile-root. + (copy-recursively #$root %root) + (chmod (string-append %root "/var/guix/db/db.sqlite") #o644)) - ;; Create the tarball. (with-directory-excursion %root ;; GNU Tar recurses directories by default. Simply add the whole - ;; current directory, which contains all the generated files so far. + ;; current directory, which contains all the files to be archived. ;; This avoids creating duplicate files in the archives that would ;; be stored as hard links by GNU Tar. (apply invoke tar "-cvf" #$output "." @@ -320,17 +360,16 @@ (define* (self-contained-tarball name profile (warning (G_ "entry point not supported in the '~a' format~%") 'tarball)) - (gexp->derivation - (string-append name ".tar" - (compressor-extension compressor)) - (self-contained-tarball/builder profile - #:profile-name profile-name - #:compressor compressor - #:localstatedir? localstatedir? - #:symlinks symlinks - #:archiver archiver) - #:target target - #:references-graphs `(("profile" ,profile)))) + (gexp->derivation (string-append name ".tar" + (compressor-extension compressor)) + (self-contained-tarball/builder profile + #:profile-name profile-name + #:target target + #:localstatedir? localstatedir? + #:deduplicate? deduplicate? + #:symlinks symlinks + #:compressor compressor + #:archiver archiver))) ;;; @@ -676,13 +715,15 @@ (define %valid-compressors '("gzip" "xz" "none")) 'deb)) (define data-tarball - (computed-file (string-append "data.tar" - (compressor-extension compressor)) + (computed-file (string-append "data.tar" (compressor-extension + compressor)) (self-contained-tarball/builder profile + #:target target #:profile-name profile-name - #:compressor compressor #:localstatedir? localstatedir? + #:deduplicate? deduplicate? #:symlinks symlinks + #:compressor compressor #:archiver archiver) #:local-build? #f ;allow offloading #:options (list #:references-graphs `(("profile" ,profile)) @@ -811,10 +852,7 @@ (define tar (string-append #+archiver "/bin/tar")) "debian-binary" control-tarball-file-name data-tarball-file-name)))))) - (gexp->derivation (string-append name ".deb") - build - #:target target - #:references-graphs `(("profile" ,profile)))) + (gexp->derivation (string-append name ".deb") build)) ;;; -- 2.39.1
guix-patches@HIDDEN
:bug#61255
; Package guix-patches
.
Full text available.Received: (at 61255) by debbugs.gnu.org; 17 Feb 2023 01:50:22 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 16 20:50:21 2023 Received: from localhost ([127.0.0.1]:38077 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pSptF-0007TK-Iu for submit <at> debbugs.gnu.org; Thu, 16 Feb 2023 20:50:21 -0500 Received: from mail-qv1-f48.google.com ([209.85.219.48]:38714) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <maxim.cournoyer@HIDDEN>) id 1pSptA-0007SJ-2L for 61255 <at> debbugs.gnu.org; Thu, 16 Feb 2023 20:50:16 -0500 Received: by mail-qv1-f48.google.com with SMTP id t8so2962505qvr.5 for <61255 <at> debbugs.gnu.org>; Thu, 16 Feb 2023 17:50:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bKDybqOc/LxTbZoiKTfBCMuO2X8OO7B/1efhB9eM2VU=; b=FFfNLcrHlwwlyORP3ONqeHykZgZ6KvVgXcwJueDyBHacfSeDkXmDeRjgcClskJ/PeN IKSyDgmNVDCxxZhr7JY6Y+o1GBvZxaNDtmhghKzEZTfAmKzaVZiTQunCzIcdE2xmikM5 cinUfFHcafr14Zd/Fr2jWjVvysnlQ2e9JHDG/+Fvyu+gKuKv+MY3rtRvrbqMZRBgjYPC o7lzvdXdGkQxC3f5EFoI5+fFkK52DEnrMyDYphmFAexRE5P4pDrbRQQal0YddfU26dhx DRbZgyCxWwTlY8aBE8bL60hHYFvlx58z8Q9U/EVg50rVsmzsV1v5CZcrBFSyiqn3b2Gg 3jeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bKDybqOc/LxTbZoiKTfBCMuO2X8OO7B/1efhB9eM2VU=; b=6HInZX4XCqI1THiqDiRFkFaYQsoJPf0haszVGpi684AGUj5ZS0yLQSTlsQiycq3UbV 0xQXBSOzK7Z4P8uyOvLhHG4qqVVIXrRHB9+85CwM8lMq3w0+KBfm8IKDTNcDZBU6S1MW IGnEIK8VVK5KwJ2id+2Fb72xe0zPWCyNEAdYjKkl3Q5JdgkPXwfDah+XnlzHjeFDOuOf Ma90owOCzaqoeaWEGfBhplW9xAPyzS5qT7VoyPMD/Q3FoVboxmGhD5OSzpfRDBj9jeBq grK+jsZm5+GzDM28uyHxqNUxDLbGT885x1LL9Fq95ALu49lhlGY8qJNkHVVG1hWFrUcd V0xQ== X-Gm-Message-State: AO0yUKV1b6AFnGpaHHaFBRHLQ/W4DZv7TW3BTF6mWxKzh3DS38M2cypr VvVsP/E7JHUWsJP+4rAJjw5jGaJjySPBwdgS X-Google-Smtp-Source: AK7set9H2AE4ag4uzMcE5BQei0DumFogdlrnxFam6eTmSOH3tj8sc1QNHe3W4rI2dOCtKfdsFM6z/A== X-Received: by 2002:a05:6214:27cc:b0:56e:a7d1:4d65 with SMTP id ge12-20020a05621427cc00b0056ea7d14d65mr13074735qvb.52.1676598610474; Thu, 16 Feb 2023 17:50:10 -0800 (PST) Received: from localhost.localdomain (dsl-152-188.b2b2c.ca. [66.158.152.188]) by smtp.gmail.com with ESMTPSA id g66-20020a37b645000000b0073b425f6e33sm2316242qkf.100.2023.02.16.17.50.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 17:50:10 -0800 (PST) From: Maxim Cournoyer <maxim.cournoyer@HIDDEN> To: 61255 <at> debbugs.gnu.org Subject: [PATCH v2 3/8] gexp: computed-file: Honor %guile-for-build. Date: Fri, 17 Feb 2023 02:49:32 +0100 Message-Id: <20230217014938.20919-4-maxim.cournoyer@HIDDEN> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230217014938.20919-1-maxim.cournoyer@HIDDEN> References: <20230217014938.20919-1-maxim.cournoyer@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61255 Cc: Josselin Poiret <dev@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Maxim Cournoyer <maxim.cournoyer@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, ludo@HIDDEN, Christopher Baines <mail@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * guix/gexp.scm (computed-file-compiler): Honor %guile-for-build. --- (no changes since v1) guix/gexp.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/guix/gexp.scm b/guix/gexp.scm index 5f92174a2c..cabf163076 100644 --- a/guix/gexp.scm +++ b/guix/gexp.scm @@ -584,7 +584,8 @@ (define-record-type <computed-file> (options computed-file-options)) ;list of arguments (define* (computed-file name gexp - #:key guile (local-build? #t) (options '())) + #:key guile + (local-build? #t) (options '())) "Return an object representing the store item NAME, a file or directory computed by GEXP. When LOCAL-BUILD? is #t (the default), it ensures the corresponding derivation is built locally. OPTIONS may be used to pass @@ -600,7 +601,8 @@ (define-gexp-compiler (computed-file-compiler (file <computed-file>) ;; gexp. (match file (($ <computed-file> name gexp guile options) - (mlet %store-monad ((guile (lower-object (or guile (default-guile)) + (mlet %store-monad ((guile (lower-object (or guile (%guile-for-build) + (default-guile)) system #:target #f))) (apply gexp->derivation name gexp #:guile-for-build guile #:system system #:target target options))))) -- 2.39.1
guix-patches@HIDDEN
:bug#61255
; Package guix-patches
.
Full text available.Received: (at 61255) by debbugs.gnu.org; 17 Feb 2023 01:50:16 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 16 20:50:16 2023 Received: from localhost ([127.0.0.1]:38071 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pSptA-0007Sj-1u for submit <at> debbugs.gnu.org; Thu, 16 Feb 2023 20:50:16 -0500 Received: from mail-qv1-f50.google.com ([209.85.219.50]:33506) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <maxim.cournoyer@HIDDEN>) id 1pSpt8-0007SE-Ay for 61255 <at> debbugs.gnu.org; Thu, 16 Feb 2023 20:50:14 -0500 Received: by mail-qv1-f50.google.com with SMTP id j9so3014345qvt.0 for <61255 <at> debbugs.gnu.org>; Thu, 16 Feb 2023 17:50:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0qHTKOtyMhSw+KuYJe51SCUVMgqGcETF+XOOn/CziL8=; b=VPX5OcW6SKfx006wrAK0ijMb2VLPzFxZEK5iDwBLuHV34XKKrv66Pevkt8de0ttOxJ Ty+zVScfgQDb5wUMVw+Xd3l48XgKCaAJn4jwPmbqjotD10cXJwIV/oX/N4yv24gXITIc Qd4rDL4wjDtMYY1o+qX8vtmvDwdEWK0HEVtg7bAdtAjwPIMQ+vGgZWkZrBdjXd8YQv0Z lR4FSdnjv/UYQkyYrvoHa+GIv8XkLKQoycYW3LCGQQv/2j56jNtyNZk3ip8hZH4MBTqS 7RqUJvY4OnsW2uArCoLTeE/3oKS/aVkEJ4Zw/VuHana1StOtu0Cb3Bm9LQmLQ/SxWbjx SnkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0qHTKOtyMhSw+KuYJe51SCUVMgqGcETF+XOOn/CziL8=; b=MNjIee8k7cjNg12T12mAclKVK2dvv4q+peQa9ttwCqGcINFQmb01qywNBS8u7aUVf9 Gl+dMk8YMotKtRV6FmUPgYqssu+jIeV6fzOWBreyffzFX0Y6Uz4GsSPmwGq+KuhAnPf3 2IWPiuUBWzK1wTUqZBRAi0+bSC3NHxfLMC+yNaoG3/X2ciG0Sk5vXziL0utRuIfMF6EP iro4BlIsiyoJAULBqEq0XBXanZBFuJESV0NZob/aaxpCxwXwdqTKs27bnml2T6I5UHp0 ljagUDNHctqFi1nCTQqsnYNi2I1lhAYnOAcgd1ynj/ucgZ97FvuGCbt5pVnExfFQ74Z3 MygA== X-Gm-Message-State: AO0yUKUmq3NdhC7f+y4+EHm0m0R+8VTlk80Q/y46LZ1Tyyd2IjrM8C/R NhhlFlGnZ1dWGsW+r9/Jnup6wX2FM1TdzZ2b X-Google-Smtp-Source: AK7set+a/bbs5EJg/5YM+jHV5aJGRZ1dOpjIJKJ+f9ERr696Uc1K553IBHnq9g+R27dvnAotJKDmoA== X-Received: by 2002:a05:6214:5296:b0:56e:b5a1:b52d with SMTP id kj22-20020a056214529600b0056eb5a1b52dmr13554460qvb.28.1676598608768; Thu, 16 Feb 2023 17:50:08 -0800 (PST) Received: from localhost.localdomain (dsl-152-188.b2b2c.ca. [66.158.152.188]) by smtp.gmail.com with ESMTPSA id g66-20020a37b645000000b0073b425f6e33sm2316242qkf.100.2023.02.16.17.50.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 17:50:08 -0800 (PST) From: Maxim Cournoyer <maxim.cournoyer@HIDDEN> To: 61255 <at> debbugs.gnu.org Subject: [PATCH v2 2/8] pack: Use let-keywords instead of keyword-ref. Date: Fri, 17 Feb 2023 02:49:31 +0100 Message-Id: <20230217014938.20919-3-maxim.cournoyer@HIDDEN> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230217014938.20919-1-maxim.cournoyer@HIDDEN> References: <20230217014938.20919-1-maxim.cournoyer@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61255 Cc: Josselin Poiret <dev@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Maxim Cournoyer <maxim.cournoyer@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, ludo@HIDDEN, Christopher Baines <mail@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * guix/scripts/pack.scm: (debian-archive): Bind extra-options keyword arguments via let-keywords. --- Changes in v2: - Use let-keywords instead of custom keyword-ref guix/scripts/pack.scm | 97 ++++++++++++++++++++----------------------- 1 file changed, 44 insertions(+), 53 deletions(-) diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index f65642fb85..e552cb108a 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -678,16 +678,15 @@ (define %valid-compressors '("gzip" "xz" "none")) (define data-tarball (computed-file (string-append "data.tar" (compressor-extension compressor)) - (self-contained-tarball/builder - profile - #:profile-name profile-name - #:compressor compressor - #:localstatedir? localstatedir? - #:symlinks symlinks - #:archiver archiver) - #:local-build? #f ;allow offloading - #:options (list #:references-graphs `(("profile" ,profile)) - #:target target))) + (self-contained-tarball/builder profile + #:profile-name profile-name + #:compressor compressor + #:localstatedir? localstatedir? + #:symlinks symlinks + #:archiver archiver) + #:local-build? #f ;allow offloading + #:options (list #:references-graphs `(("profile" ,profile)) + #:target target))) (define build (with-extensions (list guile-gcrypt) @@ -702,6 +701,7 @@ (define build (guix build utils) (guix profiles) (ice-9 match) + (ice-9 optargs) (srfi srfi-1)) (define machine-type @@ -762,32 +762,23 @@ (define data-tarball-file-name (strip-store-file-name (copy-file #+data-tarball data-tarball-file-name) - (define (keyword-ref lst keyword) - (match (memq keyword lst) - ((_ value . _) value) - (#f #f))) - ;; Generate the control archive. - (define control-file - (keyword-ref '#$extra-options #:control-file)) - - (define postinst-file - (keyword-ref '#$extra-options #:postinst-file)) - - (define triggers-file - (keyword-ref '#$extra-options #:triggers-file)) - - (define control-tarball-file-name - (string-append "control.tar" - #$(compressor-extension compressor))) - - ;; Write the compressed control tarball. Only the control file is - ;; mandatory (see: 'man deb' and 'man deb-control'). - (if control-file - (copy-file control-file "control") - (call-with-output-file "control" - (lambda (port) - (format port "\ + (let-keywords '#$extra-options #f + ((control-file #f) + (postinst-file #f) + (triggers-file #f)) + + (define control-tarball-file-name + (string-append "control.tar" + #$(compressor-extension compressor))) + + ;; Write the compressed control tarball. Only the control file is + ;; mandatory (see: 'man deb' and 'man deb-control'). + (if control-file + (copy-file control-file "control") + (call-with-output-file "control" + (lambda (port) + (format port "\ Package: ~a Version: ~a Description: Debian archive generated by GNU Guix. @@ -797,28 +788,28 @@ (define control-tarball-file-name Section: misc ~%" package-name package-version architecture)))) - (when postinst-file - (copy-file postinst-file "postinst") - (chmod "postinst" #o755)) + (when postinst-file + (copy-file postinst-file "postinst") + (chmod "postinst" #o755)) - (when triggers-file - (copy-file triggers-file "triggers")) + (when triggers-file + (copy-file triggers-file "triggers")) - (define tar (string-append #+archiver "/bin/tar")) + (define tar (string-append #+archiver "/bin/tar")) - (apply invoke tar - `(,@(tar-base-options - #:tar tar - #:compressor #+(and=> compressor compressor-command)) - "-cvf" ,control-tarball-file-name - "control" - ,@(if postinst-file '("postinst") '()) - ,@(if triggers-file '("triggers") '()))) + (apply invoke tar + `(,@(tar-base-options + #:tar tar + #:compressor #+(and=> compressor compressor-command)) + "-cvf" ,control-tarball-file-name + "control" + ,@(if postinst-file '("postinst") '()) + ,@(if triggers-file '("triggers") '()))) - ;; Create the .deb archive using GNU ar. - (invoke (string-append #+binutils "/bin/ar") "-rv" #$output - "debian-binary" - control-tarball-file-name data-tarball-file-name))))) + ;; Create the .deb archive using GNU ar. + (invoke (string-append #+binutils "/bin/ar") "-rv" #$output + "debian-binary" + control-tarball-file-name data-tarball-file-name)))))) (gexp->derivation (string-append name ".deb") build -- 2.39.1
guix-patches@HIDDEN
:bug#61255
; Package guix-patches
.
Full text available.Received: (at 61255) by debbugs.gnu.org; 17 Feb 2023 01:50:15 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 16 20:50:15 2023 Received: from localhost ([127.0.0.1]:38069 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pSpt8-0007SW-K5 for submit <at> debbugs.gnu.org; Thu, 16 Feb 2023 20:50:14 -0500 Received: from mail-qv1-f50.google.com ([209.85.219.50]:35604) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <maxim.cournoyer@HIDDEN>) id 1pSpt7-0007S5-1e for 61255 <at> debbugs.gnu.org; Thu, 16 Feb 2023 20:50:13 -0500 Received: by mail-qv1-f50.google.com with SMTP id i12so2988906qvs.2 for <61255 <at> debbugs.gnu.org>; Thu, 16 Feb 2023 17:50:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6ZNL08ABEkxGBdDodljea/DQiaO7ROOAavBgcnFozJ8=; b=bDpid3265KEI4YDI2DoeBo5pmwIo00YDAfz1qGjds7Ig6kn1u9pz5i/wAg4W2eZV4f Ffu3hHauqWQqftJlVAskZItp0MmhTkADM1AU+SZ5X2R9o5rDcLMs20UBhBw8QP27n3Pn GyVwy9pKqbsH9cePtXF50aI/Ng5OdZ2iCntukAjvjq+V2HPII+jpA+TVyURroHDIrw5E aGj8SQ34YgnyZIJt1a/CctdyYso1c3jzQXxwyLdpIbDvKm/RPJvquucu0FIDNZlPrJK+ rq3NJ5XaNv7taLgfeebS2YeiRw2Mqd01KDlzVX5gLHnE2ou2GWHv/fIh5ImdLDeOoA6Z d8bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6ZNL08ABEkxGBdDodljea/DQiaO7ROOAavBgcnFozJ8=; b=YkNNPGe4QbOmL71pZ1wnvyis2rtbwTVUpBmvjjgUzjM7KRoeJH97vkvd3SLmzMo7uZ WVC4dO7qd+lwXVTshHoOihKmahiCNPheSbbqYFqc+0PBNBHyC7beAzBxCzm/jVCnnnw2 ydKU8BzMGqjg170jYdfijIgheFdKozXLipzxtDIaFxnbb0/5gFeHj4wG6qGHPl/JVjMQ y5DO1om34uYKlIfVD6tljZ6hZOAURfsZGIIMwHcELm82yO5MDykeHCTMC2kMOiLVW3T7 3OWZLusxa5yK163XK0MpJOrJXIqnsDNtTkJKyf7zM4aFGKwvzY3QAHRpaknPB9UG8T2E g+Tg== X-Gm-Message-State: AO0yUKWAy6z+KfsfDhxT9h9M9XbkIekYIhVSqVHCSP1G8CS7sqh9un7B 7b9tEawvDghtVymQK0Onnc7We9V1g5JBtVO6 X-Google-Smtp-Source: AK7set/gIsG+RPwpDF+PHG0VDr+kRaYZx78YfixDBaS7+Lb6/isQufWdHM1MXS10LIMjr1/2kCYj1A== X-Received: by 2002:a05:6214:29c9:b0:56b:f113:307e with SMTP id gh9-20020a05621429c900b0056bf113307emr13382189qvb.42.1676598607368; Thu, 16 Feb 2023 17:50:07 -0800 (PST) Received: from localhost.localdomain (dsl-152-188.b2b2c.ca. [66.158.152.188]) by smtp.gmail.com with ESMTPSA id g66-20020a37b645000000b0073b425f6e33sm2316242qkf.100.2023.02.16.17.50.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 17:50:07 -0800 (PST) From: Maxim Cournoyer <maxim.cournoyer@HIDDEN> To: 61255 <at> debbugs.gnu.org Subject: [PATCH v2 1/8] .dir-locals: Add let-keywords indentation rules. Date: Fri, 17 Feb 2023 02:49:30 +0100 Message-Id: <20230217014938.20919-2-maxim.cournoyer@HIDDEN> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230217014938.20919-1-maxim.cournoyer@HIDDEN> References: <20230217014938.20919-1-maxim.cournoyer@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61255 Cc: ludo@HIDDEN, Maxim Cournoyer <maxim.cournoyer@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * .dir-locals.el (scheme-mode): Add let-keywords indentation rules. --- Changes in v2: - New commit .dir-locals.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.dir-locals.el b/.dir-locals.el index a331bde0f1..b8b0fec4ca 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -72,6 +72,9 @@ (eval . (put 'substitute* 'scheme-indent-function 1)) (eval . (put 'match-record 'scheme-indent-function 2)) + ;; TODO: Contribute these to Emacs' scheme-mode. + (eval . (put 'let-keywords 'scheme-indent-function 3)) + ;; 'modify-inputs' and its keywords. (eval . (put 'modify-inputs 'scheme-indent-function 1)) (eval . (put 'replace 'scheme-indent-function 1)) -- 2.39.1
guix-patches@HIDDEN
:bug#61255
; Package guix-patches
.
Full text available.Received: (at 61255) by debbugs.gnu.org; 17 Feb 2023 01:50:08 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 16 20:50:08 2023 Received: from localhost ([127.0.0.1]:38065 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pSpt2-0007S6-7K for submit <at> debbugs.gnu.org; Thu, 16 Feb 2023 20:50:08 -0500 Received: from mail-qt1-f179.google.com ([209.85.160.179]:41948) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <maxim.cournoyer@HIDDEN>) id 1pSpt0-0007RV-Gg for 61255 <at> debbugs.gnu.org; Thu, 16 Feb 2023 20:50:07 -0500 Received: by mail-qt1-f179.google.com with SMTP id z5so4150078qtn.8 for <61255 <at> debbugs.gnu.org>; Thu, 16 Feb 2023 17:50:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=pc7DYR9EYvStuKFlbzx9jHDF2Zc+ORyfaMTQC+N1Q/0=; b=eGc+K1w29XV+mEmJqmMFApqkyVj+nmWCs0ASaXrXKvYUOrpe5jPrat8A87oTwhtOpg s7YurGT7vnCB7IKw842SBI+Z64NMkwzs+BrGyh/NcL0nGaw4lIWPz88AS7AwYsDNorQ3 6/qK2f6vIdaecodtPA2xLfukg6BaS+ri7whWJQ14SSBWpM6TroXWufQYteEywfPkc6lf prFc7qi+sVN7ZGEF6cstrJayRdHobD4yVnYn+5wf19kI3lCL62k6UcBTamcizot5PSDR J+cCjgqnGgpFn7IN9WQPBZXSP53PYT9bnuKH5cEi4W5AqSLPkUelV0ZqyMAa4HXKfNhr RjUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=pc7DYR9EYvStuKFlbzx9jHDF2Zc+ORyfaMTQC+N1Q/0=; b=xXyb2mnNHDgmw5AhCpKVMcFc1YIEB8hORMiLgkT4mUPhVD0g9OBmaw8zLnvQNUmgcp C8OYNpR1IaJS0SNF2daCAxmYHJ+1WgUXZa/Bg1jTKcEe36GGzeEt7zfgPVmzkUxUA8CO hj9W/A0VYjkxFiajhNiuT0ET1qbKgQaJSPpWz0Nispt4PPGX4axLhmpohhEui7e3pdid isM/r5hwHFn5TxegrEt3mcti8hHmZ31B3DZlWmrXeczUP8YKNRqy4zozyo6/ZEPzK+4y tSANZ0jczg6yFvMk5gXu40qLKHNclt9S24SbRk7GHUAUEPKSfq3lKRYZgw9w4lA8qh8Z 8soQ== X-Gm-Message-State: AO0yUKUpOVxAO5RpezPIX2b2z9fTJW4ydwX0onfHUves8cEnOxmEunh9 lOpgZ6REc6cX1vZnzsyZeD2T9IQCqak6lhf9 X-Google-Smtp-Source: AK7set8Lxuu/vT2nKtwV3NvFGQTC10ABD2HFG3wJyI4fPWzHHh9j0uvZxfWoEdjxnH4pN0i+gVOcsw== X-Received: by 2002:a05:622a:1990:b0:3b8:691f:271 with SMTP id u16-20020a05622a199000b003b8691f0271mr13161103qtc.63.1676598600625; Thu, 16 Feb 2023 17:50:00 -0800 (PST) Received: from localhost.localdomain (dsl-152-188.b2b2c.ca. [66.158.152.188]) by smtp.gmail.com with ESMTPSA id g66-20020a37b645000000b0073b425f6e33sm2316242qkf.100.2023.02.16.17.49.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 17:50:00 -0800 (PST) From: Maxim Cournoyer <maxim.cournoyer@HIDDEN> To: 61255 <at> debbugs.gnu.org Subject: [PATCH v2 0/8] Add support for the RPM format to "guix pack" Date: Fri, 17 Feb 2023 02:49:29 +0100 Message-Id: <20230217014938.20919-1-maxim.cournoyer@HIDDEN> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 3.0 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hello, I've addressed most of Ludovic's comments in this v2 rework (thanks!). Below is the original cover letter. This series adds support for the RPM format to "guix pack", so that one can generate an RPM archive via e.g. "guix pack -f rpm hello", and install it on their favorite RPM-based GNU/Linux distribution [...] Content analysis details: (3.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 3.0 MANY_TO_CC Sent to 10+ recipients 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (maxim.cournoyer[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.160.179 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.160.179 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-Debbugs-Envelope-To: 61255 Cc: Josselin Poiret <dev@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Maxim Cournoyer <maxim.cournoyer@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, ludo@HIDDEN, Christopher Baines <mail@HIDDEN>, Julien Lepiller <julien@HIDDEN>, Florian Pelz <pelzflorian@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, Thiago Jung Bauermann <bauermann@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hello, I've addressed most of Ludovic's comments in this v2 rework (thanks!). Below is the original cover letter. This series adds support for the RPM format to "guix pack", so that one can generate an RPM archive via e.g. "guix pack -f rpm hello", and install it on their favorite RPM-based GNU/Linux distribution [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.160.179 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.160.179 listed in list.dnswl.org] 3.0 MANY_TO_CC Sent to 10+ recipients 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (maxim.cournoyer[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager Hello, I've addressed most of Ludovic's comments in this v2 rework (thanks!). Below is the original cover letter. This series adds support for the RPM format to "guix pack", so that one can generate an RPM archive via e.g. "guix pack -f rpm hello", and install it on their favorite RPM-based GNU/Linux distribution. With the exception of the payload compression, the generation of the archive is fully handled in Scheme, which ended up being tricky, with the documentation about the RPM binary format being scarce. Most of the problems encountered were figured out stepping an 'rpm' command invocation in GDB, which felt a bit like reverse engineering! Anyway, the end result appears to work well and has few dependencies (compared to using 'rpmbuild', as most other projects do), so I think it was worth the effort. Thanks! Changes in v2: - New commit - Use let-keywords instead of custom keyword-ref - Better make use of the new indentation rule - Use let-keywords instead of custom keyword-ref - Adjust commentary block in (guix rpm) - Adjust long define indentation in (guix scripts pack) - Separate guix pack / rpm --install example blocks - New commit - New commit Maxim Cournoyer (8): .dir-locals: Add let-keywords indentation rules. pack: Use let-keywords instead of keyword-ref. gexp: computed-file: Honor %guile-for-build. pack: Extract populate-profile-root from self-contained-tarball/builder. tests: pack: Fix indentation. pack: Add RPM format. etc: Add a news entry snippet. news: Add entry for the new 'rpm' guix pack format. .dir-locals.el | 3 + Makefile.am | 2 + doc/guix.texi | 48 +- etc/news.scm | 17 +- etc/snippets/yas/scheme-mode/guix-news-entry | 9 + guix/gexp.scm | 6 +- guix/rpm.scm | 623 +++++++++++++++++++ guix/scripts/pack.scm | 555 ++++++++++++----- tests/pack.scm | 336 +++++----- tests/rpm.scm | 86 +++ 10 files changed, 1379 insertions(+), 306 deletions(-) create mode 100644 etc/snippets/yas/scheme-mode/guix-news-entry create mode 100644 guix/rpm.scm create mode 100644 tests/rpm.scm base-commit: c1303a914c172dc80166be22389e7032c5ea5e09 -- 2.39.1
guix-patches@HIDDEN
:bug#61255
; Package guix-patches
.
Full text available.Received: (at 61255) by debbugs.gnu.org; 16 Feb 2023 22:17:41 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 16 17:17:41 2023 Received: from localhost ([127.0.0.1]:37851 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pSmZQ-0001ed-Nc for submit <at> debbugs.gnu.org; Thu, 16 Feb 2023 17:17:41 -0500 Received: from mail-qt1-f170.google.com ([209.85.160.170]:39438) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <maxim.cournoyer@HIDDEN>) id 1pSmZP-0001eO-5q for 61255 <at> debbugs.gnu.org; Thu, 16 Feb 2023 17:17:39 -0500 Received: by mail-qt1-f170.google.com with SMTP id g18so3790459qtb.6 for <61255 <at> debbugs.gnu.org>; Thu, 16 Feb 2023 14:17:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=dGReG9jPb0CH05XbGEMhqKOWqlcexkefBLRpaKIYprw=; b=Ft/tewE2Iu0OH82Co3YaNtqewILJ3nUfraC6DJiTskR9SMPVP6BuG+kN+9AlVpEKcR DxX32/Tv7roCt1iL3zOnZlhiv4MA+XQuA2ik5RluIw3yBOOV13zxs7bNMFj/GlbyujvQ Eebt2x4/q5nZCKtoVwa4YFFtK5r4cp/N2XNpRRdC65vQL7WzLNitGEEqEHj3rEyvOns3 DMiHiks2wY/eLHKWrnEc4zn78+/sTYf9iRFwryT987J568CxAOvNg7+geTDNKZE4fDU8 EjmPWIyyX/oM+UFgmCuRwoJPiBJ0/5VNN2zUuNjAr7xu2UVX6Ll1MgjsDdkeXM7Kd8zz cpCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=dGReG9jPb0CH05XbGEMhqKOWqlcexkefBLRpaKIYprw=; b=b/fJ8e816JSLP/4FAo/Eek/l6AD/bPNfpO60fclDIuWwjel3cz/MDD7K2v1hkJj/vX b6Wqb+MfURwzERDePakQs/89NLFJl3a0oUTCe8qu48leGiYzMw6RiNWLaYHBXJMGf70Q 1eVh9kSHbhK35dxA6iC7acqhX5ReZWm0uIMRfViT/VPBRHaF9i5lYsr08byZKZ7+Pfto hhGgTnHTsWXmxSvWIvX8uln0cs5DuBNqotslthHzTjf0A9PV5rQjDFhRkxusSmYAczBA 3RbdeDo4KUvdiPC83xCyvUfTzIrVI25WgcWxkpgxPBg3RFMaLGo3NbSgPizk+1sXaqL8 6IcQ== X-Gm-Message-State: AO0yUKWKlJfLr659MJFJL3no+WNrUaJaYsNpCQ6zf7dWHP1kwGZcdpHi y1VnFY2aiIYlS5zmod9xy/o= X-Google-Smtp-Source: AK7set9sAu35E7Yy7nsPAfL1697U37peER5kTCI2sLV3Nzk3sQJ1dB2xCGRLU2pOmtAVWRhhqM0oZA== X-Received: by 2002:ac8:5f88:0:b0:3b6:2e9b:cf2b with SMTP id j8-20020ac85f88000000b003b62e9bcf2bmr11397255qta.14.1676585853270; Thu, 16 Feb 2023 14:17:33 -0800 (PST) Received: from hurd (dsl-152-188.b2b2c.ca. [66.158.152.188]) by smtp.gmail.com with ESMTPSA id a184-20020a3798c1000000b0071b158849e5sm2153010qke.46.2023.02.16.14.17.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 14:17:32 -0800 (PST) From: Maxim Cournoyer <maxim.cournoyer@HIDDEN> To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN> Subject: Re: bug#61255: [PATCH 0/5] Add support for the RPM format to "guix pack" References: <20230203221409.15886-2-maxim.cournoyer@HIDDEN> <20230203221409.15886-6-maxim.cournoyer@HIDDEN> <87edquk97r.fsf_-_@HIDDEN> Date: Thu, 16 Feb 2023 23:17:31 +0100 In-Reply-To: <87edquk97r.fsf_-_@HIDDEN> ("Ludovic =?utf-8?Q?Court=C3=A8s?= =?utf-8?Q?=22's?= message of "Sun, 12 Feb 2023 19:52:08 +0100") Message-ID: <87bkltuuf8.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61255 Cc: Josselin Poiret <dev@HIDDEN>, Christopher Baines <mail@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, 61255 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hi again! Ludovic Court=C3=A8s <ludo@HIDDEN> writes: > Hey! > > Maxim Cournoyer <maxim.cournoyer@HIDDEN> skribis: > >> * guix/rpm.scm: New file. >> * guix/scripts/pack.scm (rpm-archive): New procedure. >> (%formats): Register it. >> (show-formats): Add it. >> (guix-pack): Register supported extra-options for the rpm format. >> * tests/pack.scm (rpm-for-tests): New variable. >> ("rpm archive can be installed/uninstalled"): New test. >> * tests/rpm.scm: New test. >> * doc/guix.texi (Invoking guix pack): Document it. > > (=E2=80=98Makefile.am=E2=80=99 changes are missing here.) > > Woow, there=E2=80=99s a lot of fun stuff in here! :-) Nice work! > > Perhaps we=E2=80=99ll soon see Guix-generated RPMs for, say, Jami? :-) Thanks! Yes, Guix-baked RPMs to the packaging pipeline of Jami was the motivator; in theory maintaining just "One Way" of packaging things (Guix) should now allow covering all the systems that Jami currently targets (and more). > Overall it looks great to me. Great! > Perhaps you should submit an =E2=80=98etc/news.scm=E2=80=99 entry here so= that > translators can work on it before it=E2=80=99s eventually pushed (I think= that=E2=80=99s > the workflow Julien proposed). Done, although I'm weary of forgetting to update the commit (I guess make check-news would catch this though). > Some comments follow: > >> +@cindex Debian, build a .deb package with guix pack > > @file{.deb} and @command{guix pack} I thought cindex text shouldn't be decorated, no? >> +The RPM format supports relocatable packages via the @option{--prefix} >> +option of the @command{rpm} command, which can be handy to install an >> +RPM package to a specific prefix, making installing multiple >> +Guix-produced RPM packages side by side possible. >> + >> +@example >> +guix pack -f rpm -R -C xz -S /usr/bin/hello=3Dbin/hello hello >> +sudo rpm --install --prefix=3D/opt /gnu/store/...-hello.rpm >> +@end example > > Perhaps use two different @example boxes to distinguish between the Guix > machine that produces the RPM, and the RPM-based system that installs > it? Technically, the above can run on your Guix System if you 'mkdir /var/lib/rpm && chown $USER /var/lib/rpm' :-). That's what I used while developing. But I've separated the box, as the common and recommended use case is to install these on non-Guix systems. >> +@quotation Note >> +Similarly to Debian packages, two RPM packages with conflicting files >> +cannot be installed simultaneously. Contrary to Debian packages, RPM >> +supports relocatable packages, so file conflicts can be avoided by >> +installing the RPM packages under different installation prefixes, as >> +shown in the above example. > > So for relocatable packages, one really needs =E2=80=98guix pack -R=E2=80= =99 IIUC. > Interesting. Indeed. If you try to use rpm's --relocate without having passed -R, it'll fail and tell you the package is not relocatable. >> +;;; Commentary: >> +;;; >> +;;; This module provides the building blocks required to construct RPM >> +;;; archives. It is intended to be importable on the build side, so sh= ouldn't >> +;;; depend on (guix diagnostics) or other host-side-only modules. >> + >> +(define-module (guix rpm) > > The commentary should be followed by =E2=80=9CCode:=E2=80=9D and it shoul= d come after > the =E2=80=98define-module=E2=80=99 form. That way, (ice-9 documentation= ) can find it. Thanks. I didn't know that, or the reason it was this way. >> +(define (make-header-index+data entries) >> + "Return the index and data sections as u8 number lists, via multiple = values. >> +An index is composed of four u32 (16 bytes total) quantities, in order:= tag, >> +type, offset and count." >> + (match (fold (match-lambda* >> + ((entry (offset . (index . data))) >> + (let* ((tag (header-entry-tag entry)) >> + (tag-number (rpm-tag-number tag)) >> + (tag-type (rpm-tag-type tag)) >> + (count (header-entry-count entry)) >> + (data* (header-entry->data entry)) >> + (alignment (entry-type->alignement tag-type)) >> + (aligned-offset (next-aligned-offset offset al= ignment)) >> + (padding (make-list (- aligned-offset offset) = 0))) >> + (cons (+ aligned-offset (length data*)) >> + (cons (append index >> + (u32-number->u8-list tag-number) >> + (u32-number->u8-list tag-type) >> + (u32-number->u8-list aligned-of= fset) >> + (u32-number->u8-list count)) >> + (append data padding data*)))))) > > I think it would be possible (throughout the code) to avoid building > lists of bytes and instead directly produce bytevectors or, better, > produce procedures that write bytes directly to an output port (with > macros along the lines of =E2=80=98define-operation=E2=80=99 in (guix sto= re) or > =E2=80=98define-pack=E2=80=99 in (guix cpio)). > > I don=E2=80=99t think it should be a blocker though, it=E2=80=99s okay to= keep it this > way. OK. I pondered about the API, but in the end it seems more malleable to keep everything in an list "intermediate representation", as I could stitch it together at a later point and more easily inspect things in tests. >> +(define (files->md5-checksums files) >> + "Return the MD5 checksums (formatted as hexadecimal strings) for FILE= S." > > Does it have to be MD5? If RPM supports SHA1 or SHA2*, it would be best > to pick one of these; MD5 is okay to detect unintended modifications, > but it=E2=80=99s useless if we care about malicious tampering. We can choose the algorithm, but MD5 is still the default in the latest RPM version. These are intended to detect simple data corruption. >> + (define name (or (and=3D> single-entry manifest-entry-name) >> + (manifest->friendly-name manifest))) >> + >> + (define version (or (and=3D> single-entry manifest-entry-ve= rsion) >> + "0.0.0")) >> + >> + (define lead (generate-lead (string-append name "-" version) >> + #:target (or #$target %host-typ= e))) >> + >> + (define payload-digest (bytevector->hex-string >> + (file-sha256 #$payload))) > > Nitpick: the convention usually followed is to write the value, when > it=E2=80=99s long enough as is the case here, on the next line, as in: Oh, OK! I hadn't noticed, adjusted. > (define something > value-thats-a-little-bit-long) > >> + (unless store (test-skip 1)) >> + (test-assertm "rpm archive can be installed/uninstalled" store > > Really cool to have a full-blown test like this. > >> +(define-module (test-rpm) >> + #:use-module (guix rpm) > > That too! > > Thanks, > Ludo=E2=80=99. Thanks for taking the time to review this! The changes implemented will appear in v2. -- Maxim
guix-patches@HIDDEN
:bug#61255
; Package guix-patches
.
Full text available.Received: (at 61255) by debbugs.gnu.org; 16 Feb 2023 15:25:41 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 16 10:25:41 2023 Received: from localhost ([127.0.0.1]:37339 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pSg8j-00072E-Ju for submit <at> debbugs.gnu.org; Thu, 16 Feb 2023 10:25:41 -0500 Received: from mail-qt1-f179.google.com ([209.85.160.179]:38751) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <maxim.cournoyer@HIDDEN>) id 1pSg8g-000720-TZ for 61255 <at> debbugs.gnu.org; Thu, 16 Feb 2023 10:25:40 -0500 Received: by mail-qt1-f179.google.com with SMTP id c2so2489359qtw.5 for <61255 <at> debbugs.gnu.org>; Thu, 16 Feb 2023 07:25:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=hxO/pwV/DzJRBWF1qxgEollbC/Tgee4gOlu6LgsGPHw=; b=MzNid+HhAZNe0K2Szk5jkNfaLXg779fHraWumvMgRKhT1q85fM7PN1Q+lkqP3knnk0 asqIx4rAmRf9wHmJwEoDrI+xE/VI6J9kmT9woq2/ujhk37gZKGyLuiXpQRF/9Il48LqD DmD0GDlqwEDCXGD1TIe7/f8kjX+pWt71SWiAOnjAFBjDvC4OEWEm7g1eWBaqAlS+I5qf EiI9blHPI/FholhA+gE4NuablP8crwXh4yJ4foxxt5+807Rs+hlMqJjIcgb6Ju625ZhW 5Kqeai7hOGg9C3zhOlIeRubUas5IS+JJ/qWc1k+y2qb4Uj204e8DEXe71OlfNMqHfqBU QWyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=hxO/pwV/DzJRBWF1qxgEollbC/Tgee4gOlu6LgsGPHw=; b=rV8O83Q+GsdAAZVfK9Eqq3YD6ekheqsyDavdavXPZZ4z30cQqOkr/OxFAmURTwa7d9 lMU6QYNtQC5iJYaPmNs6/nJ2I2e9Qe2+g/o7Uei/buj/pLIml2NsiQ6Ko/5/KoTnDX2P rv1FHm42MN0rktg8lQ9814NHloy/WsOMkXExuXp5ql+jG0wCQzbFrbe45h05+XhQaUUH c7cD/SFURa0oRR5SHnHREFaDiWfvgJ3s3DdlPUFU3xL0hAUv47afMYxHwBI4uLCeGYlK KKLSamcsO5bGfBcsQjDdlkZiBF3QE+5JTBfuheORY53wQaP1fDC6c/hkRHbkV/Bm06iY w6XA== X-Gm-Message-State: AO0yUKWZlTd0r10wE5aKz1LWFRbd9r5+m1o3Ns0hiTq1YDj5wt2YK20u 1v6dfxSFdcEbdeEum1+cUUA= X-Google-Smtp-Source: AK7set8zMx9T0+VT2PiBtxa7Cm091Vg71Pu0iE7ikegGxrH0fl7BJd4SQji1a43KXxqWxajJDnGaxg== X-Received: by 2002:a05:622a:2c7:b0:3bb:7702:97f5 with SMTP id a7-20020a05622a02c700b003bb770297f5mr11014071qtx.15.1676561133353; Thu, 16 Feb 2023 07:25:33 -0800 (PST) Received: from hurd (dsl-152-188.b2b2c.ca. [66.158.152.188]) by smtp.gmail.com with ESMTPSA id 127-20020a370485000000b0073b732803c4sm1431700qke.5.2023.02.16.07.25.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 07:25:33 -0800 (PST) From: Maxim Cournoyer <maxim.cournoyer@HIDDEN> To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN> Subject: Re: bug#61255: [PATCH 0/5] Add support for the RPM format to "guix pack" References: <20230203161926.26886-1-maxim.cournoyer@HIDDEN> <20230203221409.15886-2-maxim.cournoyer@HIDDEN> <877cwmk8yb.fsf_-_@HIDDEN> Date: Thu, 16 Feb 2023 10:25:31 -0500 In-Reply-To: <877cwmk8yb.fsf_-_@HIDDEN> ("Ludovic =?utf-8?Q?Court=C3=A8s?= =?utf-8?Q?=22's?= message of "Sun, 12 Feb 2023 19:57:48 +0100") Message-ID: <874jrlws2c.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61255 Cc: Josselin Poiret <dev@HIDDEN>, Christopher Baines <mail@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, 61255 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hi Ludovic, Ludovic Court=C3=A8s <ludo@HIDDEN> writes: > Maxim Cournoyer <maxim.cournoyer@HIDDEN> skribis: > >> Rationale: the upcoming rpm-archive builder will also use it. >> >> * guix/scripts/pack.scm: >> (keyword-ref): New top-level procedure, extracted from... >> (debian-archive): ... here. Adjust usages accordingly. > > Commit aeded14b8342c1e72afd014a1bc121770f8c3a1c added #:extra-options, > which is why we need =E2=80=98keyword-ref=E2=80=99 now. > > I=E2=80=99m thinking a different option would be to use #:allow-other-key= s in > all the image build procedures. That way the deb and rpm build > procedures would get their extra arguments, which would be automatically > bound without requiring manual =E2=80=98keyword-ref=E2=80=99 calls. Soun= ds a bit nicer > maybe? I'm not sure; it sounds convenient, but at the same time, it makes the "contract" of the pack builders even fuzzier that it currently is. > If we skip to the current approach, we should consider using > =E2=80=98let-keywords=E2=80=99 from (ice-9 optargs) instead of adding =E2= =80=98keyword-ref=E2=80=99. > > Anyway, not a blocker IMO, but something to keep in mind. OK! I'll try adapting to use (ice-9 optargs) for the next revision. --=20 Thanks, Maxim
guix-patches@HIDDEN
:bug#61255
; Package guix-patches
.
Full text available.Received: (at 61255) by debbugs.gnu.org; 16 Feb 2023 15:23:08 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 16 10:23:08 2023 Received: from localhost ([127.0.0.1]:37314 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pSg6F-0006x3-VR for submit <at> debbugs.gnu.org; Thu, 16 Feb 2023 10:23:08 -0500 Received: from mail-qt1-f173.google.com ([209.85.160.173]:45934) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <maxim.cournoyer@HIDDEN>) id 1pSg6E-0006wM-4D for 61255 <at> debbugs.gnu.org; Thu, 16 Feb 2023 10:23:06 -0500 Received: by mail-qt1-f173.google.com with SMTP id h24so2436695qta.12 for <61255 <at> debbugs.gnu.org>; Thu, 16 Feb 2023 07:23:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=8OtE0PF+azT8eiWPfFpkBfwA67RManM63QL7zfenerQ=; b=ceQhhZc6hgkWs5xFytMGthKEQXJxEO/gTYvyaBjbqNxHLoSnIrPpmgnflutyhrxPeN 1fQFFBnTKnfFGaNAdEgNFWm62l3SSiAzHe6Kj+4l7CLu6cCQbTZUxLCwmr1nwzJvNjD2 W5fui6xEVVpSSCW09iqWKeSzItCSOkxckCyOywI5mn7OYj/OA9L3aqgZIIlCvojlZlKl bnOULfAxJZULsJ02q2EuDAeLJhjaJlV+F326d6PILkCB8mtSMpY7FS3lsUrYYp623nvt vrrsf1YwOLKTX9As8s+aVYB6LT9lwdTOpJ/tNcGQft5PX+ChUcbxg95+AQ/MXvVcO/iN M/Mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=8OtE0PF+azT8eiWPfFpkBfwA67RManM63QL7zfenerQ=; b=wMVjcEKNygvEeRkP0GfM874wt9vLdOlYIkqQ8Tvr0L0p1YJUeYBGwrcnb848izsEtK SJ1VcA9nG6djWXPy+rl6Yg7oPM4Nhljx20fC6/L58EYz4yyyaSDgKLaOEdbdERGqGa+R GV/FDADPZAAo2GtwkUhfi3tISxqy0Of/w0KDy2sMrm+E2oqyrld79hwJep8hwe5ei7QN IGcnaH+1PAW0uojnTnHIcmtLN836pDrMygEGNRvizV9QhITudBj1HwDxjomxIoKJ+AjO cx3jfKLFgZOCzXmKZO+ZHfyedx6zwLmXAwn4Z4Z4IeytUokkYGmKRKP0pkzwroUEYs/R IhMA== X-Gm-Message-State: AO0yUKWUfFu6wM/f97F5lgFaPvgcJpTGkUje/apfe0TkubFnEyIMTSea 6aFPEm/x2Mn89ySkHGq/NTBZGQFlNVkE6PBz X-Google-Smtp-Source: AK7set+n1HqHsZAUzkIUerMcRcnqT1cL7aKtnM0rIy9EZcTCWuFcL3BhsA+zcyZEZOIdwMcjMPb0eQ== X-Received: by 2002:a05:622a:1011:b0:3b9:b98b:3c56 with SMTP id d17-20020a05622a101100b003b9b98b3c56mr9960478qte.68.1676560980224; Thu, 16 Feb 2023 07:23:00 -0800 (PST) Received: from hurd (dsl-152-188.b2b2c.ca. [66.158.152.188]) by smtp.gmail.com with ESMTPSA id o7-20020a05622a008700b003b62e8b77e7sm1406453qtw.68.2023.02.16.07.22.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 07:22:59 -0800 (PST) From: Maxim Cournoyer <maxim.cournoyer@HIDDEN> To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN> Subject: Re: bug#61255: [PATCH 0/5] Add support for the RPM format to "guix pack" References: <20230203221409.15886-2-maxim.cournoyer@HIDDEN> <20230203221409.15886-5-maxim.cournoyer@HIDDEN> <87357alp9n.fsf_-_@HIDDEN> Date: Thu, 16 Feb 2023 10:22:58 -0500 In-Reply-To: <87357alp9n.fsf_-_@HIDDEN> ("Ludovic =?utf-8?Q?Court=C3=A8s?= =?utf-8?Q?=22's?= message of "Sun, 12 Feb 2023 19:20:04 +0100") Message-ID: <878rgxws6l.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61255 Cc: 61255 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hi Ludovic, Ludovic Court=C3=A8s <ludo@HIDDEN> writes: > Hi, > > Maxim Cournoyer <maxim.cournoyer@HIDDEN> skribis: > >> * tests/pack.scm: Fix indentation. > > [...] > >> (check (gexp->derivation >> - "check-tarball" >> - (with-imported-modules '((guix build utils)) > > [...] > >> + "check-tarball" >> + (with-imported-modules '((guix build utils)) > > I=E2=80=99m not convinced by the indentation rule for =E2=80=98gexp->deri= vation=E2=80=99 added > in 82daab42811a2e3c7684ebdf12af75ff0fa67b99: there=E2=80=99s no reason to= treat > =E2=80=98gexp->derivation=E2=80=99 differently from other procedures. The benefit I saw was that writing --8<---------------cut here---------------start------------->8--- (gexp->derivation the-name #~(begin (the (multi-line (gexp))))) --8<---------------cut here---------------end--------------->8--- Seemed most readable/natural. I saw some code in our code base was already indented that way, but Emacs wasn't happy about it then. > What about removing that rule from =E2=80=98.dir-locals.el=E2=80=99 and k= eeping > =E2=80=98tests/pack.scm=E2=80=99 unchanged? I don't feel too strongly about it, but I thought being able to indent as above was neater than having to drop the-name on the second like, or have it indented like under: --8<---------------cut here---------------start------------->8--- (gexp->derivation the-name #~(begin (the (multi-line (gexp))))) --8<---------------cut here---------------end--------------->8--- > (Also not sure about the =E2=80=98computed-file=E2=80=99 rule. For all t= hese things, > we=E2=80=99ll want to keep Emacs and (guix read-print) in sync, too.) Ah! Thanks for pointing that out. I can address this separately. It'd be nice if (guix read-print) understood the rules under .dir-locals.el :-). --=20 Thanks, Maxim
guix-patches@HIDDEN
:bug#61255
; Package guix-patches
.
Full text available.Received: (at 61255) by debbugs.gnu.org; 16 Feb 2023 15:12:40 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Thu Feb 16 10:12:40 2023 Received: from localhost ([127.0.0.1]:37263 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pSfw8-0006fQ-FU for submit <at> debbugs.gnu.org; Thu, 16 Feb 2023 10:12:40 -0500 Received: from mail-qv1-f48.google.com ([209.85.219.48]:45868) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <maxim.cournoyer@HIDDEN>) id 1pSfw6-0006fC-Fk for 61255 <at> debbugs.gnu.org; Thu, 16 Feb 2023 10:12:38 -0500 Received: by mail-qv1-f48.google.com with SMTP id s17so421838qvq.12 for <61255 <at> debbugs.gnu.org>; Thu, 16 Feb 2023 07:12:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=fBiWcdGBTkJH5dq+KlF/ZxyWbu6PJmgfFGBRtXsJ/8w=; b=BqLbU7WCNDG40TyvykJne2u8LdWgmqXBHSSqKhpRDy84bitG8rCJXmIG8QNHpzyH0I 5/ReaYLaWs53l4gnS195mn2bRKHQXbQq3Jfstp82l4TW4neCbir/5PTLGzIfoSm85qB7 idHWSmid2vJiBEm07/eAcNdBNLxRRhmZQ8KAKN6N+tWctkZuQQipHJAX+3v6Nsg/HOt2 JNl5rS6LtFh+CHyriIBxq5rhpl3Gai/t215rKOYtzpkPkefTjs7KMxlzfgPtJGPPg+4y rxigotsGB0+SCVglF3q8bxSZ1B5FkRndR/dDCOngAA0X+s12ZcbW1mD1BL6E0GM/js0F c3JA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=fBiWcdGBTkJH5dq+KlF/ZxyWbu6PJmgfFGBRtXsJ/8w=; b=trIfeboj1TosAAB2JLcj7uKUE/BWM6rvH0MGCFPDOCtXdik0X4uapgpeMzvl4pDN1g gpoS8EpJrw8WvXVPQdwHyTWqPD0JV7rlSffFWY72M0GiJV5ZTn9TaAzBTxAZjZhgGi+s nbSe/CCVoOJS43GMpJvDZSQfs4KKWkWIW6Qt0cl7zBRbbmodYfRJvGNhr3e1aol9SEHQ c5ILefj7bQ9gYXzEKZLHEYCns4pLbPF+JAneo6x0LiGta4uAz+wKA8mAdja2xi5xHUXG 5ZXqu4XE63j2SXhXQ0Dg0fjju8wregKdnr4oskRfQVMosXSezd1unUK3jBsrFkCCSis/ rMbQ== X-Gm-Message-State: AO0yUKU6/x5vTDDR/53ob9cUojujw5MKb6VIN0YRbsuZ+k8XoADhvuhA D6ocBlSElNmvjHiaZ5viCIc+ub7NxP2giyQc X-Google-Smtp-Source: AK7set/N4VfQHhqJmnZZnsplmkt3mD5Vc1gKeDmxtnanA7fJHdQKK5+9nQPfpJ7nwK1eIqoe5CbZcw== X-Received: by 2002:a05:6214:d89:b0:56f:37a:4561 with SMTP id e9-20020a0562140d8900b0056f037a4561mr1761456qve.34.1676560352686; Thu, 16 Feb 2023 07:12:32 -0800 (PST) Received: from hurd (dsl-152-188.b2b2c.ca. [66.158.152.188]) by smtp.gmail.com with ESMTPSA id l67-20020a378946000000b0073b9ae1c022sm806522qkd.135.2023.02.16.07.12.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 07:12:32 -0800 (PST) From: Maxim Cournoyer <maxim.cournoyer@HIDDEN> To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN> Subject: Re: bug#61255: [PATCH 0/5] Add support for the RPM format to "guix pack" References: <20230203221409.15886-2-maxim.cournoyer@HIDDEN> <20230203221409.15886-3-maxim.cournoyer@HIDDEN> <877cwyw7yc.fsf@HIDDEN> <87h6w2p02y.fsf@HIDDEN> <87a61ilpi6.fsf_-_@HIDDEN> Date: Thu, 16 Feb 2023 10:12:30 -0500 In-Reply-To: <87a61ilpi6.fsf_-_@HIDDEN> ("Ludovic =?utf-8?Q?Court=C3=A8s?= =?utf-8?Q?=22's?= message of "Sun, 12 Feb 2023 19:14:57 +0100") Message-ID: <87fsb5wso1.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61255 Cc: Josselin Poiret <dev@HIDDEN>, Christopher Baines <mail@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, 61255 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hi Ludovic! Ludovic Court=C3=A8s <ludo@HIDDEN> writes: > Hi Maxim, > > Maxim Cournoyer <maxim.cournoyer@HIDDEN> skribis: > >> Ludovic Court=C3=A8s <ludo@HIDDEN> writes: >> >>> Hello! >>> >>> Maxim Cournoyer <maxim.cournoyer@HIDDEN> skribis: >>> >>>> * guix/gexp.scm (computed-file): Set the default value of the #:guile = argument >>>> to that of the %guile-for-build parameter. >>> >>> [...] >>> >>>> (define* (computed-file name gexp >>>> - #:key guile (local-build? #t) (options '())) >>>> + #:key (guile (%guile-for-build)) >>>> + (local-build? #t) (options '())) >>> >>> I think that would lead =E2=80=98computed-file=E2=80=99 to pick (%guile= -for-build) at >>> the wrong time (time of call instead of time of lowering). >>> >>> Commit ab25eb7caaf5571cc9f8d6397a1eae127d7e29d1 made it #f such that >>> =E2=80=98gexp->derivation=E2=80=99 gets to resolve it at the =E2=80=9Cr= ight=E2=80=9D time. >> >> I see! I think you are right. Would making the change in the >> associated gexp compiler do the right thing? Currently it ignores the >> %guile-for-build fluid as set in the tests/pack.scm test suite for >> example. Something like this: > > I don=E2=80=99t fully understand the context. My preference would go to = doing > like the =E2=80=98computed-file=E2=80=99 tests in =E2=80=98tests/gexp.scm= =E2=80=99, where we explicitly > pass #:guile %bootstrap-guile. With the refactoring done in patch 3/5 ("pack: Extract populate-profile-root from self-contained-tarball/builder."), a computed-file is used in the factorized building block 'populate-profile-root'. Without this patch, the tests making use of it would attempt to build Guile & friends in the test store. > That said, it seems like patch #5 in this series doesn=E2=80=99t actually= use > =E2=80=98computed-file=E2=80=99 in =E2=80=98tests/pack.scm=E2=80=99, does= it? It does, indirectly. I hope that helps! --=20 Thanks, Maxim
guix-patches@HIDDEN
:bug#61255
; Package guix-patches
.
Full text available.Received: (at 61255) by debbugs.gnu.org; 12 Feb 2023 18:57:59 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sun Feb 12 13:57:59 2023 Received: from localhost ([127.0.0.1]:46766 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pRHXz-0005KV-FT for submit <at> debbugs.gnu.org; Sun, 12 Feb 2023 13:57:59 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33224) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1pRHXx-0005KF-OU for 61255 <at> debbugs.gnu.org; Sun, 12 Feb 2023 13:57:58 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1pRHXs-0007id-Bf; Sun, 12 Feb 2023 13:57:52 -0500 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=O1TpdhidQXMx3ItmO6b4bn6sgUq/rc+Ns4LR9/YFYTc=; b=dDQ+L8rJjpipHUo4XkPB EyQlWA/pIQVRw1MhYPzZDnd6Cq8F9dktovFQZ0S/qnwpxyyeJV0srOAfXmQWMn6khpfZIfoZoaf44 BJsOP6voFV479SO0xAPy0FjEU8Xk6Qe5o5OBiol22Gw2cskbEeHMM9B9YU3k4uemZ/KI8NyaiL5GF 7laE6anZIYxPWIIbFKN21xv8fBd4XfIC9GVrPuipFjT90VcWnsLCgoCwxVJxFYciHmwcczgcUB4jF Fgi2DxpfVuhfjTE+PavS70ox8IK7wJNuCQI5F0uS6GmtTxbl+RtbueBGUPL0rc7Ap0RWyJ92qP9WS 2+oT+oIZrlztAQ==; Received: from [185.228.228.230] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1pRHXr-0004hf-Ne; Sun, 12 Feb 2023 13:57:52 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN> To: Maxim Cournoyer <maxim.cournoyer@HIDDEN> Subject: Re: bug#61255: [PATCH 0/5] Add support for the RPM format to "guix pack" References: <20230203161926.26886-1-maxim.cournoyer@HIDDEN> <20230203221409.15886-2-maxim.cournoyer@HIDDEN> Date: Sun, 12 Feb 2023 19:57:48 +0100 In-Reply-To: <20230203221409.15886-2-maxim.cournoyer@HIDDEN> (Maxim Cournoyer's message of "Fri, 3 Feb 2023 17:14:04 -0500") Message-ID: <877cwmk8yb.fsf_-_@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61255 Cc: Josselin Poiret <dev@HIDDEN>, Christopher Baines <mail@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, 61255 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Maxim Cournoyer <maxim.cournoyer@HIDDEN> skribis: > Rationale: the upcoming rpm-archive builder will also use it. > > * guix/scripts/pack.scm: > (keyword-ref): New top-level procedure, extracted from... > (debian-archive): ... here. Adjust usages accordingly. Commit aeded14b8342c1e72afd014a1bc121770f8c3a1c added #:extra-options, which is why we need =E2=80=98keyword-ref=E2=80=99 now. I=E2=80=99m thinking a different option would be to use #:allow-other-keys = in all the image build procedures. That way the deb and rpm build procedures would get their extra arguments, which would be automatically bound without requiring manual =E2=80=98keyword-ref=E2=80=99 calls. Sounds= a bit nicer maybe? If we skip to the current approach, we should consider using =E2=80=98let-keywords=E2=80=99 from (ice-9 optargs) instead of adding =E2= =80=98keyword-ref=E2=80=99. Anyway, not a blocker IMO, but something to keep in mind. Ludo=E2=80=99.
guix-patches@HIDDEN
:bug#61255
; Package guix-patches
.
Full text available.Received: (at 61255) by debbugs.gnu.org; 12 Feb 2023 18:52:29 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sun Feb 12 13:52:29 2023 Received: from localhost ([127.0.0.1]:46730 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pRHSe-00058Z-Ho for submit <at> debbugs.gnu.org; Sun, 12 Feb 2023 13:52:29 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60494) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1pRHSc-00058M-4o for 61255 <at> debbugs.gnu.org; Sun, 12 Feb 2023 13:52:27 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1pRHSW-0006mX-4q; Sun, 12 Feb 2023 13:52:20 -0500 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=1nYMqBzwmPx+RiYiMrmzMXfcbtvDPZMEWI/5EKHeWGM=; b=R2/O9E+GIO+KIi5OuKn4 uo3Paon+CF94DJyOz8wPLznb9HbIrL5AuxpbT47DVMj1AUVt1dAIqsKhWuHw00G6IjlvAoals31li h9djNld/080HA4a8ui+d4EA0hbdL4MNQYoD2NereyUXeNzprHaPl7TygWIPmlQOFgDmedbeyQTWFB rsPw1ptJYQMd3ZhzqHbXSv4GHYkgaGk6TAemX6AJ88mu5ZKJQ6hxswhfbvlyNQvTohQ/FBktvEmLN YV8lcEQfHEnhn3AWWWSjYiWPLWpgZ+QoC8ylXdf+UNBA1MpgIuma9HQ8K2+Lb6d/pBYj5GwJhIyIj APumo/y1gYnpGQ==; Received: from [185.228.228.230] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1pRHSS-00018U-Dy; Sun, 12 Feb 2023 13:52:19 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN> To: Maxim Cournoyer <maxim.cournoyer@HIDDEN> Subject: Re: bug#61255: [PATCH 0/5] Add support for the RPM format to "guix pack" References: <20230203221409.15886-2-maxim.cournoyer@HIDDEN> <20230203221409.15886-6-maxim.cournoyer@HIDDEN> Date: Sun, 12 Feb 2023 19:52:08 +0100 In-Reply-To: <20230203221409.15886-6-maxim.cournoyer@HIDDEN> (Maxim Cournoyer's message of "Fri, 3 Feb 2023 17:14:08 -0500") Message-ID: <87edquk97r.fsf_-_@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61255 Cc: Josselin Poiret <dev@HIDDEN>, Christopher Baines <mail@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, 61255 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Hey! Maxim Cournoyer <maxim.cournoyer@HIDDEN> skribis: > * guix/rpm.scm: New file. > * guix/scripts/pack.scm (rpm-archive): New procedure. > (%formats): Register it. > (show-formats): Add it. > (guix-pack): Register supported extra-options for the rpm format. > * tests/pack.scm (rpm-for-tests): New variable. > ("rpm archive can be installed/uninstalled"): New test. > * tests/rpm.scm: New test. > * doc/guix.texi (Invoking guix pack): Document it. (=E2=80=98Makefile.am=E2=80=99 changes are missing here.) Woow, there=E2=80=99s a lot of fun stuff in here! :-) Nice work! Perhaps we=E2=80=99ll soon see Guix-generated RPMs for, say, Jami? :-) Overall it looks great to me. Perhaps you should submit an =E2=80=98etc/news.scm=E2=80=99 entry here so t= hat translators can work on it before it=E2=80=99s eventually pushed (I think t= hat=E2=80=99s the workflow Julien proposed). Some comments follow: > +@cindex Debian, build a .deb package with guix pack @file{.deb} and @command{guix pack} > +The RPM format supports relocatable packages via the @option{--prefix} > +option of the @command{rpm} command, which can be handy to install an > +RPM package to a specific prefix, making installing multiple > +Guix-produced RPM packages side by side possible. > + > +@example > +guix pack -f rpm -R -C xz -S /usr/bin/hello=3Dbin/hello hello > +sudo rpm --install --prefix=3D/opt /gnu/store/...-hello.rpm > +@end example Perhaps use two different @example boxes to distinguish between the Guix machine that produces the RPM, and the RPM-based system that installs it? > +@quotation Note > +Similarly to Debian packages, two RPM packages with conflicting files > +cannot be installed simultaneously. Contrary to Debian packages, RPM > +supports relocatable packages, so file conflicts can be avoided by > +installing the RPM packages under different installation prefixes, as > +shown in the above example. So for relocatable packages, one really needs =E2=80=98guix pack -R=E2=80= =99 IIUC. Interesting. > +;;; Commentary: > +;;; > +;;; This module provides the building blocks required to construct RPM > +;;; archives. It is intended to be importable on the build side, so sho= uldn't > +;;; depend on (guix diagnostics) or other host-side-only modules. > + > +(define-module (guix rpm) The commentary should be followed by =E2=80=9CCode:=E2=80=9D and it should = come after the =E2=80=98define-module=E2=80=99 form. That way, (ice-9 documentation) = can find it. > +(define (make-header-index+data entries) > + "Return the index and data sections as u8 number lists, via multiple v= alues. > +An index is composed of four u32 (16 bytes total) quantities, in order: = tag, > +type, offset and count." > + (match (fold (match-lambda* > + ((entry (offset . (index . data))) > + (let* ((tag (header-entry-tag entry)) > + (tag-number (rpm-tag-number tag)) > + (tag-type (rpm-tag-type tag)) > + (count (header-entry-count entry)) > + (data* (header-entry->data entry)) > + (alignment (entry-type->alignement tag-type)) > + (aligned-offset (next-aligned-offset offset ali= gnment)) > + (padding (make-list (- aligned-offset offset) 0= ))) > + (cons (+ aligned-offset (length data*)) > + (cons (append index > + (u32-number->u8-list tag-number) > + (u32-number->u8-list tag-type) > + (u32-number->u8-list aligned-off= set) > + (u32-number->u8-list count)) > + (append data padding data*)))))) I think it would be possible (throughout the code) to avoid building lists of bytes and instead directly produce bytevectors or, better, produce procedures that write bytes directly to an output port (with macros along the lines of =E2=80=98define-operation=E2=80=99 in (guix store= ) or =E2=80=98define-pack=E2=80=99 in (guix cpio)). I don=E2=80=99t think it should be a blocker though, it=E2=80=99s okay to k= eep it this way. > +(define (files->md5-checksums files) > + "Return the MD5 checksums (formatted as hexadecimal strings) for FILES= ." Does it have to be MD5? If RPM supports SHA1 or SHA2*, it would be best to pick one of these; MD5 is okay to detect unintended modifications, but it=E2=80=99s useless if we care about malicious tampering. > + (define name (or (and=3D> single-entry manifest-entry-name) > + (manifest->friendly-name manifest))) > + > + (define version (or (and=3D> single-entry manifest-entry-ver= sion) > + "0.0.0")) > + > + (define lead (generate-lead (string-append name "-" version) > + #:target (or #$target %host-type= ))) > + > + (define payload-digest (bytevector->hex-string > + (file-sha256 #$payload))) Nitpick: the convention usually followed is to write the value, when it=E2=80=99s long enough as is the case here, on the next line, as in: (define something value-thats-a-little-bit-long) > + (unless store (test-skip 1)) > + (test-assertm "rpm archive can be installed/uninstalled" store Really cool to have a full-blown test like this. > +(define-module (test-rpm) > + #:use-module (guix rpm) That too! Thanks, Ludo=E2=80=99.
guix-patches@HIDDEN
:bug#61255
; Package guix-patches
.
Full text available.Received: (at 61255) by debbugs.gnu.org; 12 Feb 2023 18:20:28 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sun Feb 12 13:20:28 2023 Received: from localhost ([127.0.0.1]:46701 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pRGxg-000432-9m for submit <at> debbugs.gnu.org; Sun, 12 Feb 2023 13:20:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56768) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1pRGxe-00042l-Oj for 61255 <at> debbugs.gnu.org; Sun, 12 Feb 2023 13:20:27 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1pRGxZ-0000cf-6Y; Sun, 12 Feb 2023 13:20:21 -0500 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=ljCGl3N9NJrFEZq7vBcZmwmXp2p9klCNLEWA3qTeQ4M=; b=Q9jYtPtqsxE+qumg9rRB vztAPNJ2qQI21CSE+rKNE6/qOGwmyYNs1cChQCqNFUIKqOyKKQ2ObP83VXg9aGCuOTVGrycZ1zs2Y EFu664br/hAE3gamtUJJxdO51k+7zVfZp2C06WVWEuXpcz9y+tebJqIDOzukSud3pTaJzK9gKcFce KU1X/ocu+5rW/jWkLZ4FuzIsIoebSfwf1yHNPWgmqTlhaWetE7Xe0by+Z7MzihvTpIYMNAKD0UiEj FOCUJt1osrZY+C/FBwDkAVCbSCsSXHdLcKJGt1OdbG996ybuI2Q7CgMl6VCJVq2e/4k5U5IFnmWQ+ 9MGXgAS5OUtJSw==; Received: from [185.228.228.230] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1pRGxM-0000Fn-EK; Sun, 12 Feb 2023 13:20:20 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN> To: Maxim Cournoyer <maxim.cournoyer@HIDDEN> Subject: Re: bug#61255: [PATCH 0/5] Add support for the RPM format to "guix pack" References: <20230203221409.15886-2-maxim.cournoyer@HIDDEN> <20230203221409.15886-5-maxim.cournoyer@HIDDEN> Date: Sun, 12 Feb 2023 19:20:04 +0100 In-Reply-To: <20230203221409.15886-5-maxim.cournoyer@HIDDEN> (Maxim Cournoyer's message of "Fri, 3 Feb 2023 17:14:07 -0500") Message-ID: <87357alp9n.fsf_-_@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61255 Cc: 61255 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Hi, Maxim Cournoyer <maxim.cournoyer@HIDDEN> skribis: > * tests/pack.scm: Fix indentation. [...] > (check (gexp->derivation > - "check-tarball" > - (with-imported-modules '((guix build utils)) [...] > + "check-tarball" > + (with-imported-modules '((guix build utils)) I=E2=80=99m not convinced by the indentation rule for =E2=80=98gexp->deriva= tion=E2=80=99 added in 82daab42811a2e3c7684ebdf12af75ff0fa67b99: there=E2=80=99s no reason to t= reat =E2=80=98gexp->derivation=E2=80=99 differently from other procedures. What about removing that rule from =E2=80=98.dir-locals.el=E2=80=99 and kee= ping =E2=80=98tests/pack.scm=E2=80=99 unchanged? (Also not sure about the =E2=80=98computed-file=E2=80=99 rule. For all the= se things, we=E2=80=99ll want to keep Emacs and (guix read-print) in sync, too.) Thanks, Ludo=E2=80=99.
guix-patches@HIDDEN
:bug#61255
; Package guix-patches
.
Full text available.Received: (at 61255) by debbugs.gnu.org; 12 Feb 2023 18:15:26 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sun Feb 12 13:15:26 2023 Received: from localhost ([127.0.0.1]:46693 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pRGso-0003tA-62 for submit <at> debbugs.gnu.org; Sun, 12 Feb 2023 13:15:26 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38516) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1pRGsl-0003sy-LU for 61255 <at> debbugs.gnu.org; Sun, 12 Feb 2023 13:15:23 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1pRGsf-0007ov-2m; Sun, 12 Feb 2023 13:15:17 -0500 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=NKwefQoBDYfW9pfNfOdkyuJk7FFV5bGLaCzHo+IT0xE=; b=G+xjyp4zHEMqekHBpTfu MjRxPm5eT6GfVy8U1BJU2uxvBWMG+/HRngD77ULyZ3vXmKZAxUMA3pnlEM4cuUbgL4hlaxg2oOK2A ILdWur+fEQTT3yZ4RLNuCiZEybe49PKnDnUrhbKvcpr9kv0HLP1lvOG5VwjajmOobI47jQfhdgAwa NL1TlzE36c8QZy+aP46PZmqYbCmU57P9pkDn/BUWbBgMcMZEDESwTJF0bFZE3ioGJnQFVjFM1luz1 jlaHOMcWIrrYNXcVtoZVmYQH1P0/4A1/XllRnZwzWK5leG/0LC7mDdy0hERurlGyOHZSKXYnqv1Xu nnccVphpOWsXUQ==; Received: from [185.228.228.230] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1pRGsW-00087U-5Y; Sun, 12 Feb 2023 13:15:16 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN> To: Maxim Cournoyer <maxim.cournoyer@HIDDEN> Subject: Re: bug#61255: [PATCH 0/5] Add support for the RPM format to "guix pack" References: <20230203221409.15886-2-maxim.cournoyer@HIDDEN> <20230203221409.15886-3-maxim.cournoyer@HIDDEN> <877cwyw7yc.fsf@HIDDEN> <87h6w2p02y.fsf@HIDDEN> Date: Sun, 12 Feb 2023 19:14:57 +0100 In-Reply-To: <87h6w2p02y.fsf@HIDDEN> (Maxim Cournoyer's message of "Fri, 03 Feb 2023 22:43:17 -0500") Message-ID: <87a61ilpi6.fsf_-_@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61255 Cc: Josselin Poiret <dev@HIDDEN>, Christopher Baines <mail@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, 61255 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Hi Maxim, Maxim Cournoyer <maxim.cournoyer@HIDDEN> skribis: > Ludovic Court=C3=A8s <ludo@HIDDEN> writes: > >> Hello! >> >> Maxim Cournoyer <maxim.cournoyer@HIDDEN> skribis: >> >>> * guix/gexp.scm (computed-file): Set the default value of the #:guile a= rgument >>> to that of the %guile-for-build parameter. >> >> [...] >> >>> (define* (computed-file name gexp >>> - #:key guile (local-build? #t) (options '())) >>> + #:key (guile (%guile-for-build)) >>> + (local-build? #t) (options '())) >> >> I think that would lead =E2=80=98computed-file=E2=80=99 to pick (%guile-= for-build) at >> the wrong time (time of call instead of time of lowering). >> >> Commit ab25eb7caaf5571cc9f8d6397a1eae127d7e29d1 made it #f such that >> =E2=80=98gexp->derivation=E2=80=99 gets to resolve it at the =E2=80=9Cri= ght=E2=80=9D time. > > I see! I think you are right. Would making the change in the > associated gexp compiler do the right thing? Currently it ignores the > %guile-for-build fluid as set in the tests/pack.scm test suite for > example. Something like this: I don=E2=80=99t fully understand the context. My preference would go to do= ing like the =E2=80=98computed-file=E2=80=99 tests in =E2=80=98tests/gexp.scm= =E2=80=99, where we explicitly pass #:guile %bootstrap-guile. That said, it seems like patch #5 in this series doesn=E2=80=99t actually u= se =E2=80=98computed-file=E2=80=99 in =E2=80=98tests/pack.scm=E2=80=99, does i= t? Thanks, Ludo=E2=80=99, slowly catching up post-FOSDEM!
guix-patches@HIDDEN
:bug#61255
; Package guix-patches
.
Full text available.Received: (at 61255) by debbugs.gnu.org; 4 Feb 2023 03:43:27 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 03 22:43:27 2023 Received: from localhost ([127.0.0.1]:40323 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pO9SY-0007QP-SS for submit <at> debbugs.gnu.org; Fri, 03 Feb 2023 22:43:27 -0500 Received: from mail-qt1-f178.google.com ([209.85.160.178]:42536) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <maxim.cournoyer@HIDDEN>) id 1pO9SW-0007Q9-Ox for 61255 <at> debbugs.gnu.org; Fri, 03 Feb 2023 22:43:25 -0500 Received: by mail-qt1-f178.google.com with SMTP id m26so7735454qtp.9 for <61255 <at> debbugs.gnu.org>; Fri, 03 Feb 2023 19:43:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=BHCyCWfUmfdn7IC3edUqalP/xvHdztp2j5g7imMtZNg=; b=RTdrAeyFGm+u4QbMg3dnvbJ0c+F0L0gg+mQ1yHQXSGeIac//2A082pH2E/DioJDAv6 juopy7n2+1hcDfD4wjvynMVyG7wEsRyMBP4xm7W7+mW9uqC9Ems+aDOGojcxhEjAbRHj anQNXnGaIldfx5914lXFruPMY2oxath3i02CGzHWf9+zgAYn/wTYAPtUQwbcuEFG4bwB 6301/KM8E+V6YAYmhDw1O8u0C/4T/P77OALGva1EUlqFcEg/GHTGO+TOFofT3MSQDnFA zVrA7MhHxMKrLwoDoPK/tSwdO85522yzhCj/b1svg5JxKIvJpsUkgQafBIsoKS3TUvLd b09w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=BHCyCWfUmfdn7IC3edUqalP/xvHdztp2j5g7imMtZNg=; b=O2antWLeZ1i/oI4ikkfkOUrnofiKPtGkK0eqRsdrOnSimHezGX7rU3nAlh+c3nXYjG OKL00tDBPOzcLLvSaq9blv9zNY3RQPkbPaTkaaSwakTojSLai7+Eewzrv7JHzkoj+xID 1Kh15tH6iOOIEoPI6UbEYT/JudKVWsrn6Q7iatFouiwegzsOJrTcTh+buB0wW9Ts4MSM xcj3ToXIf8MzNgmtsBt67PnVREAvmCwtCZIlg8zZjhqJ9+ZM64j67djCZ12HLeGivfQn 0NlQ/iCiJDw6456GOK+KAjxYjc6GecUteiAVYkVPWwuVUW7lamjCnE/gvCsYwzMq/ReC ZL0A== X-Gm-Message-State: AO0yUKX4RXDIduhUky/m3wH3ng8kUnoWlnPikTjtkWFmRBRrZfWNb87f w/ByUauDnfXW+VZEYrk5Icg= X-Google-Smtp-Source: AK7set+k2NPVoaZP2/j2vgef+vCshsw7IcSNcRVkIWWaQF12lmWHHRlkwwrXZUhJwR0zuZaPVEq6dw== X-Received: by 2002:ac8:7d03:0:b0:3b8:2a6c:d1e4 with SMTP id g3-20020ac87d03000000b003b82a6cd1e4mr23067145qtb.23.1675482199283; Fri, 03 Feb 2023 19:43:19 -0800 (PST) Received: from hurd (dsl-10-136-177.b2b2c.ca. [72.10.136.177]) by smtp.gmail.com with ESMTPSA id c1-20020a05620a268100b007203bbbbb31sm3237383qkp.47.2023.02.03.19.43.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Feb 2023 19:43:18 -0800 (PST) From: Maxim Cournoyer <maxim.cournoyer@HIDDEN> To: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN> Subject: Re: [PATCH 2/5] gexp: computed-file: Honor %guile-for-build. References: <20230203221409.15886-2-maxim.cournoyer@HIDDEN> <20230203221409.15886-3-maxim.cournoyer@HIDDEN> <877cwyw7yc.fsf@HIDDEN> Date: Fri, 03 Feb 2023 22:43:17 -0500 In-Reply-To: <877cwyw7yc.fsf@HIDDEN> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Sat, 04 Feb 2023 02:11:23 +0100") Message-ID: <87h6w2p02y.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61255 Cc: Josselin Poiret <dev@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Christopher Baines <mail@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, 61255 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Hi Luvodic, Ludovic Court=C3=A8s <ludo@HIDDEN> writes: > Hello! > > Maxim Cournoyer <maxim.cournoyer@HIDDEN> skribis: > >> * guix/gexp.scm (computed-file): Set the default value of the #:guile ar= gument >> to that of the %guile-for-build parameter. > > [...] > >> (define* (computed-file name gexp >> - #:key guile (local-build? #t) (options '())) >> + #:key (guile (%guile-for-build)) >> + (local-build? #t) (options '())) > > I think that would lead =E2=80=98computed-file=E2=80=99 to pick (%guile-f= or-build) at > the wrong time (time of call instead of time of lowering). > > Commit ab25eb7caaf5571cc9f8d6397a1eae127d7e29d1 made it #f such that > =E2=80=98gexp->derivation=E2=80=99 gets to resolve it at the =E2=80=9Crig= ht=E2=80=9D time. I see! I think you are right. Would making the change in the associated gexp compiler do the right thing? Currently it ignores the %guile-for-build fluid as set in the tests/pack.scm test suite for example. Something like this: --8<---------------cut here---------------start------------->8--- modified guix/gexp.scm @@ -584,7 +584,7 @@ (define-record-type <computed-file> (options computed-file-options)) ;list of arguments =20 (define* (computed-file name gexp - #:key (guile (%guile-for-build)) + #:key guile (local-build? #t) (options '())) "Return an object representing the store item NAME, a file or directory computed by GEXP. When LOCAL-BUILD? is #t (the default), it ensures the @@ -601,7 +601,8 @@ (define-gexp-compiler (computed-file-compiler (file <co= mputed-file>) ;; gexp. (match file (($ <computed-file> name gexp guile options) - (mlet %store-monad ((guile (lower-object (or guile (default-guile)) + (mlet %store-monad ((guile (lower-object (or guile (%guile-for-build) + (default-guile)) system #:target #f))) (apply gexp->derivation name gexp #:guile-for-build guile #:system system #:target target options))))) --8<---------------cut here---------------end--------------->8--- I've verified that 'make check TESTS=3Dtests/pack.scm' is still happy (without such patch, with patch 3/5 applied, the "self-contained-tarball" would try to build a non-bootstrap guile and timeout (on my old machine). Thanks and enjoy FOSDEM! --=20 Maxim
guix-patches@HIDDEN
:bug#61255
; Package guix-patches
.
Full text available.Received: (at 61255) by debbugs.gnu.org; 4 Feb 2023 01:11:43 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 03 20:11:43 2023 Received: from localhost ([127.0.0.1]:40236 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pO75i-0003Vj-VM for submit <at> debbugs.gnu.org; Fri, 03 Feb 2023 20:11:43 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34958) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <ludo@HIDDEN>) id 1pO75c-0003VQ-Sj for 61255 <at> debbugs.gnu.org; Fri, 03 Feb 2023 20:11:40 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1pO75W-00059e-4q; Fri, 03 Feb 2023 20:11:30 -0500 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=ehlRDDXFwj8neZEgnGM1Z7MsnnFXss853SeWbOE2UpM=; b=sCG25QbxZlE0Z/yYaIFj w+/uPP3p6rUw8odq5IHOD6PmTOXCybT+vvq6K8R4YxBWqO/6/Bk0o5A0TX6dZIcb6zen85kgx8B6X edhllHckCSOd1IvY7PUdTDe2i/wc09iX65yhgIdafKZjIgodQmdHDWacNet6cfQg65hQb7NWadutL M4js0G1DX4vWBOcWDA2N9q8Xk3tt00qgcfQNcE1BI9FUk5u649jEMOxira71qFC7KhrTJLr87CaY8 vCNzjtcnJIXPAGfJKKKUUpyMY8LDZU+Hb8x+ui5AZ4J6XY7Y3Ctn4HW+90uvUnXG+5KJIx4w4ZnL/ 7cbn0BQ4KdiGEw==; Received: from dd458ef22.static.telenet.be ([212.88.239.34] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <ludo@HIDDEN>) id 1pO75V-000648-Bv; Fri, 03 Feb 2023 20:11:29 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN> To: Maxim Cournoyer <maxim.cournoyer@HIDDEN> Subject: Re: [PATCH 2/5] gexp: computed-file: Honor %guile-for-build. References: <20230203221409.15886-2-maxim.cournoyer@HIDDEN> <20230203221409.15886-3-maxim.cournoyer@HIDDEN> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Sextidi 16 =?utf-8?Q?Pluvi=C3=B4se?= an 231 de la =?utf-8?Q?R=C3=A9volution=2C?= jour du Buis X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sat, 04 Feb 2023 02:11:23 +0100 In-Reply-To: <20230203221409.15886-3-maxim.cournoyer@HIDDEN> (Maxim Cournoyer's message of "Fri, 3 Feb 2023 17:14:05 -0500") Message-ID: <877cwyw7yc.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61255 Cc: Josselin Poiret <dev@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Christopher Baines <mail@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, 61255 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -3.3 (---) Hello! Maxim Cournoyer <maxim.cournoyer@HIDDEN> skribis: > * guix/gexp.scm (computed-file): Set the default value of the #:guile arg= ument > to that of the %guile-for-build parameter. [...] > (define* (computed-file name gexp > - #:key guile (local-build? #t) (options '())) > + #:key (guile (%guile-for-build)) > + (local-build? #t) (options '())) I think that would lead =E2=80=98computed-file=E2=80=99 to pick (%guile-for= -build) at the wrong time (time of call instead of time of lowering). Commit ab25eb7caaf5571cc9f8d6397a1eae127d7e29d1 made it #f such that =E2=80=98gexp->derivation=E2=80=99 gets to resolve it at the =E2=80=9Cright= =E2=80=9D time. Does that make sense? But perhaps this approach isn=E2=80=99t suitable in = the use case you=E2=80=99re looking at? HTH, Ludo=E2=80=99.
guix-patches@HIDDEN
:bug#61255
; Package guix-patches
.
Full text available.Received: (at 61255) by debbugs.gnu.org; 3 Feb 2023 22:15:02 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 03 17:15:01 2023 Received: from localhost ([127.0.0.1]:40094 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pO4Kh-00056x-F5 for submit <at> debbugs.gnu.org; Fri, 03 Feb 2023 17:15:01 -0500 Received: from mail-qv1-f49.google.com ([209.85.219.49]:46675) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <maxim.cournoyer@HIDDEN>) id 1pO4Kc-00056J-RU for 61255 <at> debbugs.gnu.org; Fri, 03 Feb 2023 17:14:57 -0500 Received: by mail-qv1-f49.google.com with SMTP id e19so3716007qvw.13 for <61255 <at> debbugs.gnu.org>; Fri, 03 Feb 2023 14:14:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8zqdjHfHNHOB2eLp0fed9uE8pvf8LEKwY5JIoRlt8cc=; b=iS6G9ik4gLetKFG7HMvld6Dk1zY3134F2a3QLG8iPIzwUX/Vqoy5e86bCtJYAh3FYG UHnPcp8N0511zBuODHpq2h/fFn4LiTQlQKucGLNXRQEUOTs77namfPEZ2kJhhQPcxvJd hIvi0/7dbxDtCRJiEgVndreKsn2neNc4FKPOMPk+AR6NWu5Ut/9XbBRyXQ/3TS86/6HT EggorFYQiHLsA2GyuBSGFoDDdU8h8F/g/7WFIfqO7rfHeotHVhIdKDD4tG5J7rUEPk+p LT8HnQlZ/I6uWZwi+lwazblPiKz3bkv/ONUQdHh+oeakcI0dell9gkbMPiIWdOhUAQX5 FG9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8zqdjHfHNHOB2eLp0fed9uE8pvf8LEKwY5JIoRlt8cc=; b=U43AHUovtSdAq2/Q2Us5eMQnO0rIvkBWpe4diD1HrFFHKrT1+xyoBGTjIX7zgfglTj ksuL72/GPbFmcyvGQqTGKRVXn3xG+e1mecElpTEVRSgNELLVqhi/avsrk4vsMNEko1R1 8L62REDFcbf67QsKYfKuwDQSiFgO6MiclSneWGPtudYzwur5EwZOJIvacqkDfBiYa+en a+Cr6gsuor3UvKmfq78fh8pbNd+1UlWjWQ+4aCbRaCKtok1t+aYaXHoX4hi59R5QnyCc 8T1GCmAkaf3WLXDjuS2ThS4W8NeOQRaPyKyXPHiFtwlOom38u9TEKrVpTwPI2yVQXeuO 9YNA== X-Gm-Message-State: AO0yUKU5sfvsVpGamaOFIgnDgTtR2LHPjq6kRDzVDPXEDxTzWznSRAR7 gUkJIl/qR8lfe7TE6IGw+gYAD4BSRt0= X-Google-Smtp-Source: AK7set+4Lz5PFOyrE5qPqS9Gbo0goOdGoqXNWVTBPxTOOE0VsUw4Gpy80qFxjUh5kkirDgGdKvWb5Q== X-Received: by 2002:a05:6214:1fc9:b0:535:664b:772b with SMTP id jh9-20020a0562141fc900b00535664b772bmr16154818qvb.6.1675462488317; Fri, 03 Feb 2023 14:14:48 -0800 (PST) Received: from localhost.localdomain (dsl-10-136-177.b2b2c.ca. [72.10.136.177]) by smtp.gmail.com with ESMTPSA id bp41-20020a05620a45a900b00725d8d6983asm1430594qkb.61.2023.02.03.14.14.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Feb 2023 14:14:47 -0800 (PST) From: Maxim Cournoyer <maxim.cournoyer@HIDDEN> To: 61255 <at> debbugs.gnu.org Subject: [PATCH 5/5] pack: Add RPM format. Date: Fri, 3 Feb 2023 17:14:08 -0500 Message-Id: <20230203221409.15886-6-maxim.cournoyer@HIDDEN> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230203221409.15886-2-maxim.cournoyer@HIDDEN> References: <20230203221409.15886-2-maxim.cournoyer@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61255 Cc: Josselin Poiret <dev@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Maxim Cournoyer <maxim.cournoyer@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>, Christopher Baines <mail@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * guix/rpm.scm: New file. * guix/scripts/pack.scm (rpm-archive): New procedure. (%formats): Register it. (show-formats): Add it. (guix-pack): Register supported extra-options for the rpm format. * tests/pack.scm (rpm-for-tests): New variable. ("rpm archive can be installed/uninstalled"): New test. * tests/rpm.scm: New test. * doc/guix.texi (Invoking guix pack): Document it. --- Makefile.am | 2 + doc/guix.texi | 45 ++- guix/rpm.scm | 621 ++++++++++++++++++++++++++++++++++++++++++ guix/scripts/pack.scm | 227 ++++++++++++++- tests/pack.scm | 57 +++- tests/rpm.scm | 86 ++++++ 6 files changed, 1025 insertions(+), 13 deletions(-) create mode 100644 guix/rpm.scm create mode 100644 tests/rpm.scm diff --git a/Makefile.am b/Makefile.am index a4b6f03b3a..ac4485dd30 100644 --- a/Makefile.am +++ b/Makefile.am @@ -111,6 +111,7 @@ MODULES = \ guix/derivations.scm \ guix/grafts.scm \ guix/repl.scm \ + guix/rpm.scm \ guix/transformations.scm \ guix/inferior.scm \ guix/describe.scm \ @@ -533,6 +534,7 @@ SCM_TESTS = \ tests/pypi.scm \ tests/read-print.scm \ tests/records.scm \ + tests/rpm.scm \ tests/scripts.scm \ tests/search-paths.scm \ tests/services.scm \ diff --git a/doc/guix.texi b/doc/guix.texi index d69be8586e..3584274848 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -6894,6 +6894,7 @@ such file or directory'' message. @end quotation @item deb +@cindex Debian, build a .deb package with guix pack This produces a Debian archive (a package with the @samp{.deb} file extension) containing all the specified binaries and symbolic links, that can be installed on top of any dpkg-based GNU(/Linux) distribution. @@ -6910,7 +6911,8 @@ guix pack -f deb -C xz -S /usr/bin/hello=bin/hello hello Because archives produced with @command{guix pack} contain a collection of store items and because each @command{dpkg} package must not have conflicting files, in practice that means you likely won't be able to -install more than one such archive on a given system. +install more than one such archive on a given system. You can +nonetheless pack as many Guix packages as you want in one such archive. @end quotation @quotation Warning @@ -6921,6 +6923,47 @@ shared by other software, such as a Guix installation or other, non-deb packs. @end quotation +@item rpm +@cindex RPM, build an RPM archive with guix pack +This produces an RPM archive (a package with the @samp{.rpm} file +extension) containing all the specified binaries and symbolic links, +that can be installed on top of any RPM-based GNU/Linux distribution. +The RPM format embeds checksums for every file it contains, which the +@command{rpm} command uses to validate the integrity of the archive. + +Advanced RPM-related options are revealed via the +@option{--help-rpm-format} option. These options allow embedding +maintainer scripts that can run before or after the installation of the +RPM archive, for example. + +The RPM format supports relocatable packages via the @option{--prefix} +option of the @command{rpm} command, which can be handy to install an +RPM package to a specific prefix, making installing multiple +Guix-produced RPM packages side by side possible. + +@example +guix pack -f rpm -R -C xz -S /usr/bin/hello=bin/hello hello +sudo rpm --install --prefix=/opt /gnu/store/...-hello.rpm +@end example + +@quotation Note +Similarly to Debian packages, two RPM packages with conflicting files +cannot be installed simultaneously. Contrary to Debian packages, RPM +supports relocatable packages, so file conflicts can be avoided by +installing the RPM packages under different installation prefixes, as +shown in the above example. +@end quotation + +@quotation Warning +@command{rpm} assumes ownership of any files contained in the pack, +which means it will remove @file{/gnu/store} upon uninstalling a +Guix-generated RPM package, unless the RPM package was installed with +the @option{--prefix} option of the @command{rpm} command. It is unwise +to install Guix-produced @samp{.rpm} packages on a system where +@file{/gnu/store} is shared by other software, such as a Guix +installation or other, non-rpm packs. +@end quotation + @end table @cindex relocatable binaries diff --git a/guix/rpm.scm b/guix/rpm.scm new file mode 100644 index 0000000000..d11ac7d72a --- /dev/null +++ b/guix/rpm.scm @@ -0,0 +1,621 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2023 Maxim Cournoyer <maxim.cournoyer@HIDDEN> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +;;; Commentary: +;;; +;;; This module provides the building blocks required to construct RPM +;;; archives. It is intended to be importable on the build side, so shouldn't +;;; depend on (guix diagnostics) or other host-side-only modules. + +(define-module (guix rpm) + #:autoload (gcrypt hash) (hash-algorithm file-hash md5) + #:use-module (guix build utils) + #:use-module (ice-9 format) + #:use-module (ice-9 match) + #:use-module (ice-9 textual-ports) + #:use-module (rnrs bytevectors) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-9) + #:use-module (srfi srfi-26) + #:use-module (srfi srfi-71) + #:use-module (srfi srfi-171) + #:export (generate-lead + generate-signature + generate-header + assemble-rpm-metadata + + ;; XXX: These are internals, but the inline disabling trick + ;; doesn't work on them. + make-header-entry + header-entry? + header-entry-tag + header-entry-count + header-entry-value + + bytevector->hex-string + + fhs-directory?)) + +(define (gnu-system-triplet->machine-type triplet) + "Return the machine component of TRIPLET, a GNU system triplet." + (first (string-split triplet #\-))) + +(define (gnu-machine-type->rpm-arch type) + "Return the canonical RPM architecture string, given machine TYPE." + (match type + ("arm" "armv7hl") + ("powerpc" "ppc") + ("powerpc64le" "ppc64le") + (machine machine))) ;unchanged + +(define (gnu-machine-type->rpm-number type) + "Translate machine TYPE to its corresponding RPM integer value." + ;; Refer to the rpmrc.in file in the RPM source for the complete + ;; translation tables. + (match type + ((or "i486" "i586" "i686" "x86_64") 1) + ((? (cut string-prefix? "powerpc" <>)) 5) + ("mips64el" 11) + ((? (cut string-prefix? "arm" <>)) 12) + ("aarch64" 19) + ((? (cut string-prefix? "riscv" <>)) 22) + (_ (error "no RPM number known for machine type" type)))) + +(define (u16-number->u8-list number) + "Return a list of byte values made of NUMBER, a 16 bit unsigned integer." + (let ((bv (uint-list->bytevector (list number) (endianness big) 2))) + (bytevector->u8-list bv))) + +(define (u32-number->u8-list number) + "Return a list of byte values made of NUMBER, a 32 bit unsigned integer." + (let ((bv (uint-list->bytevector (list number) (endianness big) 4))) + (bytevector->u8-list bv))) + +(define (s32-number->u8-list number) + "Return a list of byte values made of NUMBER, a 32 bit signed integer." + (let ((bv (sint-list->bytevector (list number) (endianness big) 4))) + (bytevector->u8-list bv))) + +(define (u8-list->u32-number lst) + "Return the 32 bit unsigned integer corresponding to the 4 bytes in LST." + (bytevector-u32-ref (u8-list->bytevector lst) 0 (endianness big))) + + +;;; +;;; Lead section. +;;; + +;; Refer to the docs/manual/format.md file of the RPM source for the details +;; regarding the binary format of an RPM archive. +(define* (generate-lead name-version #:key (target %host-type)) + "Generate a RPM lead u8-list that uses NAME-VERSION, the name and version +string of the package, and TARGET, a GNU triplet used to derive the target +machine type." + (define machine-type (gnu-system-triplet->machine-type target)) + (define magic (list #xed #xab #xee #xdb)) + (define file-format-version (list 3 0)) ;3.0 + (define type (list 0 0)) ;0 for binary packages + (define arch-number (u16-number->u8-list + (gnu-machine-type->rpm-number machine-type))) + ;; The 66 bytes from 10 to 75 are for the name-version-release string. + (define name + (let ((padding-bytes (make-list (- 66 (string-length name-version)) 0))) + (append (bytevector->u8-list (string->utf8 name-version)) + padding-bytes))) + ;; There is no OS number corresponding to GNU/Hurd (GNU), only Linux, per + ;; rpmrc.in. + (define os-number (list 0 1)) + + ;; For RPM format 3.0, the signature type is 5, which means a "Header-style" + ;; signature. + (define signature-type (list 0 5)) + + (define reserved-bytes (make-list 16 0)) + + (append magic file-format-version type arch-number name + os-number signature-type reserved-bytes)) + + +;;; +;;; Header section. +;;; + +(define header-magic (list #x8e #xad #xe8)) +(define header-version (list 1)) +(define header-reserved (make-list 4 0)) ;4 reserved bytes +;;; Every header starts with 8 bytes made by the header magic number, the +;;; header version and 4 reserved bytes. +(define header-intro (append header-magic header-version header-reserved)) + +;;; Header entry data types. +(define NULL 0) +(define CHAR 1) +(define INT8 2) +(define INT16 3) ;2-bytes aligned +(define INT32 4) ;4-bytes aligned +(define INT64 5) ;8-bytes aligned +(define STRING 6) +(define BIN 7) +(define STRING_ARRAY 8) +(define I18NSTRIN_TYPE 9) + +;;; Header entry tags. +(define-record-type <rpm-tag> + (make-rpm-tag number type) + rpm-tag? + (number rpm-tag-number) + (type rpm-tag-type)) + +;;; The following are internal tags used to identify the data sections. +(define RPMTAG_HEADERSIGNATURES (make-rpm-tag 62 BIN)) ;signature header +(define RPMTAG_HEADERIMMUTABLE (make-rpm-tag 63 BIN)) ;main/data header +(define RPMTAG_HEADERI18NTABLE (make-rpm-tag 100 STRING_ARRAY)) + +;;; Subset of RPM tags from include/rpm/rpmtag.h. +(define RPMTAG_NAME (make-rpm-tag 1000 STRING)) +(define RPMTAG_VERSION (make-rpm-tag 1001 STRING)) +(define RPMTAG_RELEASE (make-rpm-tag 1002 STRING)) +(define RPMTAG_SUMMARY (make-rpm-tag 1004 STRING)) +(define RPMTAG_SIZE (make-rpm-tag 1009 INT32)) +(define RPMTAG_LICENSE (make-rpm-tag 1014 STRING)) +(define RPMTAG_OS (make-rpm-tag 1021 STRING)) +(define RPMTAG_ARCH (make-rpm-tag 1022 STRING)) +(define RPMTAG_PREIN (make-rpm-tag 1023 STRING)) +(define RPMTAG_POSTIN (make-rpm-tag 1024 STRING)) +(define RPMTAG_PREUN (make-rpm-tag 1025 STRING)) +(define RPMTAG_POSTUN (make-rpm-tag 1026 STRING)) +(define RPMTAG_FILESIZES (make-rpm-tag 1028 INT32)) +(define RPMTAG_FILEMODES (make-rpm-tag 1030 INT16)) +(define RPMTAG_FILEDIGESTS (make-rpm-tag 1035 STRING_ARRAY)) +(define RPMTAG_FILELINKTOS (make-rpm-tag 1036 STRING_ARRAY)) +(define RPMTAG_FILEUSERNAME (make-rpm-tag 1039 STRING_ARRAY)) +(define RPMTAG_GROUPNAME (make-rpm-tag 1040 STRING_ARRAY)) +(define RPMTAG_PREFIXES (make-rpm-tag 1098 STRING_ARRAY)) +(define RPMTAG_DIRINDEXES (make-rpm-tag 1116 INT32)) +(define RPMTAG_BASENAMES (make-rpm-tag 1117 STRING_ARRAY)) +(define RPMTAG_DIRNAMES (make-rpm-tag 1118 STRING_ARRAY)) +(define RPMTAG_PAYLOADFORMAT (make-rpm-tag 1124 STRING)) +(define RPMTAG_PAYLOADCOMPRESSOR (make-rpm-tag 1125 STRING)) +(define RPMTAG_LONGFILESIZES (make-rpm-tag 5008 INT64)) +(define RPMTAG_LONGSIZE (make-rpm-tag 5009 INT64)) +;;; The algorithm used to compute the digest of each file, e.g. RPM_HASH_MD5. +(define RPMTAG_FILEDIGESTALGO (make-rpm-tag 5011 INT32)) +;;; RPMTAG_ENCODING specifies the encoding used for strings, e.g. "utf-8". +(define RPMTAG_ENCODING (make-rpm-tag 5062 STRING)) +;;; Compressed payload digest. Its type is a string array, but currently in +;;; practice it is equivalent to STRING, since only the first element is used. +(define RPMTAG_PAYLOADDIGEST (make-rpm-tag 5092 STRING_ARRAY)) +;;; The algorithm used to compute the payload digest, e.g. RPM_HASH_SHA256. +(define RPMTAG_PAYLOADDIGESTALGO (make-rpm-tag 5093 INT32)) +;;; The following are taken from the rpmHashAlgo_e enum in rpmcrypto.h. +(define RPM_HASH_MD5 1) +(define RPM_HASH_SHA256 8) + +;;; Other useful internal definitions. +(define REGION_TAG_COUNT 16) ;number of bytes +(define INT32_MAX (1- (expt 2 32))) ;4294967295 bytes (unsigned) + +(define (rpm-tag->u8-list tag) + "Return the u8 list corresponding to RPM-TAG, a <rpm-tag> object." + (append (u32-number->u8-list (rpm-tag-number tag)) + (u32-number->u8-list (rpm-tag-type tag)))) + +(define-record-type <header-entry> + (make-header-entry tag count value) + header-entry? + (tag header-entry-tag) ;<rpm-tag> + (count header-entry-count) ;number (u32) + (value header-entry-value)) ;string|number|list|... + +(define (entry-type->alignement type) + "Return the byte alignment of TYPE, an RPM header entry type." + (cond ((= INT16 type) 2) + ((= INT32 type) 4) + ((= INT64 type) 8) + (else 1))) + +(define (next-aligned-offset offset alignment) + "Return the next position from OFFSET which satisfies ALIGNMENT." + (if (= 0 (modulo offset alignment)) + offset + (next-aligned-offset (1+ offset) alignment))) + +(define (header-entry->data entry) + "Return the data of ENTRY, a <header-entry> object, as a u8 list." + (let* ((tag (header-entry-tag entry)) + (count (header-entry-count entry)) + (value (header-entry-value entry)) + (number (rpm-tag-number tag)) + (type (rpm-tag-type tag))) + (cond + ((= STRING type) + (unless (string? value) + (error "expected string value for STRING type, got" value)) + (unless (= 1 count) + (error "count must be 1 for STRING type")) + (let ((value (cond ((= (rpm-tag-number RPMTAG_VERSION) number) + ;; Hyphens are not allowed in version strings. + (string-map (match-lambda + (#\- #\+) + (c c)) + value)) + (else value)))) + (append (bytevector->u8-list (string->utf8 value)) + (list 0)))) ;strings must end with null byte + ((= STRING_ARRAY type) + (unless (list? value) + (error "expected a list of strings for STRING_ARRAY type, got" value)) + (unless (= count (length value)) + (error "expected count to be equal to" (length value) 'got count)) + (append-map (lambda (s) + (append (bytevector->u8-list (string->utf8 s)) + (list 0))) ;null byte separated + value)) + ((member type (list INT8 INT16 INT32)) + (if (= 1 count) + (unless (number? value) + (error "expected number value for scalar INT type; got" value)) + (unless (list? value) + (error "expected list value for array INT type; got" value))) + (if (list? value) + (cond ((= INT8 type) value) + ((= INT16 type) (append-map u16-number->u8-list value)) + ((= INT32 type) (append-map u32-number->u8-list value)) + (else (error "unexpected type" type))) + (cond ((= INT8 type) (list value)) + ((= INT16 type) (u16-number->u8-list value)) + ((= INT32 type) (u32-number->u8-list value)) + (else (error "unexpected type" type))))) + ((= BIN type) + (unless (list? value) + (error "expected list value for BIN type; got" value)) + value) + (else (error "unimplemented type" type))))) + +(define (make-header-index+data entries) + "Return the index and data sections as u8 number lists, via multiple values. +An index is composed of four u32 (16 bytes total) quantities, in order: tag, +type, offset and count." + (match (fold (match-lambda* + ((entry (offset . (index . data))) + (let* ((tag (header-entry-tag entry)) + (tag-number (rpm-tag-number tag)) + (tag-type (rpm-tag-type tag)) + (count (header-entry-count entry)) + (data* (header-entry->data entry)) + (alignment (entry-type->alignement tag-type)) + (aligned-offset (next-aligned-offset offset alignment)) + (padding (make-list (- aligned-offset offset) 0))) + (cons (+ aligned-offset (length data*)) + (cons (append index + (u32-number->u8-list tag-number) + (u32-number->u8-list tag-type) + (u32-number->u8-list aligned-offset) + (u32-number->u8-list count)) + (append data padding data*)))))) + '(0 . (() . ())) + entries) + ((offset . (index . data)) + (values index data)))) + +;; Prevent inlining of the variables/procedures accessed by unit tests. +(set! make-header-index+data make-header-index+data) +(set! RPMTAG_ARCH RPMTAG_ARCH) +(set! RPMTAG_LICENSE RPMTAG_LICENSE) +(set! RPMTAG_NAME RPMTAG_NAME) +(set! RPMTAG_OS RPMTAG_OS) +(set! RPMTAG_RELEASE RPMTAG_RELEASE) +(set! RPMTAG_SUMMARY RPMTAG_SUMMARY) +(set! RPMTAG_VERSION RPMTAG_VERSION) + +(define (wrap-in-region-tags header region-tag) + "Wrap HEADER, a header provided as u8-list with REGION-TAG." + (let* ((type (rpm-tag-type region-tag)) + (header-intro (take header 16)) + (header-rest (drop header 16)) + ;; Increment the existing index value to account for the added region + ;; tag index. + (index-length (1+ (u8-list->u32-number + (drop-right (drop header-intro 8) 4)))) ;bytes 8-11 + ;; Increment the data length value to account for the added region + ;; tag data. + (data-length (+ REGION_TAG_COUNT + (u8-list->u32-number + (take-right header-intro 4))))) ;last 4 bytes of intro + (unless (member region-tag (list RPMTAG_HEADERSIGNATURES + RPMTAG_HEADERIMMUTABLE)) + (error "expected RPMTAG_HEADERSIGNATURES or RPMTAG_HEADERIMMUTABLE, got" + region-tag)) + (append (drop-right header-intro 8) ;strip existing index and data lengths + (u32-number->u8-list index-length) + (u32-number->u8-list data-length) + ;; Region tag (16 bytes). + (u32-number->u8-list (rpm-tag-number region-tag)) ;number + (u32-number->u8-list type) ;type + (u32-number->u8-list (- data-length REGION_TAG_COUNT)) ;offset + (u32-number->u8-list REGION_TAG_COUNT) ;count + ;; Immutable region. + header-rest + ;; Region tag trailer (16 bytes). Note: the trailer offset value + ;; is an enforced convention; it has no practical use. + (u32-number->u8-list (rpm-tag-number region-tag)) ;number + (u32-number->u8-list type) ;type + (s32-number->u8-list (* -1 index-length 16)) ;negative offset + (u32-number->u8-list REGION_TAG_COUNT)))) ;count + +(define (bytevector->hex-string bv) + (format #f "~{~2,'0x~}" (bytevector->u8-list bv))) + +(define (files->md5-checksums files) + "Return the MD5 checksums (formatted as hexadecimal strings) for FILES." + (let ((file-md5 (cut file-hash (hash-algorithm md5) <>))) + (map (lambda (f) + (or (and=> (false-if-exception (file-md5 f)) + bytevector->hex-string) + ;; Only regular files (e.g., not directories) can have their + ;; checksum computed. + "")) + files))) + +(define (strip-leading-dot name) + "Remove the leading \".\" from NAME, if present. If a single \".\" is +encountered, translate it to \"/\"." + (match name + ("." "/") ;special case + ((? (cut string-prefix? "." <>)) + (string-drop name 1)) + (x name))) + +;;; An extensive list of required and optional FHS directories, per its 3.0 +;;; revision. +(define %fhs-directories + (list "/bin" "/boot" "/dev" + "/etc" "/etc/opt" "/etc/X11" "/etc/sgml" "/etc/xml" + "/home" "/root" "/lib" "/media" "/mnt" + "/opt" "/opt/bin" "/opt/doc" "/opt/include" + "/opt/info" "/opt/lib" "/opt/man" + "/run" "/sbin" "/srv" "/sys" "/tmp" + "/usr" "/usr/bin" "/usr/include" "/usr/libexec" + "/usr/share/color" "/usr/share/dict" "/usr/share/doc" "/usr/share/games" + "/usr/share/info" "/usr/share/locale" "/usr/share/man" "/usr/share/misc" + "/usr/share/nls" "/usr/share/ppd" "/usr/share/sgml" + "/usr/share/terminfo" "/usr/share/tmac" "/usr/share/xml" + "/usr/share/zoneinfo" "/usr/local" "/usr/local/bin" "/usr/local/etc" + "/usr/local/games" "/usr/local/include" "/usr/local/lib" + "/usr/local/man" "/usr/local/sbin" "/usr/local/sbin" "/usr/local/share" + "/usr/local/src" "/var" "/var/account" "/var/backups" + "/var/cache" "/var/cache/fonts" "/var/cache/man" "/var/cache/www" + "/var/crash" "/var/cron" "/var/games" "/var/mail" "/var/msgs" + "/var/lib" "/var/lib/color" "/var/lib/hwclock" "/var/lib/misc" + "/var/local" "/var/lock" "/var/log" "/var/opt" "/var/preserve" + "/var/run" "/var/spool" "/var/spool/lpd" "/var/spool/mqueue" + "/var/spool/news" "/var/spool/rwho" "/var/spool/uucp" + "/var/tmp" "/var/yp")) + +(define (fhs-directory? file-name) + "Predicate to check if FILE-NAME is a known File Hierarchy Standard (FHS) +directory." + (member (strip-leading-dot file-name) %fhs-directories)) + +(define (directory->file-entries directory) + "Return the file lists triplet header entries for the files found under +DIRECTORY." + (with-directory-excursion directory + ;; Skip the initial "." directory, as its name would get concatenated with + ;; the "./" dirname and fail to match "." in the payload. + (let* ((files (cdr (find-files "." #:directories? #t))) + (file-stats (map lstat files)) + (directories + (append (list ".") + (filter-map (match-lambda + ((index . file) + (let ((st (list-ref file-stats index))) + (and (eq? 'directory (stat:type st)) + file)))) + (list-transduce (tenumerate) rcons files)))) + ;; Omit any FHS directories found in FILES to avoid the RPM package + ;; from owning them. This can occur when symlinks directives such + ;; as "/usr/bin/hello -> bin/hello" are used. + (package-files package-file-stats + (unzip2 (reverse + (fold (lambda (file stat res) + (if (fhs-directory? file) + res + (cons (list file stat) res))) + '() files file-stats)))) + + ;; When provided with the index of a file, the directory index must + ;; return the index of the corresponding directory entry. + (dirindexes (map (lambda (d) + (list-index (cut string=? <> d) directories)) + (map dirname package-files))) + ;; The files owned are those appearing in 'basenames'; own them + ;; all. + (basenames (map basename package-files)) + ;; The directory names must end with a trailing "/". + (dirnames (map (compose strip-leading-dot (cut string-append <> "/")) + directories)) + ;; Note: All the file-related entries must have the same length as + ;; the basenames entry. + (symlink-targets (map (lambda (f) + (if (symbolic-link? f) + (readlink f) + "")) ;unused + package-files)) + (file-modes (map stat:mode package-file-stats)) + (file-sizes (map stat:size package-file-stats)) + (file-md5s (files->md5-checksums package-files))) + (let ((basenames-length (length basenames)) + (dirindexes-length (length dirindexes))) + (unless (= basenames-length dirindexes-length) + (error "length mismatch for dirIndexes; expected/actual" + basenames-length dirindexes-length)) + (append + (if (> (apply max file-sizes) INT32_MAX) + (list (make-header-entry RPMTAG_LONGFILESIZES (length file-sizes) + file-sizes) + (make-header-entry RPMTAG_LONGSIZE 1 + (reduce + 0 file-sizes))) + (list (make-header-entry RPMTAG_FILESIZES (length file-sizes) + file-sizes) + (make-header-entry RPMTAG_SIZE 1 (reduce + 0 file-sizes)))) + (list + (make-header-entry RPMTAG_FILEMODES (length file-modes) file-modes) + (make-header-entry RPMTAG_FILEDIGESTS (length file-md5s) file-md5s) + (make-header-entry RPMTAG_FILEDIGESTALGO 1 RPM_HASH_MD5) + (make-header-entry RPMTAG_FILELINKTOS (length symlink-targets) + symlink-targets) + (make-header-entry RPMTAG_FILEUSERNAME basenames-length + (make-list basenames-length "root")) + (make-header-entry RPMTAG_GROUPNAME basenames-length + (make-list basenames-length "root")) + ;; The dirindexes, basenames and dirnames tags form the so-called RPM + ;; "path triplet". + (make-header-entry RPMTAG_DIRINDEXES dirindexes-length dirindexes) + (make-header-entry RPMTAG_BASENAMES basenames-length basenames) + (make-header-entry RPMTAG_DIRNAMES (length dirnames) dirnames))))))) + +(define (make-header entries) + "Return the u8 list of a RPM header containing ENTRIES, a list of +<rpm-entry> objects." + (let* ((entries (sort entries (lambda (x y) + (< (rpm-tag-number (header-entry-tag x)) + (rpm-tag-number (header-entry-tag y)))))) + (count (length entries)) + (index data (make-header-index+data entries))) + (append header-intro ;8 bytes + (u32-number->u8-list count) ;4 bytes + (u32-number->u8-list (length data)) ;4 bytes + ;; Now starts the header index, which can contain up to 32 entries + ;; of 16 bytes each. + index data))) + +(define* (generate-header name version + payload-digest + payload-directory + payload-compressor + #:key + relocatable? + prein-file postin-file + preun-file postun-file + (target %host-type) + (release "0") + (license "N/A") + (summary "RPM archive generated by GNU Guix.") + (os "Linux")) ;see rpmrc.in + "Return the u8 list corresponding to the Header section. PAYLOAD-DIGEST is +the SHA256 checksum string of the compressed payload. PAYLOAD-DIRECTORY is +the directory containing the payload files. PAYLOAD-COMPRESSOR is the name of +the compressor used to compress the CPIO payload, such as \"none\", \"gz\", +\"xz\" or \"zstd\"." + (let* ((rpm-arch (gnu-machine-type->rpm-arch + (gnu-system-triplet->machine-type target))) + (file->string (cut call-with-input-file <> get-string-all)) + (prein-script (and=> prein-file file->string)) + (postin-script (and=> postin-file file->string)) + (preun-script (and=> preun-file file->string)) + (postun-script (and=> postun-file file->string))) + (wrap-in-region-tags + (make-header (append + (list (make-header-entry RPMTAG_HEADERI18NTABLE 1 (list "C")) + (make-header-entry RPMTAG_NAME 1 name) + (make-header-entry RPMTAG_VERSION 1 version) + (make-header-entry RPMTAG_RELEASE 1 release) + (make-header-entry RPMTAG_SUMMARY 1 summary) + (make-header-entry RPMTAG_LICENSE 1 license) + (make-header-entry RPMTAG_OS 1 os) + (make-header-entry RPMTAG_ARCH 1 rpm-arch)) + (directory->file-entries payload-directory) + (if relocatable? + ;; Note: RPMTAG_PREFIXES must not have a trailing + ;; slash, unless it's '/'. This allows installing the + ;; package via 'rpm -i --prefix=/tmp', for example. + (list (make-header-entry RPMTAG_PREFIXES 1 (list "/"))) + '()) + (if prein-script + (list (make-header-entry RPMTAG_PREIN 1 prein-script)) + '()) + (if postin-script + (list (make-header-entry RPMTAG_POSTIN 1 postin-script)) + '()) + (if preun-script + (list (make-header-entry RPMTAG_PREUN 1 preun-script)) + '()) + (if postun-script + (list (make-header-entry RPMTAG_POSTUN 1 postun-script)) + '()) + (if (string=? "none" payload-compressor) + '() + (list (make-header-entry RPMTAG_PAYLOADCOMPRESSOR 1 + payload-compressor))) + (list (make-header-entry RPMTAG_ENCODING 1 "utf-8") + (make-header-entry RPMTAG_PAYLOADFORMAT 1 "cpio") + (make-header-entry RPMTAG_PAYLOADDIGEST 1 + (list payload-digest)) + (make-header-entry RPMTAG_PAYLOADDIGESTALGO 1 + RPM_HASH_SHA256)))) + RPMTAG_HEADERIMMUTABLE))) + + +;;; +;;; Signature section +;;; + +;;; Header sha256 checksum. +(define RPMSIGTAG_SHA256 (make-rpm-tag 273 STRING)) +;;; Uncompressed payload size. +(define RPMSIGTAG_PAYLOADSIZE (make-rpm-tag 1007 INT32)) +;;; Header and compressed payload combined size. +(define RPMSIGTAG_SIZE (make-rpm-tag 1000 INT32)) +;;; Uncompressed payload size (when size > max u32). +(define RPMSIGTAG_LONGARCHIVESIZE (make-rpm-tag 271 INT64)) +;;; Header and compressed payload combined size (when size > max u32). +(define RPMSIGTAG_LONGSIZE (make-rpm-tag 270 INT64)) +;;; Extra space reserved for signatures (typically 32 bytes). +(define RPMSIGTAG_RESERVEDSPACE (make-rpm-tag 1008 BIN)) + +(define (generate-signature header-sha256 + header+compressed-payload-size + ;; uncompressed-payload-size + ) + "Return the u8 list representing a signature header containing the +HEADER-SHA256 (a string) and the PAYLOAD-SIZE, which is the combined size of +the header and compressed payload." + (define size-tag (if (> header+compressed-payload-size INT32_MAX) + RPMSIGTAG_LONGSIZE + RPMSIGTAG_SIZE)) + (wrap-in-region-tags + (make-header (list (make-header-entry RPMSIGTAG_SHA256 1 header-sha256) + (make-header-entry size-tag 1 + header+compressed-payload-size) + ;; (make-header-entry RPMSIGTAG_PAYLOADSIZE 1 + ;; uncompressed-payload-size) + ;; Reserve 32 bytes of extra space in case users would + ;; like to add signatures, as done in rpmGenerateSignature. + (make-header-entry RPMSIGTAG_RESERVEDSPACE 32 + (make-list 32 0)))) + RPMTAG_HEADERSIGNATURES)) + +(define (assemble-rpm-metadata lead signature header) + "Align and append the various u8 list components together, and return the +result as a bytevector." + (let* ((offset (+ (length lead) (length signature))) + (header-offset (next-aligned-offset offset 8)) + (padding (make-list (- header-offset offset) 0))) + ;; The Header is 8-bytes aligned. + (u8-list->bytevector (append lead signature padding header)))) diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index 7a5fb9bd0d..b56c7d7f80 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -5,7 +5,7 @@ ;;; Copyright © 2018 Chris Marusich <cmmarusich@HIDDEN> ;;; Copyright © 2018 Efraim Flashner <efraim@HIDDEN> ;;; Copyright © 2020 Tobias Geerinckx-Rice <me@HIDDEN> -;;; Copyright © 2020, 2021, 2022 Maxim Cournoyer <maxim.cournoyer@HIDDEN> +;;; Copyright © 2020, 2021, 2022, 2023 Maxim Cournoyer <maxim.cournoyer@HIDDEN> ;;; Copyright © 2020 Eric Bavier <bavier@HIDDEN> ;;; Copyright © 2022 Alex Griffin <a@HIDDEN> ;;; @@ -67,6 +67,7 @@ (define-module (guix scripts pack) self-contained-tarball debian-archive + rpm-archive docker-image squashfs-image @@ -865,6 +866,163 @@ (define tar (string-append #+archiver "/bin/tar")) ;;; +;;; RPM archive format. +;;; +(define* (rpm-archive name profile + #:key target + (profile-name "guix-profile") + entry-point + (compressor (first %compressors)) + deduplicate? + localstatedir? + (symlinks '()) + archiver + (extra-options '())) + "Return a RPM archive (.rpm) containing a store initialized with the closure +of PROFILE, a derivation. The archive contains /gnu/store. SYMLINKS must be +a list of (SOURCE -> TARGET) tuples denoting symlinks to be added to the pack. +ARCHIVER and ENTRY-POINT are not used. RELOCATABLE?, PREIN-FILE, POSTIN-FILE, +PREUN-FILE and POSTUN-FILE can be provided via EXTRA-OPTIONS." + (define relocatable? (keyword-ref extra-options #:relocatable?)) + (define prein-file (keyword-ref extra-options #:prein-file)) + (define postin-file (keyword-ref extra-options #:postin-file)) + (define preun-file (keyword-ref extra-options #:preun-file)) + (define postun-file (keyword-ref extra-options #:postun-file)) + + (when entry-point + (warning (G_ "entry point not supported in the '~a' format~%") 'rpm)) + + (define root (populate-profile-root profile + #:profile-name profile-name + #:target target + #:localstatedir? localstatedir? + #:deduplicate? deduplicate? + #:symlinks symlinks)) + + (define payload + (let* ((raw-cpio-file-name "payload.cpio") + (compressed-cpio-file-name (string-append raw-cpio-file-name + (compressor-extension + compressor)))) + (computed-file compressed-cpio-file-name + (with-imported-modules (source-module-closure + '((guix build utils) + (guix cpio) + (guix rpm))) + #~(begin + (use-modules (guix build utils) + (guix cpio) + (guix rpm) + (srfi srfi-1)) + + ;; Make sure non-ASCII file names are properly handled. + #+(set-utf8-locale profile) + + (define %root (if #$localstatedir? "." #$root)) + + (when #$localstatedir? + ;; Fix the permission of the Guix database file, which was made + ;; read-only when copied to the store in populate-profile-root. + (copy-recursively #$root %root) + (chmod (string-append %root "/var/guix/db/db.sqlite") #o644)) + + (call-with-output-file #$raw-cpio-file-name + (lambda (port) + (with-directory-excursion %root + ;; The first "." entry is discarded. + (write-cpio-archive + (remove fhs-directory? + (cdr (find-files "." #:directories? #t))) + port)))) + (when #+(compressor-command compressor) + (apply invoke (append #+(compressor-command compressor) + (list #$raw-cpio-file-name)))) + (copy-file #$compressed-cpio-file-name #$output))) + #:local-build? #f))) ;allow offloading + + (define build + (with-extensions (list guile-gcrypt) + (with-imported-modules `(((guix config) => ,(make-config.scm)) + ,@(source-module-closure + `((gcrypt hash) + (guix build utils) + (guix profiles) + (guix rpm)) + #:select? not-config?)) + #~(begin + (use-modules (gcrypt hash) + (guix build utils) + (guix profiles) + (guix rpm) + (ice-9 binary-ports) + (ice-9 match) ;for manifest->friendly-name + (rnrs bytevectors) + (srfi srfi-1)) + + (define machine-type + (and=> (or #$target %host-type) + (lambda (triplet) + (first (string-split triplet #\-))))) + + #$(procedure-source manifest->friendly-name) + + (define manifest (profile-manifest #$profile)) + + (define single-entry ;manifest entry + (match (manifest-entries manifest) + ((entry) + entry) + (_ #f))) + + (define name (or (and=> single-entry manifest-entry-name) + (manifest->friendly-name manifest))) + + (define version (or (and=> single-entry manifest-entry-version) + "0.0.0")) + + (define lead (generate-lead (string-append name "-" version) + #:target (or #$target %host-type))) + + (define payload-digest (bytevector->hex-string + (file-sha256 #$payload))) + + (define header (generate-header name version + payload-digest + #$root + #$(compressor-name compressor) + #:target (or #$target %host-type) + #:relocatable? #$relocatable? + #:prein-file #$prein-file + #:postin-file #$postin-file + #:preun-file #$preun-file + #:postun-file #$postun-file)) + + (define header-sha256 (bytevector->hex-string + (sha256 (u8-list->bytevector header)))) + + (define payload-size (stat:size (stat #$payload))) + + (define header+compressed-payload-size (+ (length header) + payload-size)) + + (define signature (generate-signature + header-sha256 + header+compressed-payload-size)) + + ;; Serialize the archive components to a file. + (call-with-input-file #$payload + (lambda (in) + (call-with-output-file #$output + (lambda (out) + (put-bytevector out (assemble-rpm-metadata lead + signature + header)) + (sendfile out in payload-size))))))))) + + (gexp->derivation (string-append name ".rpm") build)) + + +;;; ;;; Compiling C programs. ;;; @@ -1196,7 +1354,8 @@ (define %formats `((tarball . ,self-contained-tarball) (squashfs . ,squashfs-image) (docker . ,docker-image) - (deb . ,debian-archive))) + (deb . ,debian-archive) + (rpm . ,rpm-archive))) (define (show-formats) ;; Print the supported pack formats. @@ -1210,18 +1369,22 @@ (define (show-formats) docker Tarball ready for 'docker load'")) (display (G_ " deb Debian archive installable via dpkg/apt")) + (display (G_ " + rpm RPM archive installable via rpm/yum")) (newline)) +(define (required-option symbol) + "Return an SYMBOL option that requires a value." + (option (list (symbol->string symbol)) #t #f + (lambda (opt name arg result . rest) + (apply values + (alist-cons symbol arg result) + rest)))) + (define %deb-format-options - (let ((required-option (lambda (symbol) - (option (list (symbol->string symbol)) #t #f - (lambda (opt name arg result . rest) - (apply values - (alist-cons symbol arg result) - rest)))))) - (list (required-option 'control-file) - (required-option 'postinst-file) - (required-option 'triggers-file)))) + (list (required-option 'control-file) + (required-option 'postinst-file) + (required-option 'triggers-file))) (define (show-deb-format-options) (display (G_ " @@ -1240,6 +1403,32 @@ (define (show-deb-format-options/detailed) (newline) (exit 0)) +(define %rpm-format-options + (list (required-option 'prein-file) + (required-option 'postin-file) + (required-option 'preun-file) + (required-option 'postun-file))) + +(define (show-rpm-format-options) + (display (G_ " + --help-rpm-format list options specific to the RPM format"))) + +(define (show-rpm-format-options/detailed) + (display (G_ " + --prein-file=FILE + Embed the provided prein script")) + (display (G_ " + --postin-file=FILE + Embed the provided postin script")) + (display (G_ " + --preun-file=FILE + Embed the provided preun script")) + (display (G_ " + --postun-file=FILE + Embed the provided postun script")) + (newline) + (exit 0)) + (define %options ;; Specifications of the command-line options. (cons* (option '(#\h "help") #f #f @@ -1316,7 +1505,12 @@ (define %options (lambda args (show-deb-format-options/detailed))) + (option '("help-rpm-format") #f #f + (lambda args + (show-rpm-format-options/detailed))) + (append %deb-format-options + %rpm-format-options %transformation-options %standard-build-options %standard-cross-build-options @@ -1334,6 +1528,7 @@ (define (show-help) (show-transformation-options-help) (newline) (show-deb-format-options) + (show-rpm-format-options) (newline) (display (G_ " -f, --format=FORMAT build a pack in the given FORMAT")) @@ -1492,6 +1687,16 @@ (define (process-file-arg opts name) (process-file-arg opts 'postinst-file) #:triggers-file (process-file-arg opts 'triggers-file))) + ('rpm + (list #:relocatable? relocatable? + #:prein-file + (process-file-arg opts 'prein-file) + #:postin-file + (process-file-arg opts 'postin-file) + #:preun-file + (process-file-arg opts 'preun-file) + #:postun-file + (process-file-arg opts 'postun-file))) (_ '()))) (target (assoc-ref opts 'target)) (bootstrap? (assoc-ref opts 'bootstrap?)) diff --git a/tests/pack.scm b/tests/pack.scm index 2e3b9d0ca4..0708f8dfd5 100644 --- a/tests/pack.scm +++ b/tests/pack.scm @@ -1,7 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@HIDDEN> ;;; Copyright © 2018 Ricardo Wurmus <rekado@HIDDEN> -;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@HIDDEN> +;;; Copyright © 2021, 2023 Maxim Cournoyer <maxim.cournoyer@HIDDEN> ;;; ;;; This file is part of GNU Guix. ;;; @@ -28,13 +28,16 @@ (define-module (test-pack) #:use-module (guix tests) #:use-module (guix gexp) #:use-module (guix modules) + #:use-module (guix utils) #:use-module (gnu packages) #:use-module ((gnu packages base) #:select (glibc-utf8-locales)) #:use-module (gnu packages bootstrap) + #:use-module ((gnu packages package-management) #:select (rpm)) #:use-module ((gnu packages compression) #:select (squashfs-tools)) #:use-module ((gnu packages debian) #:select (dpkg)) #:use-module ((gnu packages guile) #:select (guile-sqlite3)) #:use-module ((gnu packages gnupg) #:select (guile-gcrypt)) + #:use-module ((gnu packages linux) #:select (fakeroot)) #:use-module (srfi srfi-64)) (define %store @@ -59,6 +62,17 @@ (define %tar-bootstrap %bootstrap-coreutils&co) (define %ar-bootstrap %bootstrap-binutils) +;;; This is a variant of the RPM package configured so that its database can +;;; be created on a writable location readily available inside the build +;;; container ("/tmp"). +(define rpm-for-tests + (package + (inherit rpm) + (arguments (substitute-keyword-arguments (package-arguments rpm) + ((#:configure-flags flags '()) + #~(cons "--localstatedir=/tmp" + (delete "--localstatedir=/var" #$flags))))))) + (test-begin "pack") @@ -360,6 +374,47 @@ (define hard-links (stat "postinst")))))) (assert (file-exists? "triggers")) + (mkdir #$output)))))) + (built-derivations (list check)))) + + (unless store (test-skip 1)) + (test-assertm "rpm archive can be installed/uninstalled" store + (mlet* %store-monad + ((guile (set-guile-for-build (default-guile))) + (profile (profile-derivation (packages->manifest + (list %bootstrap-guile)) + #:hooks '() + #:locales? #f)) + (rpm-pack (rpm-archive "rpm-pack" profile + #:compressor %gzip-compressor + #:symlinks '(("/bin/guile" -> "bin/guile")) + #:extra-options '(#:relocatable? #t))) + (check + (gexp->derivation "check-rpm-pack" + (with-imported-modules (source-module-closure + '((guix build utils))) + #~(begin + (use-modules (guix build utils)) + + (define fakeroot #+(file-append fakeroot "/bin/fakeroot")) + (define rpm #+(file-append rpm-for-tests "/bin/rpm")) + (mkdir-p "/tmp/lib/rpm") + + ;; Install the RPM package. This causes RPM to validate the + ;; signatures, header as well as the file digests, which + ;; makes it a rather thorough test. + (mkdir "test-prefix") + (invoke fakeroot rpm "--install" + (string-append "--prefix=" (getcwd) "/test-prefix") + #$rpm-pack) + + ;; Invoke the installed Guile command. + (invoke "./test-prefix/bin/guile" "--version") + + ;; Uninstall the RPM package. + (invoke fakeroot rpm "--erase" "guile-bootstrap") + + ;; Required so the above is run. (mkdir #$output)))))) (built-derivations (list check))))) diff --git a/tests/rpm.scm b/tests/rpm.scm new file mode 100644 index 0000000000..f40b36fe60 --- /dev/null +++ b/tests/rpm.scm @@ -0,0 +1,86 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2023 Maxim Cournoyer <maxim.cournoyer@HIDDEN> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (test-rpm) + #:use-module (guix rpm) + #:use-module (rnrs bytevectors) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) + #:use-module (srfi srfi-64) + #:use-module (srfi srfi-71)) + +;; For white-box testing. +(define-syntax-rule (expose-internal name) + (define name (@@ (guix rpm) name))) + +(expose-internal RPMTAG_ARCH) +(expose-internal RPMTAG_LICENSE) +(expose-internal RPMTAG_NAME) +(expose-internal RPMTAG_OS) +(expose-internal RPMTAG_RELEASE) +(expose-internal RPMTAG_SUMMARY) +(expose-internal RPMTAG_VERSION) +(expose-internal header-entry-count) +(expose-internal header-entry-tag) +(expose-internal header-entry-value) +(expose-internal header-entry?) +(expose-internal make-header) +(expose-internal make-header-entry) +(expose-internal make-header-index+data) + +(test-begin "rpm") + +(test-equal "lead must be 96 bytes long" + 96 + (length (generate-lead "hello-2.12.1"))) + +(define header-entries + (list (make-header-entry RPMTAG_NAME 1 "hello") + (make-header-entry RPMTAG_VERSION 1 "2.12.1") + (make-header-entry RPMTAG_RELEASE 1 "0") + (make-header-entry RPMTAG_SUMMARY 1 + "Hello, GNU world: An example GNU package") + (make-header-entry RPMTAG_LICENSE 1 "GPL 3 or later") + (make-header-entry RPMTAG_OS 1 "Linux") + (make-header-entry RPMTAG_ARCH 1 "x86_64"))) + +(define expected-header-index-length + (* 16 (length header-entries))) ;16 bytes per index entry + +(define expected-header-data-length + (+ (length header-entries) ;to account for null bytes + (fold + 0 (map (compose string-length (cut header-entry-value <>)) + header-entries)))) + +(let ((index data (make-header-index+data header-entries))) + (test-equal "header index" + expected-header-index-length + (length index)) + + ;; This test depends on the fact that only STRING entries are used, and that + ;; they are composed of single byte characters and the delimiting null byte. + (test-equal "header data" + expected-header-data-length + (length data))) + +(test-equal "complete header section" + (+ 16 ;leading magic + count bytes + expected-header-index-length expected-header-data-length) + (length (make-header header-entries))) + +(test-end) -- 2.39.1
guix-patches@HIDDEN
:bug#61255
; Package guix-patches
.
Full text available.Received: (at 61255) by debbugs.gnu.org; 3 Feb 2023 22:14:55 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 03 17:14:55 2023 Received: from localhost ([127.0.0.1]:40091 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pO4Kc-00056g-Ib for submit <at> debbugs.gnu.org; Fri, 03 Feb 2023 17:14:55 -0500 Received: from mail-qt1-f178.google.com ([209.85.160.178]:46781) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <maxim.cournoyer@HIDDEN>) id 1pO4KZ-000569-Iq for 61255 <at> debbugs.gnu.org; Fri, 03 Feb 2023 17:14:53 -0500 Received: by mail-qt1-f178.google.com with SMTP id g8so7168358qtq.13 for <61255 <at> debbugs.gnu.org>; Fri, 03 Feb 2023 14:14:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2WA28OG7KuMKicNv+26GLxGfN39FAoFy9wRJf4/yw/c=; b=ioO26jGAOKR2duczsWp3/xkKDKzjUTq1ddElGoNV6h3I7cAJnj7PyZF4YUdtliGS9o 5vf7NZB54ctFmrM2Q1VQAqwXvct1uQy6SP4t87TJesJ54rGVoQoNcSGjpjsUb0VyQRFn LdjSJwUiYYk0a5dif1yxPQKuaqxNZhR73Nvr63LyNhM5doQkuZZlnKaeqYfVGSz0tHEh QcKk6qqUk4UonbfHYKamW3Hm53ZDIqnHKS4c2FdlIWZJ0WzwGP9nNR6y8+4p6kaDoesg IV1KJf/YJgLdp+xIipJ/H1QkkCft2Q01d4IFPp/5ZjMN5IerzYxEP5XHn/waFwrskSKj jUcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2WA28OG7KuMKicNv+26GLxGfN39FAoFy9wRJf4/yw/c=; b=gssKxjjSVopcnSb9LwpcDfkX0ufLqymzj04K9jwH2jRCJKvonqo1iS9Tx2a4v/MKKv PYxLQjI7xs5pNeyKpwgqg3RCovh1TZ5gx2fazknUfn0R3Ujo1wbMhDHThoY9p/0ntqAv wyznYDnJlcjdlSit85JGQRxIn4TcXy4aUOLUMVGx5WG8ar5KGdb0h+rY+/J/0So5jUUc QIhFJsroeVjhD2bGVMDq+XFNK99MkoS4pcrHdfPXtrmK6uBoN6Lf5f7N4g2PXot080Wj 2g5dhwLQmKd2+Q2wYyE6JGDSEm22euhKL0658IUzXzPFx2HZ0ZQqF0/OAej3Jw/mLSR8 90UA== X-Gm-Message-State: AO0yUKU77nFcCGnvr3fYqZKXnw8tnQpnuv/XdL3aO3mTC37ZIaMs+ef2 wO4Y04vwtJaT9xHtBMZiLxP5WunVRCw= X-Google-Smtp-Source: AK7set+suworZ1bpzQZc75LCN2YgZScSUrqgU0JSEYnuKjQqZkqXIGyFkrjIMXVJ3p5Txd2gEkA+vA== X-Received: by 2002:ac8:5955:0:b0:3b6:2bbf:581e with SMTP id 21-20020ac85955000000b003b62bbf581emr20779861qtz.35.1675462485795; Fri, 03 Feb 2023 14:14:45 -0800 (PST) Received: from localhost.localdomain (dsl-10-136-177.b2b2c.ca. [72.10.136.177]) by smtp.gmail.com with ESMTPSA id bp41-20020a05620a45a900b00725d8d6983asm1430594qkb.61.2023.02.03.14.14.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Feb 2023 14:14:45 -0800 (PST) From: Maxim Cournoyer <maxim.cournoyer@HIDDEN> To: 61255 <at> debbugs.gnu.org Subject: [PATCH 4/5] tests: pack: Fix indentation. Date: Fri, 3 Feb 2023 17:14:07 -0500 Message-Id: <20230203221409.15886-5-maxim.cournoyer@HIDDEN> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230203221409.15886-2-maxim.cournoyer@HIDDEN> References: <20230203221409.15886-2-maxim.cournoyer@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61255 Cc: Maxim Cournoyer <maxim.cournoyer@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * tests/pack.scm: Fix indentation. --- tests/pack.scm | 274 ++++++++++++++++++++++++------------------------- 1 file changed, 137 insertions(+), 137 deletions(-) diff --git a/tests/pack.scm b/tests/pack.scm index a4c388d93e..2e3b9d0ca4 100644 --- a/tests/pack.scm +++ b/tests/pack.scm @@ -75,43 +75,43 @@ (define %ar-bootstrap %bootstrap-binutils) #:compressor %gzip-compressor #:archiver %tar-bootstrap)) (check (gexp->derivation - "check-tarball" - (with-imported-modules '((guix build utils)) - #~(begin - (use-modules (guix build utils) - (srfi srfi-1)) - - (define store - ;; The unpacked store. - (string-append "." (%store-directory) "/")) - - (define (canonical? file) - ;; Return #t if FILE is read-only and its mtime is 1. - (let ((st (lstat file))) - (or (not (string-prefix? store file)) - (eq? 'symlink (stat:type st)) - (and (= 1 (stat:mtime st)) - (zero? (logand #o222 - (stat:mode st))))))) - - (define bin - (string-append "." #$profile "/bin")) - - (setenv "PATH" - (string-append #$%tar-bootstrap "/bin")) - (system* "tar" "xvf" #$tarball) - (mkdir #$output) - (exit - (and (file-exists? (string-append bin "/guile")) - (file-exists? store) - (every canonical? - (find-files "." (const #t) - #:directories? #t)) - (string=? (string-append #$%bootstrap-guile "/bin") - (readlink bin)) - (string=? (string-append ".." #$profile - "/bin/guile") - (readlink "bin/Guile"))))))))) + "check-tarball" + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils) + (srfi srfi-1)) + + (define store + ;; The unpacked store. + (string-append "." (%store-directory) "/")) + + (define (canonical? file) + ;; Return #t if FILE is read-only and its mtime is 1. + (let ((st (lstat file))) + (or (not (string-prefix? store file)) + (eq? 'symlink (stat:type st)) + (and (= 1 (stat:mtime st)) + (zero? (logand #o222 + (stat:mode st))))))) + + (define bin + (string-append "." #$profile "/bin")) + + (setenv "PATH" + (string-append #$%tar-bootstrap "/bin")) + (system* "tar" "xvf" #$tarball) + (mkdir #$output) + (exit + (and (file-exists? (string-append bin "/guile")) + (file-exists? store) + (every canonical? + (find-files "." (const #t) + #:directories? #t)) + (string=? (string-append #$%bootstrap-guile "/bin") + (readlink bin)) + (string=? (string-append ".." #$profile + "/bin/guile") + (readlink "bin/Guile"))))))))) (built-derivations (list check)))) ;; The following test needs guile-sqlite3, libgcrypt, etc. as a consequence of @@ -132,16 +132,16 @@ (define bin (tarball (self-contained-tarball "tar-pack" profile #:localstatedir? #t)) (check (gexp->derivation - "check-tarball" - #~(let ((bin (string-append "." #$profile "/bin"))) - (setenv "PATH" - (string-append #$%tar-bootstrap "/bin")) - (system* "tar" "xvf" #$tarball) - (mkdir #$output) - (exit - (and (file-exists? "var/guix/db/db.sqlite") - (string=? (string-append #$%bootstrap-guile "/bin") - (readlink bin)))))))) + "check-tarball" + #~(let ((bin (string-append "." #$profile "/bin"))) + (setenv "PATH" + (string-append #$%tar-bootstrap "/bin")) + (system* "tar" "xvf" #$tarball) + (mkdir #$output) + (exit + (and (file-exists? "var/guix/db/db.sqlite") + (string=? (string-append #$%bootstrap-guile "/bin") + (readlink bin)))))))) (built-derivations (list check)))) (unless store (test-skip 1)) @@ -155,44 +155,44 @@ (define bin (tarball (self-contained-tarball "tar-pack" tree #:localstatedir? #t)) (check (gexp->derivation - "check-tarball" - (with-extensions (list guile-sqlite3 guile-gcrypt) - (with-imported-modules (source-module-closure - '((guix store database))) - #~(begin - (use-modules (guix store database) - (rnrs io ports) - (srfi srfi-1)) - - (define (valid-file? basename data) - (define file - (string-append "./" #$tree "/" basename)) - - (string=? (call-with-input-file (pk 'file file) - get-string-all) - data)) - - (setenv "PATH" - (string-append #$%tar-bootstrap "/bin")) - (system* "tar" "xvf" #$tarball) - - (sql-schema - #$(local-file (search-path %load-path - "guix/store/schema.sql"))) - (with-database "var/guix/db/db.sqlite" db - ;; Make sure non-ASCII file names are properly - ;; handled. - (setenv "GUIX_LOCPATH" - #+(file-append glibc-utf8-locales - "/lib/locale")) - (setlocale LC_ALL "en_US.utf8") - - (mkdir #$output) - (exit - (and (every valid-file? - '("α" "λ") - '("alpha" "lambda")) - (integer? (path-id db #$tree))))))))))) + "check-tarball" + (with-extensions (list guile-sqlite3 guile-gcrypt) + (with-imported-modules (source-module-closure + '((guix store database))) + #~(begin + (use-modules (guix store database) + (rnrs io ports) + (srfi srfi-1)) + + (define (valid-file? basename data) + (define file + (string-append "./" #$tree "/" basename)) + + (string=? (call-with-input-file (pk 'file file) + get-string-all) + data)) + + (setenv "PATH" + (string-append #$%tar-bootstrap "/bin")) + (system* "tar" "xvf" #$tarball) + + (sql-schema + #$(local-file (search-path %load-path + "guix/store/schema.sql"))) + (with-database "var/guix/db/db.sqlite" db + ;; Make sure non-ASCII file names are properly + ;; handled. + (setenv "GUIX_LOCPATH" + #+(file-append glibc-utf8-locales + "/lib/locale")) + (setlocale LC_ALL "en_US.utf8") + + (mkdir #$output) + (exit + (and (every valid-file? + '("α" "λ") + '("alpha" "lambda")) + (integer? (path-id db #$tree))))))))))) (built-derivations (list check)))) (unless store (test-skip 1)) @@ -207,33 +207,33 @@ (define file #:symlinks '(("/bin/Guile" -> "bin/guile")) #:localstatedir? #t)) (check (gexp->derivation - "check-tarball" - (with-imported-modules '((guix build utils)) - #~(begin - (use-modules (guix build utils) - (ice-9 match)) - - (define bin - (string-append "." #$profile "/bin")) - - (setenv "PATH" (string-append #$%tar-bootstrap "/bin")) - (mkdir "base") - (with-directory-excursion "base" - (invoke "tar" "xvf" #$tarball)) - - (match (find-files "base" "layer.tar") - ((layer) - (invoke "tar" "xvf" layer))) - - (when - (and (file-exists? (string-append bin "/guile")) - (file-exists? "var/guix/db/db.sqlite") - (file-is-directory? "tmp") - (string=? (string-append #$%bootstrap-guile "/bin") - (pk 'binlink (readlink bin))) - (string=? (string-append #$profile "/bin/guile") - (pk 'guilelink (readlink "bin/Guile")))) - (mkdir #$output))))))) + "check-tarball" + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils) + (ice-9 match)) + + (define bin + (string-append "." #$profile "/bin")) + + (setenv "PATH" (string-append #$%tar-bootstrap "/bin")) + (mkdir "base") + (with-directory-excursion "base" + (invoke "tar" "xvf" #$tarball)) + + (match (find-files "base" "layer.tar") + ((layer) + (invoke "tar" "xvf" layer))) + + (when + (and (file-exists? (string-append bin "/guile")) + (file-exists? "var/guix/db/db.sqlite") + (file-is-directory? "tmp") + (string=? (string-append #$%bootstrap-guile "/bin") + (pk 'binlink (readlink bin))) + (string=? (string-append #$profile "/bin/guile") + (pk 'guilelink (readlink "bin/Guile")))) + (mkdir #$output))))))) (built-derivations (list check)))) (unless store (test-skip 1)) @@ -248,31 +248,31 @@ (define bin #:symlinks '(("/bin" -> "bin")) #:localstatedir? #t)) (check (gexp->derivation - "check-tarball" - (with-imported-modules '((guix build utils)) - #~(begin - (use-modules (guix build utils) - (ice-9 match)) - - (define bin - (string-append "." #$profile "/bin")) - - (setenv "PATH" - (string-append #$squashfs-tools "/bin")) - (invoke "unsquashfs" #$image) - (with-directory-excursion "squashfs-root" - (when (and (file-exists? (string-append bin - "/guile")) - (file-exists? "var/guix/db/db.sqlite") - (string=? (string-append #$%bootstrap-guile "/bin") - (pk 'binlink (readlink bin))) - - ;; This is a relative symlink target. - (string=? (string-drop - (string-append #$profile "/bin") - 1) - (pk 'guilelink (readlink "bin")))) - (mkdir #$output)))))))) + "check-tarball" + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils) + (ice-9 match)) + + (define bin + (string-append "." #$profile "/bin")) + + (setenv "PATH" + (string-append #$squashfs-tools "/bin")) + (invoke "unsquashfs" #$image) + (with-directory-excursion "squashfs-root" + (when (and (file-exists? (string-append bin + "/guile")) + (file-exists? "var/guix/db/db.sqlite") + (string=? (string-append #$%bootstrap-guile "/bin") + (pk 'binlink (readlink bin))) + + ;; This is a relative symlink target. + (string=? (string-drop + (string-append #$profile "/bin") + 1) + (pk 'guilelink (readlink "bin")))) + (mkdir #$output)))))))) (built-derivations (list check)))) (unless store (test-skip 1)) -- 2.39.1
guix-patches@HIDDEN
:bug#61255
; Package guix-patches
.
Full text available.Received: (at 61255) by debbugs.gnu.org; 3 Feb 2023 22:14:51 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 03 17:14:51 2023 Received: from localhost ([127.0.0.1]:40088 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pO4KY-00056Q-MV for submit <at> debbugs.gnu.org; Fri, 03 Feb 2023 17:14:51 -0500 Received: from mail-qt1-f174.google.com ([209.85.160.174]:39685) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <maxim.cournoyer@HIDDEN>) id 1pO4KX-00055t-8n for 61255 <at> debbugs.gnu.org; Fri, 03 Feb 2023 17:14:49 -0500 Received: by mail-qt1-f174.google.com with SMTP id g18so4890401qtb.6 for <61255 <at> debbugs.gnu.org>; Fri, 03 Feb 2023 14:14:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JYBFH/72eg1bIqkD/1ebVbLu0Pu9JuFuuEnFfy5QpCA=; b=jj8S4MqB8AVDFVH4qbW8bP7IUlGr4KRthH3MqkM21k5udbqiwjTOAx3WZLbsQOaP/F uKMoiyKP0Jygs7r5zIRUDojHFNKyBuWnRkvJFaVCQhSlaiMu4O+38445dnK+kx8ZqwWj S3cwt3i1Tm87V+8XqYruPGzxUnU+Q1eELxpJt+5DaBw3FalMli4vWWPye8jg9JaHdBzU 2uDG31mI5FNfenseWVBWPgFja5+lBsIwaNoMUyMrBMXMOOE1IBNmQJbfbVH/QhTAlk7t OCSV1ZzCaQkWAqLKG3mAsmODjk5uqDlEeFaSHuXMeaRFDyVbgHc/KEwNqyWbbl5eopKn fiwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JYBFH/72eg1bIqkD/1ebVbLu0Pu9JuFuuEnFfy5QpCA=; b=GBILs9L3Yd0vXg0vgBvh8/wmtSJ7r7d+3bQBejBYshPJBEl6LL+6fiQSA3JbML+k16 zBxqtAZ/DioRrH9jHdtDTVUMHS8q1mL2OhAzuan2z8mL3bOPsuMg5+Ut3CrVyOf84N2Z uByRC/Cm3bQnR7/y0ahdO5sQ4Atx/lZY2ZvpQ8JLpZh7wM6L8bMPOB9z8STVOcGqWvUa PzysbJqQyuFbZ8VoFs0x9m5KObUhqSzvZRkTQSLQ69c5+7AlTdceYSoPBQK1WzcDQMhO 0T3OSlrmmGNW6GvZzSDySDG2E5Xwk4qUq3TXeo0fK83KjBMoVPmlboqClgF87sOhis/p 343A== X-Gm-Message-State: AO0yUKVXn///BFOdL6StGA6TFacJmuirkK3Q6oZTNAAglZyf2wISc6as h1HW8a9Qx5u5ZghhEgxXMZjuZrEFhvw= X-Google-Smtp-Source: AK7set8DOE79J/8XnMifrfzb5lAHO2pGZSbZPSEvoybfk0jCAlCQAR+whNnYScigT19wDwHNCQ9A0Q== X-Received: by 2002:ac8:7d45:0:b0:3b6:35a2:bb04 with SMTP id h5-20020ac87d45000000b003b635a2bb04mr23687128qtb.7.1675462483424; Fri, 03 Feb 2023 14:14:43 -0800 (PST) Received: from localhost.localdomain (dsl-10-136-177.b2b2c.ca. [72.10.136.177]) by smtp.gmail.com with ESMTPSA id bp41-20020a05620a45a900b00725d8d6983asm1430594qkb.61.2023.02.03.14.14.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Feb 2023 14:14:42 -0800 (PST) From: Maxim Cournoyer <maxim.cournoyer@HIDDEN> To: 61255 <at> debbugs.gnu.org Subject: [PATCH 3/5] pack: Extract populate-profile-root from self-contained-tarball/builder. Date: Fri, 3 Feb 2023 17:14:06 -0500 Message-Id: <20230203221409.15886-4-maxim.cournoyer@HIDDEN> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230203221409.15886-2-maxim.cournoyer@HIDDEN> References: <20230203221409.15886-2-maxim.cournoyer@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61255 Cc: Josselin Poiret <dev@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Maxim Cournoyer <maxim.cournoyer@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>, Christopher Baines <mail@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) This allows more code to be reused between the various archive writers. * guix/scripts/pack.scm (set-utf8-locale): New top-level procedure, extracted from... (populate-profile-root): New procedure, extracted from... (self-contained-tarball/builder): ... here. Add #:target argument. Call populate-profile-root. [LOCALSTATEDIR?]: Set db.sqlite file permissions. (self-contained-tarball): Call self-contained-tarball/builder with the TARGET argument, and set #:local-build? to #f for the gexp-derivation call. Remove now extraneous #:target and #:references-graphs arguments from the gexp->derivation call. (debian-archive): Call self-contained-tarball/builder with the #:target argument. Fix indentation. Remove now extraneous #:target and #:references-graphs arguments from the gexp->derivation call. --- guix/scripts/pack.scm | 247 ++++++++++++++++++++++++------------------ 1 file changed, 142 insertions(+), 105 deletions(-) diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index 7e466a2be7..7a5fb9bd0d 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -200,104 +200,144 @@ (define (keyword-ref lst keyword) ((_ value . _) value) (#f #f))) - -;;; -;;; Tarball format. -;;; -(define* (self-contained-tarball/builder profile - #:key (profile-name "guix-profile") - (compressor (first %compressors)) - localstatedir? - (symlinks '()) - (archiver tar) - (extra-options '())) - "Return the G-Expression of the builder used for self-contained-tarball." +(define (set-utf8-locale profile) + "Configure the environment to use the \"en_US.utf8\" locale provided by the +GLIBC-UT8-LOCALES package." + ;; Arrange to not depend on 'glibc-utf8-locales' when using '--bootstrap'. + (and (or (not (profile? profile)) + (profile-locales? profile)) + #~(begin + (setenv "GUIX_LOCPATH" + #+(file-append glibc-utf8-locales "/lib/locale")) + (setlocale LC_ALL "en_US.utf8")))) + +(define* (populate-profile-root profile + #:key (profile-name "guix-profile") + target + localstatedir? + deduplicate? + (symlinks '())) + "Populate the root profile directory with SYMLINKS and a Guix database, when +LOCALSTATEDIR? is set. When DEDUPLICATE? is true, deduplicate the store +items, which relies on hard links." (define database (and localstatedir? (file-append (store-database (list profile)) "/db/db.sqlite"))) - (define set-utf8-locale - ;; Arrange to not depend on 'glibc-utf8-locales' when using '--bootstrap'. - (and (or (not (profile? profile)) - (profile-locales? profile)) - #~(begin - (setenv "GUIX_LOCPATH" - #+(file-append glibc-utf8-locales "/lib/locale")) - (setlocale LC_ALL "en_US.utf8")))) - (define (import-module? module) ;; Since we don't use deduplication support in 'populate-store', don't ;; import (guix store deduplication) and its dependencies, which includes - ;; Guile-Gcrypt. That way we can run tests with '--bootstrap'. + ;; Guile-Gcrypt, unless DEDUPLICATE? is #t. This makes it possible to run + ;; tests with '--bootstrap'. (and (not-config? module) - (not (equal? '(guix store deduplication) module)))) - - (with-imported-modules (source-module-closure - `((guix build pack) - (guix build store-copy) - (guix build utils) - (guix build union) - (gnu build install)) - #:select? import-module?) + (or deduplicate? (not (equal? '(guix store deduplication) module))))) + + (computed-file "profile-directory" + (with-imported-modules (source-module-closure + `((guix build pack) + (guix build store-copy) + (guix build utils) + (guix build union) + (gnu build install)) + #:select? import-module?) + #~(begin + (use-modules (guix build pack) + (guix build store-copy) + (guix build utils) + ((guix build union) #:select (relative-file-name)) + (gnu build install) + (srfi srfi-1) + (srfi srfi-26) + (ice-9 match)) + + (define symlink->directives + ;; Return "populate directives" to make the given symlink and its + ;; parent directories. + (match-lambda + ((source '-> target) + (let ((target (string-append #$profile "/" target)) + (parent (dirname source))) + ;; Never add a 'directory' directive for "/" so as to + ;; preserve its ownership when extracting the archive (see + ;; below), and also because this would lead to adding the + ;; same entries twice in the tarball. + `(,@(if (string=? parent "/") + '() + `((directory ,parent))) + ;; Use a relative file name for compatibility with + ;; relocatable packs. + (,source -> ,(relative-file-name parent target))))))) + + (define directives + ;; Fully-qualified symlinks. + (append-map symlink->directives '#$symlinks)) + + ;; Make sure non-ASCII file names are properly handled. + #+(set-utf8-locale profile) + + ;; Note: there is not much to gain here with deduplication and there + ;; is the overhead of the '.links' directory, so turn it off by + ;; default. Furthermore GNU tar < 1.30 sometimes fails to extract + ;; tarballs with hard links: + ;; <http://lists.gnu.org/archive/html/bug-tar/2017-11/msg00009.html>. + (populate-store (list "profile") #$output + #:deduplicate? #$deduplicate?) + + (when #+localstatedir? + (install-database-and-gc-roots #$output #+database #$profile + #:profile-name #$profile-name)) + + ;; Create SYMLINKS. + (for-each (cut evaluate-populate-directive <> #$output) + directives))) + #:local-build? #f + #:options (list #:references-graphs `(("profile" ,profile)) + #:target target))) + + +;;; +;;; Tarball format. +;;; +(define* (self-contained-tarball/builder profile + #:key (profile-name "guix-profile") + target + localstatedir? + deduplicate? + symlinks + compressor + archiver) + "Return a GEXP that can build a self-contained tarball." + + (define root (populate-profile-root profile + #:profile-name profile-name + #:target target + #:localstatedir? localstatedir? + #:deduplicate? deduplicate? + #:symlinks symlinks)) + + (with-imported-modules (source-module-closure '((guix build pack) + (guix build utils))) #~(begin (use-modules (guix build pack) - (guix build store-copy) - (guix build utils) - ((guix build union) #:select (relative-file-name)) - (gnu build install) - (srfi srfi-1) - (srfi srfi-26) - (ice-9 match)) - - (define %root "root") - - (define symlink->directives - ;; Return "populate directives" to make the given symlink and its - ;; parent directories. - (match-lambda - ((source '-> target) - (let ((target (string-append #$profile "/" target)) - (parent (dirname source))) - ;; Never add a 'directory' directive for "/" so as to - ;; preserve its ownership when extracting the archive (see - ;; below), and also because this would lead to adding the - ;; same entries twice in the tarball. - `(,@(if (string=? parent "/") - '() - `((directory ,parent))) - ;; Use a relative file name for compatibility with - ;; relocatable packs. - (,source -> ,(relative-file-name parent target))))))) - - (define directives - ;; Fully-qualified symlinks. - (append-map symlink->directives '#$symlinks)) + (guix build utils)) ;; Make sure non-ASCII file names are properly handled. - #+set-utf8-locale + #+(set-utf8-locale profile) (define tar #+(file-append archiver "/bin/tar")) - ;; Note: there is not much to gain here with deduplication and there - ;; is the overhead of the '.links' directory, so turn it off. - ;; Furthermore GNU tar < 1.30 sometimes fails to extract tarballs - ;; with hard links: - ;; <http://lists.gnu.org/archive/html/bug-tar/2017-11/msg00009.html>. - (populate-store (list "profile") %root #:deduplicate? #f) + (define %root (if #$localstatedir? "." #$root)) - (when #+localstatedir? - (install-database-and-gc-roots %root #+database #$profile - #:profile-name #$profile-name)) + (when #$localstatedir? + ;; Fix the permission of the Guix database file, which was made + ;; read-only when copied to the store in populate-profile-root. + (copy-recursively #$root %root) + (chmod (string-append %root "/var/guix/db/db.sqlite") #o644)) - ;; Create SYMLINKS. - (for-each (cut evaluate-populate-directive <> %root) - directives) - - ;; Create the tarball. (with-directory-excursion %root ;; GNU Tar recurses directories by default. Simply add the whole - ;; current directory, which contains all the generated files so far. + ;; current directory, which contains all the files to be archived. ;; This avoids creating duplicate files in the archives that would ;; be stored as hard links by GNU Tar. (apply invoke tar "-cvf" #$output "." @@ -326,17 +366,16 @@ (define* (self-contained-tarball name profile (warning (G_ "entry point not supported in the '~a' format~%") 'tarball)) - (gexp->derivation - (string-append name ".tar" - (compressor-extension compressor)) - (self-contained-tarball/builder profile - #:profile-name profile-name - #:compressor compressor - #:localstatedir? localstatedir? - #:symlinks symlinks - #:archiver archiver) - #:target target - #:references-graphs `(("profile" ,profile)))) + (gexp->derivation (string-append name ".tar" + (compressor-extension compressor)) + (self-contained-tarball/builder profile + #:profile-name profile-name + #:target target + #:localstatedir? localstatedir? + #:deduplicate? deduplicate? + #:symlinks symlinks + #:compressor compressor + #:archiver archiver))) ;;; @@ -682,18 +721,19 @@ (define %valid-compressors '("gzip" "xz" "none")) 'deb)) (define data-tarball - (computed-file (string-append "data.tar" - (compressor-extension compressor)) - (self-contained-tarball/builder - profile - #:profile-name profile-name - #:compressor compressor - #:localstatedir? localstatedir? - #:symlinks symlinks - #:archiver archiver) - #:local-build? #f ;allow offloading - #:options (list #:references-graphs `(("profile" ,profile)) - #:target target))) + (computed-file (string-append "data.tar" (compressor-extension + compressor)) + (self-contained-tarball/builder profile + #:target target + #:profile-name profile-name + #:localstatedir? localstatedir? + #:deduplicate? deduplicate? + #:symlinks symlinks + #:compressor compressor + #:archiver archiver) + #:local-build? #f ;allow offloading + #:options (list #:references-graphs `(("profile" ,profile)) + #:target target))) (define build (with-extensions (list guile-gcrypt) @@ -821,10 +861,7 @@ (define tar (string-append #+archiver "/bin/tar")) "debian-binary" control-tarball-file-name data-tarball-file-name))))) - (gexp->derivation (string-append name ".deb") - build - #:target target - #:references-graphs `(("profile" ,profile)))) + (gexp->derivation (string-append name ".deb") build)) ;;; -- 2.39.1
guix-patches@HIDDEN
:bug#61255
; Package guix-patches
.
Full text available.Received: (at 61255) by debbugs.gnu.org; 3 Feb 2023 22:14:46 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 03 17:14:46 2023 Received: from localhost ([127.0.0.1]:40085 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pO4KU-000568-BI for submit <at> debbugs.gnu.org; Fri, 03 Feb 2023 17:14:46 -0500 Received: from mail-qt1-f170.google.com ([209.85.160.170]:36637) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <maxim.cournoyer@HIDDEN>) id 1pO4KT-00055i-E4 for 61255 <at> debbugs.gnu.org; Fri, 03 Feb 2023 17:14:45 -0500 Received: by mail-qt1-f170.google.com with SMTP id v17so7212336qto.3 for <61255 <at> debbugs.gnu.org>; Fri, 03 Feb 2023 14:14:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xQS4RW5wFrSHX9yMXC8lYRY4WpyKl/1oiJPePVM5oMY=; b=W5m4nQ9FGKWtSoolKohnyBRP8CcNNXplsLkKHb4Dr/srbuSfeASJ2EpX6kKjEHOozd 4scnkbuYrFXevfkSOjNRKcIkKmCo/PRS81YLcISaOimiX5/gV7a2t9WN9+g8cpPrEuvG 3689f8bsoVARamXBUcB9O2x/WWm3XKJ8ezJQFWooi/U+SbIf+R6PTDjH7Kd8dtUW6d2V DSYv5pCHVG1YzKToMpwSTb+guNE7SaO9VkCi8gObPyNZw0CChaCEXtQUUdtz8UVVEWHS C/4HI6CDkzWrJo0s1de0LaKgN6EL8iF55lHZ8cH1LkdEJyyvwcMxJo8DPTyuknR9TsJT 7z3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xQS4RW5wFrSHX9yMXC8lYRY4WpyKl/1oiJPePVM5oMY=; b=og9VTcvCUFEav5dTUiYnYqXrNtRXBWlQ6WyN6hu1rdV5ZsGAMO9A+keLWBdfV5isdv 2+W2NIwbBvt4fbVnRS36B++OqtHiZC/0NuZz3I+1rGp7mjhJXbzrTznkef4CZtooSypK aIh8TvEgBJFBlEkBdsj9ciCB0F8ha2imTFAYbOfIHIlUuNrlV4Nq6LZdR81XsP96sAEM Nms4uDsS+DUXPhaE4KOmlkHSpNzqxDG64yR5ZCn1U3Cy7FDhRwH8vRMg3CY2TJGxZYDB Zzh/FwO4YrJwScMIvJ50/XkMgp/50L/beLrsyWnJOrrtvHVKt4P4RDCxPPE9qOaqhLF+ bGow== X-Gm-Message-State: AO0yUKVU6B9tEy0iUnMr/0USQvwVe1moQwnk/op+LmFtenNr8v9pQYbZ hpOzb551f6zEu1Wup1rcqjlmYGdZQJs= X-Google-Smtp-Source: AK7set+1fyJXpVUzvvYkEKOfPJVl1rdnDeq9/Dqfz5EuvcGI9wHZoOkID7iRTHuR13sVqM/ZC++KDA== X-Received: by 2002:a05:622a:588:b0:3b8:2edf:33a1 with SMTP id c8-20020a05622a058800b003b82edf33a1mr23034167qtb.6.1675462479778; Fri, 03 Feb 2023 14:14:39 -0800 (PST) Received: from localhost.localdomain (dsl-10-136-177.b2b2c.ca. [72.10.136.177]) by smtp.gmail.com with ESMTPSA id bp41-20020a05620a45a900b00725d8d6983asm1430594qkb.61.2023.02.03.14.14.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Feb 2023 14:14:39 -0800 (PST) From: Maxim Cournoyer <maxim.cournoyer@HIDDEN> To: 61255 <at> debbugs.gnu.org Subject: [PATCH 2/5] gexp: computed-file: Honor %guile-for-build. Date: Fri, 3 Feb 2023 17:14:05 -0500 Message-Id: <20230203221409.15886-3-maxim.cournoyer@HIDDEN> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230203221409.15886-2-maxim.cournoyer@HIDDEN> References: <20230203221409.15886-2-maxim.cournoyer@HIDDEN> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61255 Cc: Josselin Poiret <dev@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Maxim Cournoyer <maxim.cournoyer@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>, Christopher Baines <mail@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) * guix/gexp.scm (computed-file): Set the default value of the #:guile argument to that of the %guile-for-build parameter. --- guix/gexp.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/guix/gexp.scm b/guix/gexp.scm index 5f92174a2c..bf75d1f8df 100644 --- a/guix/gexp.scm +++ b/guix/gexp.scm @@ -584,7 +584,8 @@ (define-record-type <computed-file> (options computed-file-options)) ;list of arguments (define* (computed-file name gexp - #:key guile (local-build? #t) (options '())) + #:key (guile (%guile-for-build)) + (local-build? #t) (options '())) "Return an object representing the store item NAME, a file or directory computed by GEXP. When LOCAL-BUILD? is #t (the default), it ensures the corresponding derivation is built locally. OPTIONS may be used to pass -- 2.39.1
guix-patches@HIDDEN
:bug#61255
; Package guix-patches
.
Full text available.Received: (at 61255) by debbugs.gnu.org; 3 Feb 2023 22:14:44 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 03 17:14:44 2023 Received: from localhost ([127.0.0.1]:40082 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pO4KS-00055s-0p for submit <at> debbugs.gnu.org; Fri, 03 Feb 2023 17:14:44 -0500 Received: from mail-qt1-f175.google.com ([209.85.160.175]:33477) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <maxim.cournoyer@HIDDEN>) id 1pO4KP-00055d-Ol for 61255 <at> debbugs.gnu.org; Fri, 03 Feb 2023 17:14:42 -0500 Received: by mail-qt1-f175.google.com with SMTP id h24so7264978qtr.0 for <61255 <at> debbugs.gnu.org>; Fri, 03 Feb 2023 14:14:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=1tCEe77lSi5a/2D2uDeKtzZK4rdgFepvO/vGfX1i2Zw=; b=abydkFdY24dNgWn30IjQFyUvoKal7KAUebq5+22vKpRS3cr+inlB2DGJm/F5TQDZIM buWiyoREJIUoQ7iau32c6pqUnd5jOxE1wM5jL2gK6OYe0bCLA7wU1MA4SdLU7z/Jalyb dwdqCG9jo8d03s8OUMBv6RXKhNYJG9V/C4o3/K7NuzrbVPkzqsgn3gMKfTJKegki3F1e RYizsMYqDDbX8NLjF6evFiS6KR1iDGzUe+TsXPVZY4V26PiQe9PK/81wQ7UfQKG5rRu3 gJQjyxydX68Xnb5SFMbRkXbK4dXZ/hLpJxoFRZLPKNK2qOWn/VhIVailAILDmqyYO//x 3U5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=1tCEe77lSi5a/2D2uDeKtzZK4rdgFepvO/vGfX1i2Zw=; b=dVLbJukN/5zf/cxcFRuJLwAgNxuWE1gOvsjE4/uaeZiezz3MZRgFNyXUy0952cOro4 BqRIMDRJ/t6kyAumkedPDgbz8rSjjNTSHIULBaW1jCu1P2Rr9x5/GcSqlY7Kotxm78u9 VSQb82cGNVDtFsE8QcWmXq1NUMT8b6qTQgDYd8X4TQKu7K7FrgYjItmAypnuE4HiPPqO +yz3w+nX0iwSlz3upLk0nzICCo4MGOgEj9Q1V854X8juXQ9Pj4wVPPbA/mxL4R/N6409 A/aTTf9OQGmV1TrKm3VLcclj6NWHlBKjr/K9H3kkT9A/LvHTxlh5BUd9wGHYh1pvbD57 ogdQ== X-Gm-Message-State: AO0yUKXjzNJXlqXutqlrnDlieB6mLuOQ4mxszGbRXqbLSfC6pTH0tgel VLItr2GOwgoHfwHPYOObOkDmh7HSLcE= X-Google-Smtp-Source: AK7set83iyQ21mQhRtUAxzcB/k5XHhp1rSXyXEzRMIFM2kdXRPn1kP+PzVxK82V15Tuw0yu9m7Y1NA== X-Received: by 2002:ac8:5e10:0:b0:3b9:a60f:b2bb with SMTP id h16-20020ac85e10000000b003b9a60fb2bbmr22531074qtx.56.1675462475943; Fri, 03 Feb 2023 14:14:35 -0800 (PST) Received: from localhost.localdomain (dsl-10-136-177.b2b2c.ca. [72.10.136.177]) by smtp.gmail.com with ESMTPSA id bp41-20020a05620a45a900b00725d8d6983asm1430594qkb.61.2023.02.03.14.14.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Feb 2023 14:14:35 -0800 (PST) From: Maxim Cournoyer <maxim.cournoyer@HIDDEN> To: 61255 <at> debbugs.gnu.org Subject: [PATCH 1/5] pack: Extract keyword-ref procedure from debian-archive. Date: Fri, 3 Feb 2023 17:14:04 -0500 Message-Id: <20230203221409.15886-2-maxim.cournoyer@HIDDEN> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61255 Cc: Josselin Poiret <dev@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>, Maxim Cournoyer <maxim.cournoyer@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@HIDDEN>, Christopher Baines <mail@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Rationale: the upcoming rpm-archive builder will also use it. * guix/scripts/pack.scm: (keyword-ref): New top-level procedure, extracted from... (debian-archive): ... here. Adjust usages accordingly. --- guix/scripts/pack.scm | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm index f65642fb85..7e466a2be7 100644 --- a/guix/scripts/pack.scm +++ b/guix/scripts/pack.scm @@ -194,6 +194,12 @@ (define (symlink-spec-option-parser opt name arg result) (leave (G_ "~a: invalid symlink specification~%") arg)))) +(define (keyword-ref lst keyword) + "Return the value of KEYWORD in LST, else #f." + (match (memq keyword lst) + ((_ value . _) value) + (#f #f))) + ;;; ;;; Tarball format. @@ -762,20 +768,15 @@ (define data-tarball-file-name (strip-store-file-name (copy-file #+data-tarball data-tarball-file-name) - (define (keyword-ref lst keyword) - (match (memq keyword lst) - ((_ value . _) value) - (#f #f))) - ;; Generate the control archive. (define control-file - (keyword-ref '#$extra-options #:control-file)) + #$(keyword-ref `(,@extra-options) #:control-file)) (define postinst-file - (keyword-ref '#$extra-options #:postinst-file)) + #$(keyword-ref `(,@extra-options) #:postinst-file)) (define triggers-file - (keyword-ref '#$extra-options #:triggers-file)) + #$(keyword-ref `(,@extra-options) #:triggers-file)) (define control-tarball-file-name (string-append "control.tar" -- 2.39.1
guix-patches@HIDDEN
:bug#61255
; Package guix-patches
.
Full text available.Received: (at submit) by debbugs.gnu.org; 3 Feb 2023 16:19:50 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 03 11:19:50 2023 Received: from localhost ([127.0.0.1]:39853 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1pNymz-0004T0-OY for submit <at> debbugs.gnu.org; Fri, 03 Feb 2023 11:19:50 -0500 Received: from lists.gnu.org ([209.51.188.17]:32812) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <maxim.cournoyer@HIDDEN>) id 1pNymw-0004Sq-Dy for submit <at> debbugs.gnu.org; Fri, 03 Feb 2023 11:19:47 -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 <maxim.cournoyer@HIDDEN>) id 1pNymw-0003ha-7z for guix-patches@HIDDEN; Fri, 03 Feb 2023 11:19:46 -0500 Received: from mail-qv1-xf34.google.com ([2607:f8b0:4864:20::f34]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <maxim.cournoyer@HIDDEN>) id 1pNymu-0004TM-Sz for guix-patches@HIDDEN; Fri, 03 Feb 2023 11:19:46 -0500 Received: by mail-qv1-xf34.google.com with SMTP id e19so3132566qvw.13 for <guix-patches@HIDDEN>; Fri, 03 Feb 2023 08:19:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ia3uWM/AKd3vhEqox1/sgaLPuPGiyan9BIXhFgfyrfM=; b=lsOKmf+2yCmtdyXpAa5WDPLF3qME8q9FJHlPrfzfam9FM39d2HB0cQ3UJM/081BbhL f5/Sy0CHzZKL7KBX0/E4NSSl93BpCThIHApXNK8FSTqTl3z89HiiFwo05psk71KuOCw/ 0jO+EH/WGgYc4u8w1//lc9oDzPJoFQ9GY5njy1OEuSB+vGMyA13ahliT5aioqKsVm2xD Vw8ZKOd/FH7u+o2ejGoimwd12Vour4l8Zft/MsZkY0fh0ry3UWZ7IW+gB2wHbaevRYo6 B1Lu3l7wITGRpQuERmf7onDa30IZ/bCMRVhrDWmOrPbArk1Jq1F/w+ldjfo3rJPVDZCI EEmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ia3uWM/AKd3vhEqox1/sgaLPuPGiyan9BIXhFgfyrfM=; b=im8iXOF9QBIskxvCUEm87OY+QvFm1MCray6Ic4C5Ls+qtRwruC5lnSHwnLJ7pfihIE 1b+QYvhaEFlNA/nK6Yh2xCQtfQG5rqZupYF3td4Rxo1iG+ETJhRUURSI0Tn0eT6y6UbR D3d8/uv5HW0Sd7PaXwFs8ELqPhOOPrYWrQ0r67tL1FkAg/QBW1X5uCzcvIbkFCQIzQV8 i+PPWYW+OO18aIxhFWZ6KX1ZuKqKA927Uui4k/lAqjls/mzk7AhTCIP0nnaChyUVCb5E tHiul03MSVsBfcjDfXtEJEty8sN1WFJM9MG0N/716qe2FkrUBnznJf7F57xA2lU1qnnR 7NlA== X-Gm-Message-State: AO0yUKWnYvX1IJ6JDjMGUUptPffxszmSqQbN22r+hAvJw3Hv8xJo9HNJ X30RZVxqke1iegp5mIPzLczzpcGiivnbUQ== X-Google-Smtp-Source: AK7set9WI7AqJYVjK3yEEvazblRG+VblNOb80tsNgZZfreZIjTBkGlUoT1eiL2pPscZR/8pwP4MKaw== X-Received: by 2002:a05:6214:234b:b0:568:f263:1c0c with SMTP id hu11-20020a056214234b00b00568f2631c0cmr4474069qvb.21.1675441183086; Fri, 03 Feb 2023 08:19:43 -0800 (PST) Received: from localhost.localdomain ([204.48.94.38]) by smtp.gmail.com with ESMTPSA id dw28-20020a05620a601c00b00728bbe45888sm2105632qkb.10.2023.02.03.08.19.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Feb 2023 08:19:42 -0800 (PST) From: Maxim Cournoyer <maxim.cournoyer@HIDDEN> To: guix-patches@HIDDEN Subject: [PATCH 0/5] Add support for the RPM format to "guix pack" Date: Fri, 3 Feb 2023 11:19:26 -0500 Message-Id: <20230203161926.26886-1-maxim.cournoyer@HIDDEN> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::f34; envelope-from=maxim.cournoyer@HIDDEN; helo=mail-qv1-xf34.google.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: Maxim Cournoyer <maxim.cournoyer@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -2.3 (--) Hello Guix! This series adds support for the RPM format to "guix pack", so that one can generate an RPM archive via e.g. "guix pack -f rpm hello", and install it on their favorite RPM-based GNU/Linux distribution. With the exception of the payload compression, the generation of the archive is fully handled in Scheme, which ended up being tricky, with the documentation about the RPM binary format being scarce. Most of the problems encountered were figured out stepping an 'rpm' command invocation in GDB, which felt a bit like reverse engineering! Anyway, the end result appears to work well and has few dependencies (compared to using 'rpmbuild', as most other projects do), so I think it was worth the effort. Thanks! Maxim Cournoyer (5): pack: Extract keyword-ref procedure from debian-archive. gexp: computed-file: Honor %guile-for-build. pack: Extract populate-profile-root from self-contained-tarball/builder. tests: pack: Fix indentation. pack: Add RPM format. Makefile.am | 2 + doc/guix.texi | 45 +++- guix/gexp.scm | 3 +- guix/rpm.scm | 577 ++++++++++++++++++++++++++++++++++++++++++ guix/scripts/pack.scm | 478 +++++++++++++++++++++++++--------- tests/pack.scm | 331 ++++++++++++++---------- tests/rpm.scm | 86 +++++++ 7 files changed, 1258 insertions(+), 264 deletions(-) create mode 100644 guix/rpm.scm create mode 100644 tests/rpm.scm base-commit: a60c750eec73a2030b08b32af3b9f435c7ecca54 -- 2.39.1
Maxim Cournoyer <maxim.cournoyer@HIDDEN>
:guix-patches@HIDDEN
.
Full text available.guix-patches@HIDDEN
:bug#61255
; Package guix-patches
.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.