build-result: Make Failure an alias for BuildError#15070
build-result: Make Failure an alias for BuildError#15070Ericson2314 merged 1 commit intoNixOS:masterfrom
Failure an alias for BuildError#15070Conversation
a739985 to
1d7c4e9
Compare
Failure an alias for BuildError
roberth
left a comment
There was a problem hiding this comment.
Looks like a nice cleanup, also the decoupling from the worker protocol.
| for (auto && [wire, val] : enumerate(buildResultStatusTable)) | ||
| if (val == status) { | ||
| conn.to << uint8_t(wire); | ||
| return; | ||
| } |
There was a problem hiding this comment.
This looks wasteful but is probably ok.
Something more direct would be nice, but I assume this isn't in the hot path, so let's not sweat it.
There was a problem hiding this comment.
This is the first commit btw. I assume the compiler will be excited to optimize this, hehe. :)
3520180 to
19d03c9
Compare
19d03c9 to
c94ab82
Compare
c94ab82 to
9f5a6d7
Compare
|
🎉 All dependencies have been resolved ! |
9f5a6d7 to
ebe702d
Compare
|
|
||
| Goal::Done PathSubstitutionGoal::doneFailure(ExitCode result, BuildResult::Failure::Status status, std::string errorMsg) | ||
| { | ||
| debug(errorMsg); |
There was a problem hiding this comment.
I think the new codepath doesn't issue this debug, do we care?
There was a problem hiding this comment.
We got rid of this function because it was a redundant wrapper around Goal::doneFailure, I believe the debug log isn't something we care about but John can gut check me on that.
…eption parameters from goal
ebe702d to
de88141
Compare
Motivation
This PR makes
BuildResult::Failurea type alias forBuildError, so failures can be thrown directly without maintaining a separate exception field.Context
Previously, the goal system tracked failures in two places:
BuildResult::Failurestruct inbuildResult.innerstd::optional<Error> exfield onGoalI've set an alias
BuildResult::Failure = BuildError(note thatBuildErrorinherits fromError). This lets us remove the exception parameters fromdoneFailure(), and also lets us remove theGoal::exfield. Now, we usebuildResult.tryGetFailure()to get a throwable exception directly.The
ecNoSubstitutersexit code is handled specially in that it sets aFailureinbuildResultbut isn't logged as an error, since it effectively means "we couldn't substitute, will try building instead."Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.