awslabs / aws-lambda-cpp

C++ implementation of the AWS Lambda runtime
Apache License 2.0
440 stars 89 forks source link

Incorrect location for packager #179

Open adamb924 opened 1 year ago

adamb924 commented 1 year ago

I was just doing the demo project described in the README. When executing make aws-lambda-package-demo I got this error.

adam@DESKTOP-UNU2UQJ:~/aws-lambda/build$ sudo make aws-lambda-package-demo
Consolidate compiler generated dependencies of target demo
[100%] Built target demo
make[3]: /home/adam/aws-lambda-cpp/build/packager: No such file or directory
make[3]: *** [CMakeFiles/aws-lambda-package-demo.dir/build.make:70: CMakeFiles/aws-lambda-package-demo] Error 127
make[2]: *** [CMakeFiles/Makefile2:110: CMakeFiles/aws-lambda-package-demo.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:117: CMakeFiles/aws-lambda-package-demo.dir/rule] Error 2
make: *** [Makefile:137: aws-lambda-package-demo] Error 2

I modified line 70 of \home\adam\aws-lambda\build\CMakeFiles\aws-lambda-package-demo.dir\build.make so that it referred to /home/adam/aws-lambda-cpp/packaging/packager rather than /home/adam/aws-lambda-cpp/build/packager. Then it worked.

kkarbowiak commented 1 year ago

I am also facing build failures after updating to v0.2.8. The problem is in similar location, although the logs on my build server do not show the "No such file or directory" message.

I did a binary chop and it seems the offending commit is https://github.com/awslabs/aws-lambda-cpp/commit/5fb60b9d93c685e15d036889eb992dabe296d0bc, although I do not see how it could affect the path to packager.

kkarbowiak commented 1 year ago

I am also facing build failures after updating to v0.2.8. The problem is in similar location, although the logs on my build server do not show the "No such file or directory" message.

The above can be observed in this actions run.

bmoffatt commented 1 year ago

@kkarbowiak It turns out GitHub's ubuntu-latest has an rpm package installed (weird!), causing packager to try and run rpm --query --list glibc.$(uname -m), which obviously isn't gonna have any results in an Ubuntu container.

https://github.com/awslabs/aws-lambda-cpp/commit/5fb60b9d93c685e15d036889eb992dabe296d0bc removed what appeared to be a redundant check if [[ $(rpm --query --list glibc.$arch | wc -l) -gt 1 ]];. The reason this broke is because packager contains set -euo pipefail, and the removed check acted as a guard before evaluating the failed command.