all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Stephen Paul Weber <singpolyma@singpolyma.net>
Cc: guix-devel@gnu.org,  0@psycoti.ca
Subject: Re: git-fetch without a hash
Date: Mon, 09 Jan 2023 18:13:31 +0100	[thread overview]
Message-ID: <87fscjr5qc.fsf@gnu.org> (raw)
In-Reply-To: <87o7rf715e.fsf@gnu.org> ("Ludovic Courtès"'s message of "Tue, 03 Jan 2023 22:34:37 +0100")

Hi,

Ludovic Courtès <ludo@gnu.org> skribis:

> scheme@(guile-user)> ,lower (origin
> 			      (method url-fetch)
> 			      (uri "mirror://gnu/hello/hello-2.12.1.tar.gz")
> 			      (sha256 #f))
> $6 = #<derivation /gnu/store/lz34lhyxhq5wxj87fnd465hmwbhv17bn-hello-2.12.1.tar.gz.drv => /gnu/store/xfc7gsn10j09bi89ldbpfbppfkcldfy9-hello-2.12.1.tar.gz 7f3ff487c000>
> scheme@(guile-user)> (derivation-outputs $6)
> $7 = (("out" . #<<derivation-output> path: "/gnu/store/xfc7gsn10j09bi89ldbpfbppfkcldfy9-hello-2.12.1.tar.gz" hash-algo: sha256 hash: #f recursive?: #f>))
> scheme@(guile-user)> (fixed-output-derivation? $6)
> $8 = #f
>
> As it turns out, guix-daemon turns off the chroot for all built-in
> builders, fixed-output or not; quoth ‘build.cc’:
>
>     /* Note: built-in builders are *not* running in a chroot environment so
>        that we can easily implement them in Guile without having it as a
>        derivation input (they are running under a separate build user,
>        though).  */
>     useChroot = settings.useChroot && !isBuiltin(drv);
>
> I was actually surprised to see this, this wasn’t really intended.  The
> good news is that this is safe AFAICS: there’s only one built-in builder
> to date, and that’s “download”.

After investigating, I found that ‘guix perform-download’ already has a
check in place:

      (unless (and algo hash)
        (leave (G_ "~a is not a fixed-output derivation~%")
               (derivation-file-name drv)))

The check wasn’t working because ‘hash’ was #vu8() instead of #f.  This
is fixed in 5d24e57a611b43ff68700379338b899f62d198cc.

Once we update the ‘guix’ package, the daemon will no longer accept
‘url-fetch’ downloads with hash = #f.

Thanks again for reporting this oddity!

Ludo’.


  parent reply	other threads:[~2023-01-09 17:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-21  3:04 git-fetch without a hash Stephen Paul Weber
2022-12-21 22:49 ` Ludovic Courtès
2023-01-03 19:31   ` Stephen Paul Weber
2023-01-03 21:34     ` Ludovic Courtès
2023-01-05 10:06       ` Simon Tournier
2023-01-09 11:16         ` Ludovic Courtès
2023-01-11 15:34           ` Simon Tournier
2023-02-05 17:44             ` bokr
2023-02-06 17:01               ` Simon Tournier
2023-01-09 17:13       ` Ludovic Courtès [this message]
2023-01-09 17:35         ` Stephen Paul Weber
2023-01-17 16:01           ` Ludovic Courtès

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

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

  git send-email \
    --in-reply-to=87fscjr5qc.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=0@psycoti.ca \
    --cc=guix-devel@gnu.org \
    --cc=singpolyma@singpolyma.net \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.