unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stephen Paul Weber <singpolyma@singpolyma.net>
To: guix-devel@gnu.org
Cc: 0@psycoti.ca
Subject: git-fetch without a hash
Date: Tue, 20 Dec 2022 22:04:29 -0500	[thread overview]
Message-ID: <Y6J3vasfRdO+cYgC@singpolyma-beefy.lan> (raw)

[-- Attachment #1: Type: text/plain, Size: 1268 bytes --]

Hello Guix!

It seem that url-fetch will work without a hash (that is, with (sha256 #f)) 
but git-fetch will not.

As near as I can tell this is because git-fetch uses a fixed derivation 
build going via nix/build.cc stuff which contains this line:

	if (i.second.hash == "") fixedOutput = false;

And this results in /etc/resolv.conf not getting written and DNS resolution 
failing.

Now, I *think* by my reading that it is intended for *only* fixed-output 
derivations to have network access, because otherwise the operation would be 
impure?

And then url-fetch is just not actually ending up in a build container and 
so it works even when it isn't fixed-output?

However, there's no real reason that git-fetch *needs* to be fixed-output in 
terms of having a hash pre-defined, at least for local development and other 
purposes.  So is there a way around this?  If having a way around it is not 
desirable should url-fetch consider this an error as well?

Finally, *if* git-fetch should not allow this, the current error message is 
beyond confusing (DNS resolution fails during git fetch and it tries to fall 
back to SWH).  So should git-fetch check for hash of #f and raise at that 
point with a better error message in that case?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

             reply	other threads:[~2022-12-21  3:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-21  3:04 Stephen Paul Weber [this message]
2022-12-21 22:49 ` git-fetch without a hash 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
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

  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=Y6J3vasfRdO+cYgC@singpolyma-beefy.lan \
    --to=singpolyma@singpolyma.net \
    --cc=0@psycoti.ca \
    --cc=guix-devel@gnu.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).