Do you have any suggestion on how the Makefile could be updated to build the Lambda Layer for Amazon's ARM64 architecture? I tried changing these lines (as advised on sharp's docs):
- LD_LIBRARY_PATH=$(PREFIX_PATH)/lib npm --prefix "$(ARTIFACTS_DIR)/nodejs/" install sharp@$(SHARP_VERSION)
+ SHARP_IGNORE_GLOBAL_LIBVIPS=1 LD_LIBRARY_PATH=$(PREFIX_PATH)/lib npm --prefix "$(ARTIFACTS_DIR)/nodejs/" install --arch=arm64 --platform=linux sharp@$(SHARP_VERSION)
- ldd $(ARTIFACTS_DIR)/nodejs/node_modules/sharp/build/Release/sharp-linux-x64.node | sed -nE "s/^[^\/\n]*(\/[^ ]+)(.*)/\1/p" | xargs cp -t $(ARTIFACTS_DIR)/lib
+ ldd $(ARTIFACTS_DIR)/nodejs/node_modules/sharp/build/Release/sharp-linux-arm64v8.node | sed -nE "s/^[^\/\n]*(\/[^ ]+)(.*)/\1/p" | xargs cp -t $(ARTIFACTS_DIR)/lib
The ldd command is now returning an error that sharp-linux-arm64v8.node is not a dynamic executable, which I suspect is due to the fact it was build for a different architecture than the one it is currently running on. I would be curious if anyone tried this and if you have any suggestion on how that could be solved. Thanks!
Do you have any suggestion on how the
Makefilecould be updated to build the Lambda Layer for Amazon's ARM64 architecture? I tried changing these lines (as advised on sharp's docs):The
lddcommand is now returning an error thatsharp-linux-arm64v8.nodeisnot a dynamic executable, which I suspect is due to the fact it was build for a different architecture than the one it is currently running on. I would be curious if anyone tried this and if you have any suggestion on how that could be solved. Thanks!