Closed blackheaven closed 3 years ago
Hello, thanks for reporting this!
Were you following the tutorial step by step? I'm asking to have in mind if you might have added some additional steps that could introduce additional libraries.
It looks like your project is not being properly linked, something similar happens when deploying Rust code aswell (search for GLIBC in this post )
Could you please write the process you followed to deploy?
Thanks a lot 😄
Hello, thank you for your answer.
Here are the steps I have taken:
I prepare the zip file on my computer:
stack build --docker
cp $(stack --docker path --local-install-root)/bin/user-management-bootstrap build/
cd build && mv user-management-bootstrap bootstrap && zip user-management-function.zip bootstrap && rm bootstrap && cd ..
Then I go to the AWS Lambda console, I upload the zip file and edit the configuration to get this:
The only diverging part is the handler name, is it "hard coded"?
Alternatively I was considering building it statically, WDYT?
Well, static linking seems to be a workaround, but I would like to solve it if you have any hints.
Right now I have no idea how to fix this in this way, all compiled runtimes seem to use static linking.
This is because you need to build the bootstrap
executable in the same environment as you would run it.
stack build --docker
uses the FP Complete images for the build, but when running a Lambda you're running in their Amazon flavored Linux, thus you get library discrepancies.
You can work around it by using the lambci/lambda
build images.
E.g.
FROM lambci/lambda:build-provided
# Installing basic dependencies
RUN yum install -y postgresql-devel # or whatever
# Installing Haskell Stack
RUN sudo curl -sSL https://get.haskellstack.org/ | sh
WORKDIR work
COPY . .
RUN stack build
# ... you get the point
ENTRYPOINT sh
If you want dynamically linked libraries it can be tricky, if you have trouble ping me.
Hi all,
After following the tutorial: https://theam.github.io/aws-lambda-haskell-runtime/06-deploying-a-lambda.html
I ended with a lambda function I have configured with the Custom runtime.
When I try to make a test call, I have got this error:
I use stack with the
lts-16.8
.Have you got any insight regarding that ?
Thanks by advance.