From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id yH1CJ3+UQWOvBgEAbAwnHQ (envelope-from ) for ; Sat, 08 Oct 2022 17:17:19 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id CHlIJ3+UQWOM8gAA9RJhRA (envelope-from ) for ; Sat, 08 Oct 2022 17:17:19 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 61B1C2F6D2 for ; Sat, 8 Oct 2022 17:17:19 +0200 (CEST) Received: from localhost ([::1]:48678 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ohBZm-0003x2-Dx for larch@yhetil.org; Sat, 08 Oct 2022 11:17:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41616) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ohBZY-0003oh-MB for bug-guix@gnu.org; Sat, 08 Oct 2022 11:17:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42133) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ohBZY-0004n4-1H for bug-guix@gnu.org; Sat, 08 Oct 2022 11:17:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ohBZX-00043N-Qw for bug-guix@gnu.org; Sat, 08 Oct 2022 11:17:03 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#28510: crash: guix build -S foo --with-source=bla Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 08 Oct 2022 15:17:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28510 X-GNU-PR-Package: guix X-GNU-PR-Keywords: easy To: jeremy@korwin-zmijowski.fr, Josselin Poiret Cc: 28510@debbugs.gnu.org, Maxime Devos Received: via spool by 28510-submit@debbugs.gnu.org id=B28510.166524220815422 (code B ref 28510); Sat, 08 Oct 2022 15:17:03 +0000 Received: (at 28510) by debbugs.gnu.org; 8 Oct 2022 15:16:48 +0000 Received: from localhost ([127.0.0.1]:41182 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ohBZH-00040f-P6 for submit@debbugs.gnu.org; Sat, 08 Oct 2022 11:16:48 -0400 Received: from mail-wr1-f54.google.com ([209.85.221.54]:34367) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ohBZC-00040I-IQ for 28510@debbugs.gnu.org; Sat, 08 Oct 2022 11:16:46 -0400 Received: by mail-wr1-f54.google.com with SMTP id b4so11166916wrs.1 for <28510@debbugs.gnu.org>; Sat, 08 Oct 2022 08:16:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=0kaViFz3Fw4ms7uOqOrNNNReBdrAy4J0PMzqmpqfDY8=; b=KPtc4xXtcUp9o5VFbqwru4vxY123aSgZenmXxSQ1CBO2u+YFhTg4MHu1jDrzx54Bgj putDjg1VrcEwETOTybVwfCBNtBOYDu0BfM7hu08vst89uTVgBOd9ZthbAqZjE4os6JeI qSaSFMLNCVqx2UW9eGso4yqjlcfLLiZ7AY5YUMZ2wKf9G8FhUyrKr1aSZMo0GmJT93yx B+iyB40S2nvZevGX2pQojLM0Vla9jFCE4lSv+GY2SMKdXXMlXRv4RzdIpLu3udHYj0fK ubsS0dWxV4Q9tCQp58wkItTdEHweEHMRuIY17JFfFkvxBSvM1SjqFjNhPKaX3wT6BXNm R5Nw== 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:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0kaViFz3Fw4ms7uOqOrNNNReBdrAy4J0PMzqmpqfDY8=; b=2Oz6b7hRLttHpbWYeOASxepYunsXSiObSt4mrowDd3GxdDFjx3At8MX9uwrxHLuQA7 MYQwj1QfLu7tFcBZ3OAUeSXJaMpFcakTxd0U/KOKoJc1JAMKh0hHNrLIHQ/OUmFFH1pZ nh8FSoW2yHfJ9lrwWp5ug29Y/+5JLJcNj0Fbjo15rhtlTc/H69rdqnWGKnhwvKRc5MGJ 1wxYmF4DaJKu+H/3t91tuxdTp/sDXMPxSqRyxLUblWbrvOF7WUz7kMUAkv0BRegiEgkE Ribd1tbfuGw86/gN7vtgUzAr+oS3ECC3l68nhKZa8Sn6e01SMp9ij6ZwjAKXHKgPYHo7 O+qA== X-Gm-Message-State: ACrzQf2twfeXibNkXT+tQ5XCh+t+RG1vNNJDupb1ztlnfNGifh/LCZJH ggZqu2fF+zOuOgLipa6/CR8= X-Google-Smtp-Source: AMsMyM5U9dnNMb9Ohwbw8XxaMf8xUIMu3v3j4R5po8mf/GS0r4y/nVBRHYr4vsVkhb93qNisxrem3g== X-Received: by 2002:a05:6000:1886:b0:22e:3921:fdc2 with SMTP id a6-20020a056000188600b0022e3921fdc2mr6408429wri.565.1665242196517; Sat, 08 Oct 2022 08:16:36 -0700 (PDT) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id h4-20020a05600c350400b003c1a7ea3736sm6438715wmq.11.2022.10.08.08.16.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Oct 2022 08:16:35 -0700 (PDT) From: zimoun In-Reply-To: <565ee080af7ef230e1c769bcfed440c2@korwin-zmijowski.fr> References: <229c1399-ce4b-b942-1bae-deea501f1c48@telenet.be> <87k05y2yjc.fsf@jpoiret.xyz> <86a66u0xhr.fsf@gmail.com> <87h7113k9a.fsf@jpoiret.xyz> <565ee080af7ef230e1c769bcfed440c2@korwin-zmijowski.fr> Date: Sat, 08 Oct 2022 15:52:46 +0200 Message-ID: <86mta6tob5.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1665242239; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=0kaViFz3Fw4ms7uOqOrNNNReBdrAy4J0PMzqmpqfDY8=; b=i25lzHCu5AvZfZsv0Z4Dj5Rz+7fyT7TDp1Bz/uoEg+zL/J9+++Mn/p2WT+O6+fhtNyFokZ iJaVcmGmKcO9ROP6MIm2xW2PFWZyUI1KdSXv8KLjGpgTrOHJi1qiN0vfjF5mODuYKnleHV xecijwkqwMMjWbQi1yG+z8lSEDkeDfXGww58JzCT3GuiCmDdTV1NVA2QUXlUyof4enDm2u s0zmUdiGjnf4aPfWjmpuDJWHz711vLqiCwD2UfdLprgKHJCGwyNugI6HJUtH5an6qHplzV SnUS4O2XTcECjl661nKgw9FLbttQB5LbwdiEp0K49xZ8T2ykDe7jEMvlp1tD3Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1665242239; a=rsa-sha256; cv=none; b=ZAN6yCmSuoYKrvyvn/RsN/afZYTqNvoa3g3LLEyLrCUdM8OoRdJlvEK2iDIYmmNhSmufpG Y4epGZ58P/uEMjvJqp+1Y1qVnkJ7inwYHffnFMHxmDvwX4iF+1uXyqCC7PB5yqFu58+bua qmNQuatQQw6pxmibW1SoCzsx16E57baTIA5yTXSFpqzZjhqhnHbu5JyZ4Dg2n/Vd9qmJUK AInBP5ZXG0+3LgIJ8sWJ11qeiRdpyIHU/HYMjWR8A0wjq96luDEelBjiwA78TRUD0wNpRh SN8wlvqIc/53JO3E6IZOQi5wDh+pXuDXsUiMdY8HjLVefQ/HSbJcuyETnCVb1Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=KPtc4xXt; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 7.62 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=KPtc4xXt; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 61B1C2F6D2 X-Spam-Score: 7.62 X-Migadu-Scanner: scn1.migadu.com X-TUID: aXq0G8w8bAsI Hi J=C3=A9r=C3=A9my, On Fri, 07 Oct 2022 at 10:41, jeremy@korwin-zmijowski.fr wrote: > I feel not able to take decision about the proper way right now. > So as a step forward I wrote a test to capture the behavior expected. > Please have a look at it as it's the starting point for me. > Next, I can implement the error handler, making the previous test to=20 > pass. > As the test checks the behaviour, it will let enough space to change=20 > implementation later without invalitating the test. Nice to start by the test! :-) > (define-module (tests scripts build) > #:use-module (srfi srfi-64) > #:use-module (ice-9 exceptions) > #:use-module (guix scripts build) > #:use-module (srfi srfi-34)) > > (test-begin "scripts") > > (define DUMMY_DEFINITION_PATH "/tmp/a.scm") > > (define (create-dummy-definition) > (call-with-output-file DUMMY_DEFINITION_PATH > (lambda (port) > (format port > "(use-modules (gnu packages) (guix packages) (guix gexp)) (= package (inherit (specification->package \"hello\")) (source (local-file \"= a.scm\")))")))) > > (define (delete-dummy-definition) > (delete-file DUMMY_DEFINITION_PATH)) > > (test-group-with-cleanup "build" > > (create-dummy-definition) > > (test-equal "package definition as only source" > "/gnu/store/7mnkrg9bmybgyf1dn5n67di6ng6qvhkz-a.scm" > (guard > (ex > ((exception? ex) #f)) > (guix-build "-f" DUMMY_DEFINITION_PATH "--source"))) Well, this test looks good to me. However, I would lower what the procedure under test. For instance, package-source-derivation in guix/packages.scm or show-derivation-outputs, as Josselin pointed [1]. 1: > > (delete-dummy-definition)) > > (test-end "scripts") Cheers, simon