Skip to content

Checking broken with only some outputs #13293

@Ericson2314

Description

@Ericson2314

Describe the bug

Since DerivationBuildingGoal was split out (3b617e4), checking is broken because of an DerivationBuildingGoal::assertPathValidity call at

return miscMethods->assertPathValidity();

The issue is that DerivationBuildingGoal doesn't know what outputs are wanted any more. This was intentional --- when we are building rather than substituting, we know we are going to produce all outputs. However this assertPathValidity was happening before the build, and was intended to check that the outputs we want to repair are all there.

Steps To Reproduce

  1. Substitute some but not all outputs of a derivation.
  2. Repair that derivation
  3. Get an error message about missing unexpected invalid outputs, not because the outputs we have are broken, but because the outputs that we don't have, and don't care about not having.

Expected behavior

It should be fine to only repair some outputs, just like before

Metadata

Bisected to 3b617e4

Additional context

I would like to not solve this issue by reintroducing wantedOutputs to DerivationBuildingGoal. Can we instead solve this problem a different way?

Possible solutions:

  1. Elide the check: if we got this far, at least some of the outputs should be valid, right?
  2. Skip the early return: We did a build, so we have all the outputs now, we might as well register them in case we were missing some before
  3. Just do the earlier return, but then in DerivationGoal after we return do the check. Then we're back to knowing what output we want.

Checklist


Add 👍 to issues you find important.

CC @xokdvium

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions