mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 00:08:07 +02:00
build-remote: Cope with long store URLs by falling back on hashing
I hit this in the Meson port of the functional tests, because the use of standalone build directories.
This commit is contained in:
parent
dba1142c01
commit
e92dd06a7b
1 changed files with 14 additions and 1 deletions
|
@ -264,7 +264,20 @@ connected:
|
||||||
auto inputs = readStrings<PathSet>(source);
|
auto inputs = readStrings<PathSet>(source);
|
||||||
auto wantedOutputs = readStrings<StringSet>(source);
|
auto wantedOutputs = readStrings<StringSet>(source);
|
||||||
|
|
||||||
AutoCloseFD uploadLock = openLockFile(currentLoad + "/" + escapeUri(storeUri.render()) + ".upload-lock", true);
|
AutoCloseFD uploadLock;
|
||||||
|
{
|
||||||
|
auto setUpdateLock = [&](auto && fileName){
|
||||||
|
uploadLock = openLockFile(currentLoad + "/" + escapeUri(fileName) + ".upload-lock", true);
|
||||||
|
};
|
||||||
|
try {
|
||||||
|
setUpdateLock(storeUri.render());
|
||||||
|
} catch (SysError & e) {
|
||||||
|
if (e.errNo != ENAMETOOLONG) throw;
|
||||||
|
// Try again hashing the store URL so we have a shorter path
|
||||||
|
auto h = hashString(HashAlgorithm::MD5, storeUri.render());
|
||||||
|
setUpdateLock(h.to_string(HashFormat::Base64, false));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
Activity act(*logger, lvlTalkative, actUnknown, fmt("waiting for the upload lock to '%s'", storeUri.render()));
|
Activity act(*logger, lvlTalkative, actUnknown, fmt("waiting for the upload lock to '%s'", storeUri.render()));
|
||||||
|
|
Loading…
Reference in a new issue