all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* git-fetch without a hash
@ 2022-12-21  3:04 Stephen Paul Weber
  2022-12-21 22:49 ` Ludovic Courtès
  0 siblings, 1 reply; 12+ messages in thread
From: Stephen Paul Weber @ 2022-12-21  3:04 UTC (permalink / raw)
  To: guix-devel; +Cc: 0

[-- 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 --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-02-06 18:21 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2023-01-09 17:35         ` Stephen Paul Weber
2023-01-17 16:01           ` Ludovic Courtès

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.