theam / aws-lambda-haskell-runtime

⚡Haskell runtime for AWS Lambda
https://theam.github.io/aws-lambda-haskell-runtime/
Other
269 stars 48 forks source link

Error following the "Getting started" documentation: The project contains no local packages #92

Closed fcracker79 closed 3 years ago

fcracker79 commented 3 years ago

I am trying to create my first project as follows:

  1. I run stack new <my_project> https://github.com/theam/aws-lambda-haskell-runtime/raw/master/stack-template.hsfiles --resolver=lts-15.16 --omit-packages
  2. I add aws-lambda-haskell-runtime-3.0.0 in extra-deps section of stack.yaml file
  3. I run stack build

The output is the following error message:

> stack build
Warning (added by new or init): Some packages were found to be incompatible with the resolver and have been left commented out in the packages section.
You can omit this message by removing it from stack.yaml

Error parsing targets: The project contains no local packages (packages not marked with 'extra-dep')

As a Haskell newbie, I tried to add the following snippet in stack.yaml file:

packages:
  - .

I have no idea of what I did but now the stack build command seems to be proceeding. In the end, it produced the following message:

<path_to_my_project>/<my_project>.cabal was modified manually. Ignoring <path_to_my_project>/<my_project>/package.yaml in favor of the cabal file.
If you want to use the package.yaml file instead of the cabal file,
then please delete the cabal file.

I removed the cabal file and it worked smoothly.

I use Stack 2.3.3, Cabal 1.24.0.2 and Glasgow Haskell 8.0.2.

NickSeagull commented 3 years ago

Hello, yes, it is documented in the Getting Started section. Perhaps it is not well written so it confuses users? 🤔

In the Using the template subsection:

Now, add the following to your stack.yaml file:

packages:
- .
extra-deps:
- aws-lambda-haskell-runtime-3.0.0

Regarding the cabal file, have you changed something inside of it before running stack build? That might be the case

fcracker79 commented 3 years ago

Sorry, my fault, I did not see the first two lines. Yes, I changed trivial stuff, such as the maintainer and so on.

Thanks for your support and apologies for the trivial question...

NickSeagull commented 3 years ago

No need to be sorry, this is the place to ask questions 😄 !

Yes, the idea is that you change the package.yaml file instead of the cabal one :)