unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: zimoun <zimon.toutoune@gmail.com>
To: jeremy@korwin-zmijowski.fr, Josselin Poiret <dev@jpoiret.xyz>
Cc: 28510@debbugs.gnu.org, Maxime Devos <maximedevos@telenet.be>
Subject: bug#28510: crash: guix build -S foo --with-source=bla
Date: Sat, 08 Oct 2022 15:52:46 +0200	[thread overview]
Message-ID: <86mta6tob5.fsf@gmail.com> (raw)
In-Reply-To: <565ee080af7ef230e1c769bcfed440c2@korwin-zmijowski.fr>

Hi Jérémy,

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 
> pass.
> As the test checks the behaviour, it will let enough space to change 
> 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: <https://yhetil.org/guix/87k05y2yjc.fsf@jpoiret.xyz>

>
>   (delete-dummy-definition))
>
> (test-end "scripts")


Cheers,
simon




      reply	other threads:[~2022-10-08 15:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-19 12:09 bug#28510: crash: guix build -S foo --with-source=bla Ricardo Wurmus
2021-02-25  0:34 ` zimoun
2022-09-19 17:38 ` Jérémy Korwin-Zmijowski
2022-09-19 18:44   ` Maxime Devos
2022-09-20  9:19     ` Josselin Poiret via Bug reports for GNU Guix
2022-09-20 17:25       ` zimoun
2022-09-20 19:42         ` Josselin Poiret via Bug reports for GNU Guix
2022-10-07  8:41           ` jeremy
2022-10-08 13:52             ` zimoun [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86mta6tob5.fsf@gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=28510@debbugs.gnu.org \
    --cc=dev@jpoiret.xyz \
    --cc=jeremy@korwin-zmijowski.fr \
    --cc=maximedevos@telenet.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).