Feature Request: Allow picking the first possible target if and only if target selector is ambiguous
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
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
Contributor guide
Assessment
This issue has not been assessed yet.