From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id eNBoEvJLe18wJAAA0tVLHw (envelope-from ) for ; Mon, 05 Oct 2020 16:38:10 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id MBU5DvJLe19rJgAA1q6Kng (envelope-from ) for ; Mon, 05 Oct 2020 16:38:10 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2D7E6940390 for ; Mon, 5 Oct 2020 16:38:09 +0000 (UTC) Received: from localhost ([::1]:60070 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPTV1-0000ef-Kz for larch@yhetil.org; Mon, 05 Oct 2020 12:38:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42432) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPTT0-0006l8-T9 for guix-patches@gnu.org; Mon, 05 Oct 2020 12:36:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:38815) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kPTT0-0007uT-Ip for guix-patches@gnu.org; Mon, 05 Oct 2020 12:36:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kPTT0-00055V-FZ for guix-patches@gnu.org; Mon, 05 Oct 2020 12:36:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#43817] [PATCH 0/1] guix: build: hg: Add 'guard' to handle error. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 05 Oct 2020 16:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 43817 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 43817@debbugs.gnu.org Cc: zimoun X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.160191576119548 (code B ref -1); Mon, 05 Oct 2020 16:36:02 +0000 Received: (at submit) by debbugs.gnu.org; 5 Oct 2020 16:36:01 +0000 Received: from localhost ([127.0.0.1]:50361 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kPTSz-00055E-1e for submit@debbugs.gnu.org; Mon, 05 Oct 2020 12:36:01 -0400 Received: from lists.gnu.org ([209.51.188.17]:43176) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kPTSw-000554-Q2 for submit@debbugs.gnu.org; Mon, 05 Oct 2020 12:35:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42410) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPTSw-0006eo-HL for guix-patches@gnu.org; Mon, 05 Oct 2020 12:35:58 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:40061) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kPTSu-0007u6-Fe for guix-patches@gnu.org; Mon, 05 Oct 2020 12:35:58 -0400 Received: by mail-wm1-x32e.google.com with SMTP id k18so149349wmj.5 for ; Mon, 05 Oct 2020 09:35:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Boo13KL6sNeMJCxJCaQvizoTbczbEy8m3m+lxYVMH/o=; b=QfoX5dN2iH2K2eDa8un38ElY1cBYivASHqzj9GaQZU2ECPgXLKRGVbOnR4+0UNG8tU X7sBJ0JsTG+Ok5c8Ld1T8VHuqLKkA8Zb2ZiRBE0Pt2/BwvxJsUkbuM+5E69EHI3oBAgK 0g2WloXMW2ZC0XPiD+0XqHTNcS06VLNyFiAQLRmHx3Dtv4dA6gZJ11yxow4EECb2GQ5K 4uQUdN5Q8qUYOoAn3+bzePmQTby+tFEQcEY+WqahXsDJqqdsfW2xiUZrzK3CXmfTWkg4 DQjRvMNJDQAR6T5nzHGHXQEaJ2FVzHs8jIYZo96NTPtU2PasiJTUGRYH3O3vbdwBcSEN YqKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Boo13KL6sNeMJCxJCaQvizoTbczbEy8m3m+lxYVMH/o=; b=iypjoANFUIttp0ih7ZMuheShWTrzgZCBGdBpV/uEtX8O8Fp6JqqRTkgdK5wfPt7zc1 N3NM0CAyaIrI2Z+K/87dNRgIjnar46CHvdqvNNz/jloTvE4NMrz3Bz+y0i16mvHxm6TE ljKOBCMNQnv2CbN0YZXI/+UC+erfMmVnP/ngrTZta+lYU14bdXoAvn+Z0clmmPPDxe7E 3M9ZxMjQQAyriy8tAFYItnQNskG7HEo4Aez+N9+/mz92iM4jz4ST5jbfSLFihp6bE0y5 q/CD1oGgGnlb/8CgWPO4rnlHkTqph+rbCFrj1O6Ms9UbYGb85zkw/l4KQRX8kadAWTdV E3pw== X-Gm-Message-State: AOAM533gXYoThjCxRtAmFT7lQrPg0HoEnfnnEdREgxrnfMg0rvVFPhJq yMkfoLVD03qwOp7TY9SruBeSWIeAF6B7bw== X-Google-Smtp-Source: ABdhPJxwkhQoQVKtjypjNLDA68ASZmd8QH0w6dcAJLS8dPZxhNXSRqDp2/MG91JD3zWOpcmqJtwxow== X-Received: by 2002:a1c:5406:: with SMTP id i6mr232782wmb.5.1601915754535; Mon, 05 Oct 2020 09:35:54 -0700 (PDT) Received: from pfiuh02.univ-paris-diderot.fr ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id v9sm143079wmh.23.2020.10.05.09.35.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Oct 2020 09:35:53 -0700 (PDT) From: zimoun Date: Mon, 5 Oct 2020 18:35:44 +0200 Message-Id: <20201005163544.3947-1-zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=zimon.toutoune@gmail.com; helo=mail-wm1-x32e.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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: 0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -2.3 (--) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=QfoX5dN2; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: 4.09 X-TUID: TbjhlWagBv/C Dear, This patch allows to gently report failure with 'hg clone'. For example, let consider the package using 'hg-fetch': --8<---------------cut here---------------start------------->8--- (define-module (hello) #:use-module (guix packages) #:use-module (gnu packages base) #:use-module (guix hg-download)) (define-public hi-hg (package (inherit hello) (name "hi-hg") (source (origin (method hg-fetch) (uri (hg-reference (url "https://example.org/hg") (changeset "314a11282586"))) (sha256 (base32 "1yb0rsrbjg2bwyhfk677crhw0k7ijm6slaq0qq7cd4lznlz2yvji")))) (home-page "https://example.org/hg"))) --8<---------------cut here---------------end--------------->8--- Then, the current behaviour report an (opinionated: ugly!) backtrace: --8<---------------cut here---------------start------------->8--- $ guix build -L /tmp/foo/ hi-hg The following derivations will be built: /gnu/store/awdr7qhl6hyjgr1m9a40zfnban9ip98x-hi-hg-2.10.drv /gnu/store/bgdwj7ajkm9xwcyib83wpby1zb9l8si2-hg-checkout.drv building /gnu/store/bgdwj7ajkm9xwcyib83wpby1zb9l8si2-hg-checkout.drv... guile: warning: failed to install locale warning: connection security to example.org is disabled per current settings; communication is susceptible to eavesdropping and tampering abort: HTTP Error 404: Not Found Backtrace: 3 (primitive-load "/gnu/store/rf02zx0dscns2bzzics9i93l1xm?") In ice-9/eval.scm: 293:34 2 (_ #) In guix/build/hg.scm: 38:2 1 (hg-fetch "https://example.org/hg" "314a11282586" "/gn?" ?) In guix/build/utils.scm: 654:6 0 (invoke _ . _) guix/build/utils.scm:654:6: In procedure invoke: ERROR: 1. &invoke-error: program: "/gnu/store/0qx1yjfnjn77jag9rmv4z49vfrzk5bgc-mercurial-5.5.1/bin/hg" arguments: ("clone" "https://example.org/hg" "--rev" "314a11282586" "--insecure" "/gnu/store/6x6hccx9cqpfrcav79inl43ys6frgvw2-hg-checkout") exit-status: 255 term-signal: #f stop-signal: #f builder for `/gnu/store/bgdwj7ajkm9xwcyib83wpby1zb9l8si2-hg-checkout.drv' failed with exit code 1 build of /gnu/store/bgdwj7ajkm9xwcyib83wpby1zb9l8si2-hg-checkout.drv failed View build log at '/var/log/guix/drvs/bg/dwj7ajkm9xwcyib83wpby1zb9l8si2-hg-checkout.drv.bz2'. cannot build derivation `/gnu/store/awdr7qhl6hyjgr1m9a40zfnban9ip98x-hi-hg-2.10.drv': 1 dependencies couldn't be built guix build: error: build of `/gnu/store/awdr7qhl6hyjgr1m9a40zfnban9ip98x-hi-hg-2.10.drv' failed --8<---------------cut here---------------end--------------->8--- Instead, the proposing patch handles the error and reports: --8<---------------cut here---------------start------------->8--- $ ./pre-inst-env guix build -L /tmp/foo/ hi-hg The following derivations will be built: /gnu/store/zam0r6fvyp9qkzp6kf087iifvnhw140n-hi-hg-2.10.drv /gnu/store/z4y6xhnaipx0p7sx4ink0bll9i7rww87-hg-checkout.drv building /gnu/store/z4y6xhnaipx0p7sx4ink0bll9i7rww87-hg-checkout.drv... guile: warning: failed to install locale warning: connection security to example.org is disabled per current settings; communication is susceptible to eavesdropping and tampering abort: HTTP Error 404: Not Found hg-fetch: '/gnu/store/0qx1yjfnjn77jag9rmv4z49vfrzk5bgc-mercurial-5.5.1/bin/hg clone https://example.org/hg --rev 314a11282586 --insecure /gnu/store/6x6hccx9cqpfrcav79inl43ys6frgvw2-hg-checkout' failed with exit code 255 Trying content-addressed mirror at berlin.guix.gnu.org... Trying content-addressed mirror at berlin.guix.gnu.org... builder for `/gnu/store/z4y6xhnaipx0p7sx4ink0bll9i7rww87-hg-checkout.drv' failed to produce output path `/gnu/store/6x6hccx9cqpfrcav79inl43ys6frgvw2-hg-checkout' build of /gnu/store/z4y6xhnaipx0p7sx4ink0bll9i7rww87-hg-checkout.drv failed View build log at '/var/log/guix/drvs/z4/y6xhnaipx0p7sx4ink0bll9i7rww87-hg-checkout.drv.bz2'. cannot build derivation `/gnu/store/zam0r6fvyp9qkzp6kf087iifvnhw140n-hi-hg-2.10.drv': 1 dependencies couldn't be built guix build: error: build of `/gnu/store/zam0r6fvyp9qkzp6kf087iifvnhw140n-hi-hg-2.10.drv' failed --8<---------------cut here---------------end--------------->8--- (Note: the code is highly copied from guix/build/git.scm. :-)) All the best, simon zimoun (1): guix: build: hg: Add 'guard' to handle error. guix/build/hg.scm | 50 +++++++++++++++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 17 deletions(-) base-commit: 2b73e50c31a61b5dcef35a1e4b9484d9dbcb0fbc -- 2.28.0