aboutsummaryrefslogtreecommitdiff
path: root/src/libstore
diff options
context:
space:
mode:
authorThéophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com>2023-04-03 20:43:02 +0200
committerGitHub <noreply@github.com>2023-04-03 20:43:02 +0200
commit523c3f722564f92e6dd7cd6256474c6d23db11b4 (patch)
treec8c9a26758c88f8ca1d4fdce50fad5a529eb2b1e /src/libstore
parent81491e1379138e69138e30d18210badbd0765b89 (diff)
parentbf2c5c3958c258584ac66519124d05ccf446aaeb (diff)
Merge pull request #8157 from hercules-ci/switch-bugs
Fix current and future `switch` bugs
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/build-result.hh1
-rw-r--r--src/libstore/filetransfer.cc5
-rw-r--r--src/libstore/nar-accessor.cc1
3 files changed, 7 insertions, 0 deletions
diff --git a/src/libstore/build-result.hh b/src/libstore/build-result.hh
index e50ddbb8c..a12c599d9 100644
--- a/src/libstore/build-result.hh
+++ b/src/libstore/build-result.hh
@@ -53,6 +53,7 @@ struct BuildResult
case LogLimitExceeded: return "LogLimitExceeded";
case NotDeterministic: return "NotDeterministic";
case ResolvesToAlreadyValid: return "ResolvesToAlreadyValid";
+ case NoSubstituters: return "NoSubstituters";
default: return "Unknown";
};
}();
diff --git a/src/libstore/filetransfer.cc b/src/libstore/filetransfer.cc
index 1ba399a29..2346accbe 100644
--- a/src/libstore/filetransfer.cc
+++ b/src/libstore/filetransfer.cc
@@ -407,6 +407,10 @@ struct curlFileTransfer : public FileTransfer
err = Misc;
} else {
// Don't bother retrying on certain cURL errors either
+
+ // Allow selecting a subset of enum values
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wswitch-enum"
switch (code) {
case CURLE_FAILED_INIT:
case CURLE_URL_MALFORMAT:
@@ -427,6 +431,7 @@ struct curlFileTransfer : public FileTransfer
default: // Shut up warnings
break;
}
+ #pragma GCC diagnostic pop
}
attempt++;
diff --git a/src/libstore/nar-accessor.cc b/src/libstore/nar-accessor.cc
index 9a0003588..f0dfcb19b 100644
--- a/src/libstore/nar-accessor.cc
+++ b/src/libstore/nar-accessor.cc
@@ -275,6 +275,7 @@ json listNar(ref<FSAccessor> accessor, const Path & path, bool recurse)
obj["type"] = "symlink";
obj["target"] = accessor->readLink(path);
break;
+ case FSAccessor::Type::tMissing:
default:
throw Error("path '%s' does not exist in NAR", path);
}