GNU bug report logs -
#28510
crash: guix build -S foo --with-source=bla
Previous Next
Full log
View this message in rfc822 format
Hi Jérémy,
On Fri, 07 Oct 2022 at 10:41, jeremy <at> 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 <at> jpoiret.xyz>
>
> (delete-dummy-definition))
>
> (test-end "scripts")
Cheers,
simon
This bug report was last modified 336 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.