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

No cabal files #43

Closed
ilyakooo0 opened this issue Sep 1, 2019 · 4 comments
Closed

No cabal files #43

ilyakooo0 opened this issue Sep 1, 2019 · 4 comments

Comments

@ilyakooo0
Copy link

I get this error when trying to index one of the packages in a project.

cabal-helper-wrapper: user error (Pattern match failure in do expression at src/CabalHelper/Compiletime/Wrapper.hs:164:7-13)

After adding a trace to the line:

[cfile] <- traceShowId . filter isCabalFile <$> getDirectoryContents projdir

I get [].

@alexwl
Copy link
Owner

alexwl commented Sep 2, 2019

It seems that there's no .cabal file in the package directory (projdir).

isCabalFile function from cabal-helper:

isCabalFile :: FilePath -> Bool
isCabalFile f = takeExtension' f == ".cabal"

takeExtension' :: FilePath -> String
takeExtension' p =
    if takeFileName p == takeExtension p
      then "" -- just ".cabal" is not a valid cabal file
      else takeExtension p

cabal-helper needs .cabal file to get package description.

Is there a package.yaml (https://github.com/sol/hpack) file in the package directory? hpack can generate .cabal file from package.yaml.

@ilyakooo0
Copy link
Author

ilyakooo0 commented Sep 2, 2019

Yeah, this was related to me not specifying the full dist path. I essentially left it at .stack-work/dist. There should be a more descriptive error for this though.

@alexwl
Copy link
Owner

alexwl commented Sep 2, 2019

I agree that the error message should be more descriptive. I've added the check for .cabal file (6c6d962)

@alexwl
Copy link
Owner

alexwl commented Sep 5, 2019

I think the issue is fixed.

@alexwl alexwl closed this as completed Sep 5, 2019
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

2 participants