-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
worker-protocol: add cancelled-and-hash-mismatch-status feature #15090
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,10 +46,15 @@ enum struct BuildResultFailureStatus : uint8_t { | |
| LogLimitExceeded, | ||
| NotDeterministic, | ||
| NoSubstituters, | ||
| /// A certain type of `OutputRejected`. The protocols do not yet | ||
| /// know about this one, so change it back to `OutputRejected` | ||
| /// before serialization. | ||
| /// A certain type of `OutputRejected`. Requires the | ||
| /// `cancelled-and-hash-mismatch-status` feature; falls back to | ||
| /// `OutputRejected` when communicating with older remotes. | ||
| HashMismatch, | ||
| /// Goal was never attempted because another goal failed (and | ||
| /// `--keep-going` wasn't used). Requires the | ||
| /// `cancelled-and-hash-mismatch-status` feature; falls back to | ||
| /// `MiscFailure` when communicating with older remotes. | ||
| Cancelled, | ||
|
Comment on lines
+53
to
+57
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should also handle Interrupted cases right?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added the comment based on Eelco's PR description, I don't think handling |
||
| }; | ||
|
|
||
| /** | ||
|
|
@@ -73,14 +78,22 @@ struct BuildError : public CloneableError<BuildError, Error> | |
| */ | ||
| bool isNonDeterministic = false; | ||
|
|
||
| private: | ||
|
|
||
| /** | ||
| * Used in the constructors | ||
| */ | ||
| static unsigned int exitCodeFromStatus(Status status); | ||
|
|
||
| public: | ||
|
|
||
| /** | ||
| * Variadic constructor for throwing with format strings. | ||
| * Delegates to the string constructor after formatting. | ||
| */ | ||
| template<typename... Args> | ||
| BuildError(Status status, const Args &... args) | ||
| : CloneableError(args...) | ||
| : CloneableError(exitCodeFromStatus(status), args...) | ||
| , status{status} | ||
| { | ||
| } | ||
|
|
@@ -97,10 +110,9 @@ public: | |
| * Also used for deserialization. | ||
| */ | ||
| BuildError(Args args) | ||
| : CloneableError(std::move(args.msg)) | ||
| : CloneableError(exitCodeFromStatus(args.status), std::move(args.msg)) | ||
| , status{args.status} | ||
| , isNonDeterministic{args.isNonDeterministic} | ||
|
|
||
| { | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -118,7 +118,7 @@ public: | |
| /** | ||
| * Build result. | ||
| */ | ||
| BuildResult buildResult; | ||
| BuildResult buildResult = {.inner = BuildResult::Failure{BuildResult::Failure::Cancelled, ""}}; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. N.B. tempted to just change the default status on |
||
|
|
||
| /** | ||
| * Suspend our goal and wait until we get `work`-ed again. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.