unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Vagrant Cascadian <vagrant@debian.org>
Cc: 44626-done@debbugs.gnu.org
Subject: bug#44626: tests/build-utils, tests/guix-system: fail when build path contains "~"
Date: Tue, 17 Nov 2020 15:29:55 +0100	[thread overview]
Message-ID: <87r1osqcnw.fsf@gnu.org> (raw)
In-Reply-To: <87zh3gr7cy.fsf@yucca> (Vagrant Cascadian's message of "Mon, 16 Nov 2020 19:26:53 -0800")

Hi Vagrant,

Vagrant Cascadian <vagrant@debian.org> skribis:

> Though may introduce a different issue in tests/build-utils.log:
>
> ...
> test-name: wrap-script, simple case
> location: /build/guix-41NMGX/guix-1.2.0~rc1/tests/build-utils.scm:152
> source:
> + (test-equal
> +   "wrap-script, simple case"
> +   (string-append
> +     (format
> +       #f
> +       "#!~a --no-auto-compile\n#!#; Guix wrapper\n#\\-~s\n#\\-~s\n"
> +       (which "guile")
> +       '(begin
> +          (let ((current (getenv "GUIX_FOO")))
> +            (setenv
> +              "GUIX_FOO"
> +              (if current
> +                (string-append
> +                  "/some/path:/some/other/path"
> +                  ":"
> +                  current)
> +                "/some/path:/some/other/path"))))
> +       '(let ((cl (command-line)))
> +          (apply execl
> +                 "/anything/cabbage-bash-1.2.3/bin/sh"
> +                 (car cl)
> +                 (cons (car cl) (append '("") cl)))))
> +     script-contents)
> +   (call-with-temporary-directory
> +     (lambda (directory)
> +       (let ((script-file-name
> +               (string-append directory "/foo")))
> +         (call-with-output-file
> +           script-file-name
> +           (lambda (port) (display script-contents port)))
> +         (chmod script-file-name 511)
> +         (wrap-script
> +           script-file-name
> +           `("GUIX_FOO"
> +             prefix
> +             ("/some/path" "/some/other/path")))
> +         (let ((str (call-with-input-file
> +                      script-file-name
> +                      get-string-all)))
> +           (with-directory-excursion
> +             directory
> +             (delete-file "foo"))
> +           str)))))
> FORMAT: INTERNAL ERROR IN FORMAT-ERROR!
>         destination: #<input-output:
>         /tmp/guix-directory.YrSRbV/foo.3efcPU 8>
>         format string: "#!/build/guix-41NMGX/guix-1.2.0~rc1/guile
>         --no-auto-compile\n#!#; Guix wrapper\n#\\-(begin (let ((current
>         (getenv \"GUIX_FOO\"))) (setenv \"GUIX_FOO\" (if current
>         (string-append \"/some/path:/some/other/path\" \":\" current)
>         \"/some/path:/some/other/path\"))))\n#\\-(let ((cl
>         (command-line))) (apply execl
>         \"/anything/cabbage-bash-1.2.3/bin/sh\" (car cl) (cons (car cl)
>         (append (quote (\"\")) cl))))\n"
>         format args: ()
>         error args:  (#f "error in format" () #f)
> FORMAT: INTERNAL ERROR IN FORMAT-ERROR!
>         destination: #<input-output:
>         /tmp/guix-directory.YrSRbV/foo.3efcPU 8>
>         format string: "#!/build/guix-41NMGX/guix-1.2.0~rc1/guile
>         --no-auto-compile\n#!#; Guix wrapper\n#\\-(begin (let ((current
>         (getenv \"GUIX_FOO\"))) (setenv \"GUIX_FOO\" (if current
>         (string-append \"/some/path:/some/other/path\" \":\" current)
>         \"/some/path:/some/other/path\"))))\n#\\-(let ((cl
>         (command-line))) (apply execl
>         \"/anything/cabbage-bash-1.2.3/bin/sh\" (car cl) (cons (car cl)
>         (append (quote (\"\")) cl))))\n"
>         format args: ()
>         error args:  (#<&wrap-error program:
>         "/tmp/guix-directory.YrSRbV/foo" type: misc-error>)
> expected-value: "#!/build/guix-41NMGX/guix-1.2.0~rc1/guile
> --no-auto-compile\n#!#; Guix wrapper\n#\\-(begin (let ((current (getenv
> \"GUIX_FOO\"))) (setenv \"GUIX_FOO\" (if current (string-append
> \"/some/path:/some/other/path\" \":\" current)
> \"/some/path:/some/other/path\"))))\n#\\-(let ((cl (command-line)))
> (apply execl \"/anything/cabbage-bash-1.2.3/bin/sh\" (car cl) (cons (car
> cl) (append (quote (\"\"))
> cl))))\n#!/anything/cabbage-bash-1.2.3/bin/sh\n\necho hello world"
> actual-value: #f
> actual-error:
> + (%exception
> +   #<&wrap-error program: "/tmp/guix-directory.YrSRbV/foo" type:
> misc-error>)
> result: FAIL

Turns out ‘wrap-script’ itself passes a non-literal string to ‘format’,
hence this error.  I’m fixing this in ‘core-updates’ since it’s a
full-rebuild change: commit 55fb5e5d2113a732a03e255371f0172800483023.

Thanks,
Ludo’.




      reply	other threads:[~2020-11-17 14:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-14  1:58 bug#44626: tests/build-utils, tests/guix-system: fail when build path contains "~" Vagrant Cascadian
2020-11-16 11:57 ` Ludovic Courtès
2020-11-17  3:26   ` Vagrant Cascadian
2020-11-17 14:29     ` Ludovic Courtès [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=87r1osqcnw.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=44626-done@debbugs.gnu.org \
    --cc=vagrant@debian.org \
    /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).