Skip to content
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

nix3-build: show all FOD errors with --keep-going #10734

Merged
merged 1 commit into from
May 17, 2024

Conversation

Mic92
Copy link
Member

@Mic92 Mic92 commented May 17, 2024

This was cherry-picked from lix.

Motivation

Basically I'd expect the same behavior as with nix-build, i.e. with --keep-going the hash-mismatch error of each failing fixed-output derivation is shown.

The approach is derived from Store::buildPaths (entry-point.cc): instead of throwing the first build-result, check if there are any build errors and if so, display all of them and throw after that.

Unfortunately, the BuildResult struct doesn't have an ErrorInfo (there's a FIXME for that at least), so I have to construct my own here. This is a rather cheap bugfix and I decided against touching too many parts of libstore for that (also I don't know if that's in line with the ongoing refactoring work).

Context

Priorities and Process

Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

Basically I'd expect the same behavior as with `nix-build`, i.e.
with `--keep-going` the hash-mismatch error of each failing
fixed-output derivation is shown.

The approach is derived from `Store::buildPaths` (`entry-point.cc`):
instead of throwing the first build-result, check if there are any build
errors and if so, display all of them and throw after that.

Unfortunately, the BuildResult struct doesn't have an `ErrorInfo`
(there's a FIXME for that at least), so I have to construct my own here.
This is a rather cheap bugfix and I decided against touching too many
parts of libstore for that (also I don't know if that's in line with the
ongoing refactoring work).

Closes https://git.lix.systems/lix-project/lix/issues/302

Change-Id: I378ab984fa271e6808c6897c45e0f070eb4c6fac
Signed-off-by: Jörg Thalheim <[email protected]>
@Mic92 Mic92 requested a review from edolstra as a code owner May 17, 2024 17:09
@github-actions github-actions bot added documentation with-tests Issues related to testing. PRs with tests have some priority labels May 17, 2024
@Ericson2314 Ericson2314 merged commit 1ab107b into NixOS:master May 17, 2024
10 checks passed
@Ericson2314
Copy link
Member

Thanks @Mic92. If you would like to fix that todo for BuildResult and deduplicate this will entry-points.cc, I think that would be a good follow-up task!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation with-tests Issues related to testing. PRs with tests have some priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants