Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cabal upgrade leads to odd diagnostic #6691

Closed
jrp2014 opened this issue Apr 11, 2020 · 7 comments
Closed

cabal upgrade leads to odd diagnostic #6691

jrp2014 opened this issue Apr 11, 2020 · 7 comments
Assignees
Milestone

Comments

@jrp2014
Copy link

jrp2014 commented Apr 11, 2020

Describe the bug
I inadvertently tyoed cabal upgrade instead of cabal update and got a strange diagnostic

To Reproduce
Steps to reproduce the behavior:

$ cabal upgrade
fromFlag NoFlag. Use fromFlagOrDefault
CallStack (from HasCallStack):
  error, called at ./Distribution/Simple/Flag.hs:98:21 in Cabal-3.2.0.0 w73VV9T25vCb2mhueKgfz:Distribution.Simple.Flag
  fromFlag, called at main/Main.hs:909:15 in main:Main

$ cabal v2-upgrade
cabal: unrecognised command: v2-upgrade (try --help)

Expected behavior
So far as I aware, upgrade is not a valid cabal command so I should get an unrecognised command diagnostic.

System information

  • Operating system: MacOS Catalina
  • cabal, ghc versions: cabal 3.2.0.0, ghc 8.8.3

Additional context
This is obviously not a deal breaker, but it may point to a deeper bug in cabal command line parsing.

@phadej
Copy link
Collaborator

phadej commented Apr 12, 2020

There is in fact cabal upgrade command, which would print you a

    "Use the 'cabal install' command instead of 'cabal upgrade'.\n"
 ++ "You can install the latest version of a package using 'cabal install'. "
 ++ "The 'cabal upgrade' command has been removed because people found it "
 ++ "confusing and it often led to broken packages.\n"
 ++ "If you want the old upgrade behaviour then use the install command "
 ++ "with the --upgrade-dependencies flag (but check first with --dry-run "
 ++ "to see what would happen). This will try to pick the latest versions "
 ++ "of all dependencies, rather than the usual behaviour of trying to pick "
 ++ "installed versions of all dependencies. If you do use "
 ++ "--upgrade-dependencies, it is recommended that you do not upgrade core "
 ++ "packages (e.g. by using appropriate --constraint= flags)."
 where

if it wasn't buggy.

@phadej phadej self-assigned this Apr 12, 2020
@phadej
Copy link
Collaborator

phadej commented Apr 12, 2020

The question is, should we fix upgrade command or just remove it?

@hvr
Copy link
Member

hvr commented Apr 12, 2020

@phadej cabal upgrade sounds like a relict from the v1-* UI idiom... I'm not sure it makes any sense in the v2-* UI paradigm anymore. (Also, I doubt there's people left who still remember cabal upgrade from the ancient times)

@phadej
Copy link
Collaborator

phadej commented Apr 12, 2020

I take that as we can just remove cabal upgrade command?

There is also win32selfupgrade command which I have no idea about (it's for sure not tested). Does @Mistuke know about it?

And also uninstall which is not implemented, so can be removed as well?

(Other hiddenCmd make sense to exist, like act-as-setup, I guess they don't even need to be hidden...)

@Mistuke
Copy link
Collaborator

Mistuke commented Apr 13, 2020

I can't say I've ever heard of win32selfupgrade.. no clue that that does.

@phadej
Copy link
Collaborator

phadej commented Apr 13, 2020

@Mistuke thanks for that insight. I'll make a PR removing upgrade, win32selfupgrade and uninstall.

@phadej phadej closed this as completed in e46608a Apr 13, 2020
phadej added a commit that referenced this issue Apr 13, 2020
…mmands

Resolve #6691: Remove upgrade, uninstall and win32selfupgrade commands
@jrp2014
Copy link
Author

jrp2014 commented Apr 13, 2020

Great work.. Thanks.

@phadej phadej added this to the 3.4.0.0-rc1 milestone Jul 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants