Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate .cabal file from package.yml

I removed package.yml file to use .cabal file instead. Now I'd like to try defining everything in package.yml, and let stack to generate .cabal file auatomatically.

But when I manually converted .cabal file to package.yml and delete .cabal file and ran stack build, it shows me this error:

Stack looks for packages in the directories configured in the 'packages' variable defined in your stack.yaml
The current entry points to /Users/leo/zhangchiqing/hello/ but no .cabal file could be found there.

How can I generate the .cabal file from package.yml?

like image 415
Leo Zhang Avatar asked Jan 02 '23 17:01

Leo Zhang


2 Answers

Run hpack in the directory containing the package.yaml. You can install hpack by running cabal install hpack.

like image 182
Tom Ellis Avatar answered Jan 12 '23 09:01

Tom Ellis


Never mind, I figured out. It should be package.yaml instead of package.yml

like image 41
Leo Zhang Avatar answered Jan 12 '23 08:01

Leo Zhang