diff options
author | Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com> | 2023-04-03 20:43:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-03 20:43:02 +0200 |
commit | 523c3f722564f92e6dd7cd6256474c6d23db11b4 (patch) | |
tree | c8c9a26758c88f8ca1d4fdce50fad5a529eb2b1e /src/libstore | |
parent | 81491e1379138e69138e30d18210badbd0765b89 (diff) | |
parent | bf2c5c3958c258584ac66519124d05ccf446aaeb (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.hh | 1 | ||||
-rw-r--r-- | src/libstore/filetransfer.cc | 5 | ||||
-rw-r--r-- | src/libstore/nar-accessor.cc | 1 |
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); } |