Skip to content

Feature Request: Allow picking the first possible target if and only if target selector is ambiguous  #7484

@fendor

Description

@fendor

Sometimes it is convenient to select a target if the given selector is ambiguous, either based on the component type or just the first that is accessible.

This is specifically helpful as cabal supports Filepath targets. Given a Filepath target, cabal figures out the component the filepath belongs to and loads that. However, sometimes a Filepath is part of multiple components. In that case, the target is ambiguous and no build-info is printed.
Especially for tooling, it would be better if you defaulted to just some component, as the options probably don't differ too much, and we keep working most of the time.

We propose here to add --pick-first-target to NixStyleFlags, so that users can conveniently decide to just pick a target and not error if the targets are ambiguous.

PR is here: #7482

Edit: Added better motivation

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions