Update sharp to 0.33.4, include av1 support for encoding and decoding
Not sure if it's what you want, but it works with avif and works fine. I also updated sharp, if you don't want it then i can split PRs.
When I build from your repo I get the following error. Building from my repo still works fine
gyp verb python /root/.pyenv/versions/3.11.8/bin/python3
gyp verb `which` succeeded for `make` /usr/bin/make
gyp verb bin symlinks created symlink to "/root/.pyenv/versions/3.11.8/bin/python3" in "/codebuild/output/src1486761640/src/github.com/faradaytrs/sharp-heic-lambda-layer/.aws-sam/build/SharpHEICLayer/nodejs/node_modules/sharp/src/build/node_gyp_bins" and added to PATH
gyp info spawn make
gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
In file included from ../common.cc:13:
/usr/local/include/vips/vips8:35:10: fatal error: glib-object.h: No such file or directory
35 | #include <glib-object.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [sharp-linux-x64.target.mk:137: Release/obj.target/sharp-linux-x64/common.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.<anonymous> (/codebuild/output/src1486761640/src/github.com/faradaytrs/sharp-heic-lambda-layer/.aws-sam/build/SharpHEICLayer/nodejs/node_modules/node-gyp/lib/build.js:216:23)
gyp ERR! System Linux 4.14.291-218.527.amzn2.x86_64
gyp ERR! command "/usr/local/bin/node" "/codebuild/output/src1486761640/src/github.com/faradaytrs/sharp-heic-lambda-layer/.aws-sam/build/SharpHEICLayer/nodejs/node_modules/.bin/node-gyp" "rebuild" "--directory=src"
gyp ERR! cwd /codebuild/output/src1486761640/src/github.com/faradaytrs/sharp-heic-lambda-layer/.aws-sam/build/SharpHEICLayer/nodejs/node_modules/sharp/src
gyp ERR! node -v v20.11.1
gyp ERR! node-gyp -v v10.2.0
gyp ERR! not ok
npm info run [email protected] install { code: 1, signal: null }
npm verb stack Error: command failed
npm verb stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:53:27)
npm verb stack at ChildProcess.emit (node:events:518:28)
npm verb stack at maybeClose (node:internal/child_process:1105:16)
npm verb stack at ChildProcess._handle.onexit (node:internal/child_process:305:5)
npm verb pkgid [email protected]
npm verb cwd /tmp/tmpl8tdzhro
npm verb Linux 4.14.291-218.527.amzn2.x86_64
npm verb node v20.11.1
npm verb npm v10.2.4
npm ERR! code 1
npm ERR! path /codebuild/output/src1486761640/src/github.com/faradaytrs/sharp-heic-lambda-layer/.aws-sam/build/SharpHEICLayer/nodejs/node_modules/sharp
npm ERR! command failed
npm ERR! command sh -c node install/check
npm verb exit 1
npm verb unfinished npm timer reify 1720680635376
npm verb unfinished npm timer reify:build 1720680636355
npm verb unfinished npm timer build 1720680636355
npm verb unfinished npm timer build:deps 1720680636356
npm verb unfinished npm timer build:run:install 1720680636357
npm verb unfinished npm timer build:run:install:node_modules/sharp 1720680636357
npm verb code 1
npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2024-07-11T06_50_35_224Z-debug-0.log
make: *** [/codebuild/output/src1486761640/src/github.com/faradaytrs/sharp-heic-lambda-layer/layer/Makefile:26: build-SharpHEICLayer] Error 1
[Container] 2024/07/11 06:50:42.202675 Command did not exit successfully npm run build exit status 1
[Container] 2024/07/11 06:50:42.208377 Phase complete: BUILD State: FAILED
[Container] 2024/07/11 06:50:42.208399 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: npm run build. Reason: exit status 1
[Container] 2024/07/11 06:50:42.270777 Entering phase POST_BUILD
[Container] 2024/07/11 06:50:42.271256 Running command bash -c "if [ /"$CODEBUILD_BUILD_SUCCEEDING/" == /"0/" ]; then exit 1; fi"
[Container] 2024/07/11 06:50:42.279314 Command did not exit successfully bash -c "if [ /"$CODEBUILD_BUILD_SUCCEEDING/" == /"0/" ]; then exit 1; fi" exit status 1
[Container] 2024/07/11 06:50:42.284166 Phase complete: POST_BUILD State: FAILED
[Container] 2024/07/11 06:50:42.284192 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: bash -c "if [ /"$CODEBUILD_BUILD_SUCCEEDING/" == /"0/" ]; then exit 1; fi". Reason: exit status 1
[Container] 2024/07/11 06:50:42.427232 Set report auto-discover timeout to 5 seconds
I'm also getting the same error as @zoellner
/usr/local/include/vips/vips8:35:10: fatal error: glib-object.h: No such file or directory
Are you using aws/codebuild/amazonlinux2-x86_64-standard:5.0 @faradaytrs?
I'm also getting the same error as @zoellner
/usr/local/include/vips/vips8:35:10: fatal error: glib-object.h: No such file or directoryAre you using
aws/codebuild/amazonlinux2-x86_64-standard:5.0@faradaytrs?
Yes I am, there was a problem with SHARP_FORCE_GLOBAL_LIBVIPS, I deleted it, and it works fine now. Please try again.
There is also an update for libheif, if you plan to release a new version, maybe it's a good idea to include it too.
I can confirm that the changes work perfectly fine in production. @faradaytrs, thank you for proposing these improvements. We may need to update the README to reflect these changes.
@zoellner, thank you for putting this repository together. It is a massive timesaver!
Thanks for your contribution. Just got around to test this and will prepare a new release.