Skip to content

cabal install FILE fails when path doesn't start with a letter #5820

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

Open
typedrat opened this issue Dec 31, 2018 · 3 comments
Open

cabal install FILE fails when path doesn't start with a letter #5820

typedrat opened this issue Dec 31, 2018 · 3 comments

Comments

@typedrat
Copy link
Collaborator

typedrat commented Dec 31, 2018

$ install_from_tarball
Reading available packages of hackage.haskell.org...
Using most recent state specified from most recent cabal update
index-state(hackage.haskell.org) = 2018-12-31T19:00:57Z
CallStack (from HasCallStack):
  die', called at ./Distribution/Client/TargetSelector.hs:701:9 in main:Distribution.Client.TargetSelector
cabal: Unrecognised target '../dist-newstyle/sdist/Cabal-2.5.0.0.tar.gz'.
Expected a meta-target 'all' or component kind filter or component name or
package name or package directory or package .cabal file or component name or
module name or file, rather than
'../dist-newstyle/sdist/Cabal-2.5.0.0.tar.gz'.

Discovered bugsquashing for #5800.

@typedrat typedrat changed the title cabal install FILE fails when path starts with .. cabal install FILE fails when path doesn't start with a letter Dec 31, 2018
@typedrat
Copy link
Collaborator Author

typedrat commented Dec 31, 2018

$ install_from_tarball
Reading available packages of hackage.haskell.org...
Using most recent state specified from most recent cabal update
index-state(hackage.haskell.org) = 2018-12-31T20:27:18Z
CallStack (from HasCallStack):
  die', called at ./Distribution/Client/TargetSelector.hs:701:9 in main:Distribution.Client.TargetSelector
cabal: Unrecognised target
'/home/travis/build/haskell/cabal/dist-newstyle/sdist/Cabal-2.5.0.0.tar.gz'.
Expected a meta-target 'all' or component kind filter or component name or
package name or package directory or package .cabal file or component name or
module name or file, rather than
'/home/travis/build/haskell/cabal/dist-newstyle/sdist/Cabal-2.5.0.0.tar.gz'.

This is... pretty bad.

@typedrat typedrat self-assigned this Jun 3, 2019
@typedrat
Copy link
Collaborator Author

Honestly not sure how to fix this. Should we change how file targets work, or just add a filter that checks for tarball arguments before we even go down that road?

@jneira
Copy link
Member

jneira commented Sep 2, 2021

I've got other errors in windows with cabal-install-3.4.0.0

PS D:\dev\ws\haskell\cabal-test\tmp> cabal install ..\dist-newstyle\sdist\cabal-test-0.1.0.0.tar.gz
cabal-3.4.0.0.exe: Invalid package ID:
..\dist-newstyle\sdist\cabal-test-0.1.0.0.tar.gz
"<eitherParsec>" (line 1, column 3):
unexpected all digits or a dot in a portion of package name
expecting "-"

PS D:\dev\ws\haskell\cabal-test\tmp> cd ..
PS D:\dev\ws\haskell\cabal-test> cabal install dist-newstyle\sdist\cabal-test-0.1.0.0.tar.gz
cabal-3.4.0.0.exe: Unknown target
'dist-newstyle\sdist\cabal-test-0.1.0.0.tar.gz'.
The package cabal-test has no file target
'dist-newstyle\sdist\cabal-test-0.1.0.0.tar.gz'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants