Skip to content

SingleSourceField can't be hydrated #23015

@mtruscello

Description

@mtruscello

Describe the bug:
SingleSourceField can't be hydrated, making indirect addresses and code generation impossible.

Pants version:
2.30

OS
Affects all OS.

Additional info
Discovered as part of #22978.

The root cause appears to be that validate_resolved_files is called too early during hydrate_sources.
SingleSourceField has expected_num_files=1. Unless it points to an actual file, the validate_resolved_files call after glob expansion will always results in it matching zero files.
resolve_target and generate_sources aren't called until afterwards, so there's no way for this field type to actually make use of them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions