Deprecate legacy --prefer-oldest CLI flag

Open
#12,217 1 comment 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Quiet
Tech stack
haskell
Domain
cli

Research direction

Start by locating Cabal's CLI flag parsing code and the existing places that warn when a legacy flag is set. Determine how parsing can retain whether --prefer-version or --prefer-oldest supplied the value, then verify behavior across commands that accept the flag and confirm the deprecated form produces the intended warning before deletion is considered.

Written by the indexing model from the issue text.

Description

type: enhancement

https://github.com/haskell/cabal/pull/11569 adds a new ternary --prefer-version flag. This subsumes the functionality of the --prefer-oldest flag.

It would be good to eventually deprecate and delete --prefer-oldest, but there is little urgency to do so.
This is slightly difficult to do at present, since (as far as I can tell) the CLI flag parsing code doesn't have a way to deprecate flags.

In other places we throw a warning if we are running a function and see a legacy flag set, but that doesn't make sense to do here, since this flag can be passed to pretty much any command, and we currently do not record how the value was set (via prefer-version or prefer-oldest)

Dominant language
Haskell
Stars
1.8k
Forks
766
Avg merge
5d 21h
Merged PRs (30d)
27

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from haskell/cabal

All issues in haskell/cabal

Similar issues

More Haskell issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.