ezyman
ezyman

Reputation: 399

How to convert a stack project into a cabal project?

I have created a stack project (with the name TMS) and seems to build. The resolver is "lts-18.25". I have also created manually a cabal.project file in the TMS directory. This file only contains the line "packages: TMS" (without quotes). Now I want to ensure that the package TMS builds with both stack and cabal. In the TMS directory, when I run the command "cabal v2-build", I get the following error:

PS C:\Users\ephra\OneDrive\Dokument\haskell\mena-projects\TMS> cabal v2-build
When using configuration(s) from C:\Users\ephra\OneDrive\Dokument\haskell\mena-projects\TMS\cabal.project, the following errors occurred:
The package location 'TMS' does not exist.

PS C:\Users\ephra\OneDrive\Dokument\haskell\mena-projects\TMS>

Upvotes: 2

Views: 356

Answers (1)

leftaroundabout
leftaroundabout

Reputation: 120711

The line

packages: TMS

instructs Cabal to look for a directory called TMS in which to look for a package. This would be correct if the cabal.project file were located in .../haskell/mena-projects. But in your case, you seem to have it already in the TMS directory, so you should change the project file to

packages: .

Upvotes: 4

Related Questions