From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 08 11:16:48 2022 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 To: jeremy@korwin-zmijowski.fr, Josselin Poiret Subject: Re: bug#28510: crash: guix build -S foo --with-source=bla 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-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 28510 Cc: 28510@debbugs.gnu.org, Maxime Devos X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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