Closed jlkiri closed 3 years ago
For some reason I cannot seem to be able to reproduce this on my side. I suspect that this is due to the format of Windows paths.
A recommendation would be to use Windows Subsystem for Linux
Closing for now, feel free to reopen if needed.
Getting the same error. Has anyone figured out a workaround?
MacOS 10.15.5 Stack Version 2.3.1 x86_64 hpack-0.33.0
lambda-telegram-bot> configure (lib + exe)
Configuring lambda-telegram-bot-0.1.0...
lambda-telegram-bot> build (lib + exe)
Preprocessing library for lambda-telegram-bot-0.1.0..
Building library for lambda-telegram-bot-0.1.0..
Preprocessing executable 'bootstrap' for lambda-telegram-bot-0.1.0..
Building executable 'bootstrap' for lambda-telegram-bot-0.1.0..
[1 of 2] Compiling Main
/[...]/lambda-telegram-bot/app/Main.hs:7:1: error:
• Couldn't match type ‘DispatcherStrategy
-> DispatcherOptions
-> template-haskell-2.15.0.0:Language.Haskell.TH.Lib.Internal.DecsQ’
with ‘template-haskell-2.15.0.0:Language.Haskell.TH.Syntax.Q
[template-haskell-2.15.0.0:Language.Haskell.TH.Syntax.Dec]’
Expected type: template-haskell-2.15.0.0:Language.Haskell.TH.Lib.Internal.DecsQ
Actual type: DispatcherStrategy
-> DispatcherOptions
-> template-haskell-2.15.0.0:Language.Haskell.TH.Lib.Internal.DecsQ
• Probable cause: ‘generateLambdaDispatcher’ is applied to too few arguments
In the expression: generateLambdaDispatcher
|
7 | generateLambdaDispatcher
| ^^^^^^^^^^^^^^^^^^^^^^^^
-- While building package lambda-telegram-bot-0.1.0 using:
/[...]/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_3.0.1.0_ghc-8.8.3 --builddir=.stack-work/dist/x86_64-osx/Cabal-3.0.1.0 build lib:lambda-telegram-bot exe:bootstrap --ghc-options " -fdiagnostics-color=always"
Process exited with code: ExitFailure 1```
What GHC versions are you using?
This happened using GHC 8.8.3. I managed to get it to work fine by adding the following to stack.yaml
after finding some pointers to using lts 15.0
.
I was previously on aws-lambda-haskell-runtime-2.0.6
and lts-16.1
and never got the project to build with them.
resolver: lts-15.0
packages:
- .
extra-deps:
- aws-lambda-haskell-runtime-2.0.4@sha256:f787843d004f139a6292aff29409fbe5be0101be0e5fbaa86b6a1c51899cc6cb,2899
Hey guys, this is completely expected, as https://github.com/theam/aws-lambda-haskell-runtime/pull/63 introduced some breaking changes.
Even more breaking changes are coming with https://github.com/theam/aws-lambda-haskell-runtime/pull/72, but this time I've updated the template and documentation.
Running into same issue. Building on macOS Mojave (10.14.6). Didn't see anything in docs at https://theam.github.io/aws-lambda-haskell-runtime/05-common-errors.html
Got the following error. Any thoughts on how to fix -- did some digging on the -lcrt0.o
part, seems it may be related to the makefile?
my-haskell-lambda> build (lib + exe)
Preprocessing library for my-haskell-lambda-0.1.0..
Building library for my-haskell-lambda-0.1.0..
Preprocessing executable 'bootstrap' for my-haskell-lambda-0.1.0..
Building executable 'bootstrap' for my-haskell-lambda-0.1.0..
Linking .stack-work/dist/x86_64-osx/Cabal-3.0.1.0/build/bootstrap/bootstrap ...
ld: library not found for -lcrt0.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
`gcc' failed in phase `Linker'. (Exit code: 1)
-- While building package my-haskell-lambda-0.1.0 using:
/Users/parthsidious/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_3.0.1.0_ghc-8.8.3 --builddir=.stack-work/dist/x86_64-osx/Cabal-3.0.1.0 build lib:my-haskell-lambda exe:bootstrap --ghc-options " -fdiagnostics-color=always"
Process exited with code: ExitFailure 1
@parthshah31 what LTS
are you on? Can you provide a repo to reproduce?
@NickSeagull here's a link: https://github.com/parthshah31/aws-lambda-hs-test
LTS 15.0
Ok @parthshah31, I asked a friend to try building this on his Macbook (mine is at tech support atm) and indeed he can reproduce.
Apparently, MacOS doesn't support static linking, and this should only be done when you are ready to deploy your lambda by building with stack --docker
. For development, I recommend removing the static linking options from the cabal
file, and add them when deploying.
I've created #95 in order to document this if someone wants to contribute. Feel free to re-open if the issue persists.
After doing
stack build
on the official template from the docsbuild fails with the following error:
I am relatively new to Haskell, so not sure whether this is a problem with my environment or this project.
OS: Windows 10 Stack: 2.1.3