[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
git-fetch without a hash
From: |
Stephen Paul Weber |
Subject: |
git-fetch without a hash |
Date: |
Tue, 20 Dec 2022 22:04:29 -0500 |
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?
signature.asc
Description: PGP signature
- git-fetch without a hash,
Stephen Paul Weber <=