Install from hackage interprets target as port
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
**Describe the bug**
I stumbled into this because I'd previously installed `haskell-ci` from source. I cannot reuse that command but I think I should be able to, to specify a target to install when `cabal install` is going to install from hackage.
**To Reproduce**
Steps to reproduce the behavior:
```
$ cabal install haskell-ci:exe:haskell-ci --overwrite-policy=always
Warning: this is a debug build of cabal-install with assertions enabled.
Downloading haskell-ci:exe:haskell-ci
Error: cabal: '/usr/bin/curl' exited with an error:
curl: (3) URL rejected: Port number was not a decimal number between 0 and
65535
$ cabal install haskell-ci --overwrite-policy=always
Warning: this is a debug build of cabal-install with assertions enabled.
Resolving dependencies...
Build profile: -w ghc-9.8.2 -O1
...
Symlinking 'haskell-ci' to '~/.cabal/bin/haskell-ci'
```
**Expected behavior**
I've read the [cabal install docs](https://cabal.readthedocs.io/en/latest/cabal-commands.html#cabal-install). The install from hackage comes first, then the local project install. Nothing warns that targets are limited for the former.
Contributor guide
Research direction
Start by reproducing the two `cabal install` commands in the issue and compare their handling of the `haskell-ci:exe:haskell-ci` target, then read the linked `cabal install` documentation. Trace the install entry point and target parsing until the Hackage path is identified; done means the target form is handled consistently and regression coverage demonstrates the expected install behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100