Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

segmentation fault on exit when building from source #4329

Closed
5 of 11 tasks
kapouer opened this issue Feb 14, 2025 · 4 comments
Closed
5 of 11 tasks

segmentation fault on exit when building from source #4329

kapouer opened this issue Feb 14, 2025 · 4 comments

Comments

@kapouer
Copy link
Contributor

kapouer commented Feb 14, 2025

Possible install-time or require-time problem

Are you using the latest version of sharp?

  • I am using the latest version of sharp as reported by npm view sharp dist-tags.latest.

Are you using a supported runtime?

  • I am using Node.js with a version that satisfies ^18.17.0 || ^20.3.0 || >=21.0.0
  • I am using Deno
  • I am using Bun

Are you using a supported package manager and installing optional dependencies?

  • I am using npm >= 10.1.0 with --include=optional
  • I am using yarn >= 3.2.0
  • I am using pnpm >= 7.1.0 with --no-optional=false
  • I am using Deno
  • I am using Bun

What is the complete error message, including the full stack trace?

Core was generated by `node-v20.18.3-linux-x64/bin/node run.js'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000000000d334c0 in node::PerProcessOptions::~PerProcessOptions() ()
[Current thread is 1 (Thread 0x7f0024cf1c80 (LWP 1758808))]
(gdb) bt
#0  0x0000000000d334c0 in node::PerProcessOptions::~PerProcessOptions() ()
#1  0x0000000000d2e1f2 in std::shared_ptr<node::PerProcessOptions>::~shared_ptr() ()
#2  0x00007f0024766261 in __run_exit_handlers
    (status=0, listp=0x7f002490b680 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at ./stdlib/exit.c:108
#3  0x00007f002476631a in __GI_exit (status=<optimized out>) at ./stdlib/exit.c:138
#4  0x00007f002474dd6f in __libc_start_call_main (main=main@entry=0xbca5e0 <main>, argc=argc@entry=2, argv=argv@entry=0x7ffec9429b38)
    at ../sysdeps/nptl/libc_start_call_main.h:74
#5  0x00007f002474de25 in __libc_start_main_impl
    (main=0xbca5e0 <main>, argc=2, argv=0x7ffec9429b38, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffec9429b28)
    at ../csu/libc-start.c:360
#6  0x0000000000bd187e in _start ()

What is the complete output of running npm install --verbose --foreground-scripts sharp in an empty directory?

dev@lal:~/Software/debian/nodejs/what$ npm install --verbose --foreground-scripts sharp npm verb cli /usr/bin/node /usr/bin/npm npm info using [email protected] npm info using [email protected] npm verb title npm install sharp npm verb argv "install" "--loglevel" "verbose" "--foreground-scripts" "sharp" npm verb logfile logs-max:10 dir:/.npm/_logs/2025-02-14T14_04_27_289Z- npm verb logfile /.npm/_logs/2025-02-14T14_04_27_289Z-debug-0.log npm http fetch GET 200 https://registry.npmjs.org/sharp 903ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/color 106ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/detect-libc 201ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-linuxmusl-arm64 197ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-libvips-linux-arm64 227ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-linux-s390x 234ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-libvips-darwin-x64 233ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-darwin-x64 240ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-libvips-linux-x64 243ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-darwin-arm64 246ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-wasm32 251ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-win32-ia32 250ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-linux-x64 253ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-linux-arm64 251ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-win32-x64 253ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-libvips-linux-arm 250ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-linux-arm 255ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-linuxmusl-x64 292ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-libvips-darwin-arm64 290ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-libvips-linux-s390x 295ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-libvips-linuxmusl-arm64 294ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/semver 307ms (cache updated) npm http fetch GET 200 https://registry.npmjs.org/@img%2fsharp-libvips-linuxmusl-x64 300ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/color-string 98ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/color-convert 113ms (cache updated) npm http fetch GET 200 https://registry.npmjs.org/@emnapi%2fruntime 130ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/tslib 86ms (cache updated) npm http fetch GET 200 https://registry.npmjs.org/color-name 95ms (cache updated) npm http fetch GET 200 https://registry.npmjs.org/simple-swizzle 92ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/color-name 102ms (cache updated) npm http fetch GET 200 https://registry.npmjs.org/is-arrayish 66ms (cache updated) npm verb reify failed optional dependency what/node_modules/@img/sharp-win32-x64 npm verb reify failed optional dependency /what/node_modules/@img/sharp-win32-ia32 npm verb reify failed optional dependency /what/node_modules/@img/sharp-wasm32 npm verb reify failed optional dependency /what/node_modules/@emnapi/runtime npm verb reify failed optional dependency /what/node_modules/tslib npm verb reify failed optional dependency /what/node_modules/@img/sharp-linuxmusl-arm64 npm verb reify failed optional dependency /what/node_modules/@img/sharp-linux-s390x npm verb reify failed optional dependency /what/node_modules/@img/sharp-linux-arm64 npm verb reify failed optional dependency /what/node_modules/@img/sharp-linux-arm npm verb reify failed optional dependency /what/node_modules/@img/sharp-libvips-linuxmusl-arm64 npm verb reify failed optional dependency /what/node_modules/@img/sharp-libvips-linux-s390x npm verb reify failed optional dependency /what/node_modules/@img/sharp-libvips-linux-arm64 npm verb reify failed optional dependency /what/node_modules/@img/sharp-libvips-linux-arm npm verb reify failed optional dependency /what/node_modules/@img/sharp-libvips-darwin-x64 npm verb reify failed optional dependency /what/node_modules/@img/sharp-libvips-darwin-arm64 npm verb reify failed optional dependency /what/node_modules/@img/sharp-darwin-x64 npm verb reify failed optional dependency /what/node_modules/@img/sharp-darwin-arm64 npm http fetch GET 200 https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz 108ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz 179ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz 208ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/color/-/color-4.2.3.tgz 228ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz 238ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz 288ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.3.1.tgz 331ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/semver/-/semver-7.7.1.tgz 334ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.5.tgz 329ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.5.tgz 332ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/sharp/-/sharp-0.33.5.tgz 353ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.4.tgz 2566ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.4.tgz 3238ms (cache miss) npm info run [email protected] install node_modules/sharp node install/check

[email protected] install
node install/check

sharp: Detected globally-installed libvips v8.16.0nux-x64: info run [email protected] install node_modules/sharp node install/check
sharp: Attempting to build from source via node-gyp
sharp: Found node-addon-api 8.3.0
sharp: Found node-gyp 11.1.0
sharp: See https://sharp.pixelplumbing.com/install#building-from-source
gyp info it worked if it ends with okrp-libvips-linux-x64: info run [email protected] install node_modules/sharp node install/check
gyp verb cli [
gyp verb cli '/usr/bin/node',
gyp verb cli '/usr/share/nodejs/node-gyp/bin/node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--directory=src'
gyp verb cli ]
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info chdir src
gyp verb clean removing "build" directoryibvips-linux-x64: info run [email protected] install node_modules/sharp node install/check
gyp verb find Python Python is not set from command line or npm configuration
gyp verb find Python Python is not set from environment variable PYTHON
gyp verb find Python checking if "python3" can be used
gyp verb find Python - executing "python3" to get executable path
gyp verb find Python - executable path is "/usr/bin/python3"nfo run [email protected] install node_modules/sharp node install/check
gyp verb find Python - executing "/usr/bin/python3" to get version
gyp verb find Python - version is "3.13.2"bvips-linux-x64: info run [email protected] install node_modules/sharp node install/check
gyp info find Python using Python version 3.13.2 found at "/usr/bin/python3"
gyp verb get node dir no --target version specified, falling back to host node version: 20.18.3
gyp verb build dir attempting to create "build" dir: /what/node_modules/sharp/src/build
gyp verb build dir "build" dir needed to be created? Yes
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: /what/node_modules/sharp/src/build/config.gypi
gyp verb config.gypi checking for gypi file: /what/node_modules/sharp/src/config.gypi
gyp verb common.gypi checking for gypi file: /what/node_modules/sharp/src/common.gypi
gyp verb gyp gyp format was not specified; forcing "make"
gyp info spawn /usr/bin/python3
gyp info spawn args [
gyp info spawn args '/usr/share/nodejs/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/what/node_modules/sharp/src/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/usr/share/nodejs/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/usr/include/nodejs/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/usr/include/nodejs',
gyp info spawn args '-Dnode_gyp_dir=/usr/share/nodejs/node-gyp',
gyp info spawn args '-Dnode_lib_file=/usr/include/nodejs/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/what/node_modules/sharp/src',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
:114: SyntaxWarning: invalid escape sequence '/': info run [email protected] install node_modules/sharp node install/check
gyp verb build type Releasey:@img/sharp-libvips-linux-x64: info run [email protected] install node_modules/sharp node install/check
gyp verb architecture x64
gyp verb node dev dir /usr/include/nodejs
gyp verb python /usr/bin/python3
gyp verb which succeeded for make /usr/bin/make
gyp verb bin symlinks created symlink to "/usr/bin/python3" in "/what/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' ]
make : on entre dans le répertoire « /what/node_modules/sharp/src/build »
cc -o Release/obj.target/nothing/../../../../../../../../../usr/share/nodejs/node-addon-api/nothing.o ../../../../../../../../../../usr/share/nodejs/node-addon-api/nothing.c '-DNODE_GYP_MODULE_NAME=nothing' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' -I/usr/include/nodejs/include/node -I/usr/include/nodejs/src -I/usr/include/nodejs/deps/openssl/config -I/usr/include/nodejs/deps/openssl/openssl/include -I/usr/include/nodejs/deps/uv/include -I/usr/include/nodejs/deps/zlib -I/usr/include/nodejs/deps/v8/include -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -fPIC -m64 -O3 -fno-omit-frame-pointer -MMD -MF ./Release/.deps/Release/obj.target/nothing/../../../../../../../../../usr/share/nodejs/node-addon-api/nothing.o.d.raw -c
rm -f Release/obj.target/../../../../../../../../../usr/share/nodejs/node-addon-api/nothing.a Release/obj.target/../../../../../../../../../usr/share/nodejs/node-addon-api/nothing.a.ar-file-list; mkdir -p dirname Release/obj.target/../../../../../../../../../usr/share/nodejs/node-addon-api/nothing.a
ar crs Release/obj.target/../../../../../../../../../usr/share/nodejs/node-addon-api/nothing.a @Release/obj.target/../../../../../../../../../usr/share/nodejs/node-addon-api/nothing.a.ar-file-list
ln -f "Release/obj.target/../../../../../../../../../usr/share/nodejs/node-addon-api/nothing.a" "Release/nothing.a" 2>/dev/null || (rm -rf "Release/nothing.a" && cp -af "Release/obj.target/../../../../../../../../../usr/share/nodejs/node-addon-api/nothing.a" "Release/nothing.a")
touch Release/obj.target/libvips-cpp.stamp
g++ -o Release/obj.target/sharp-linux-x64/common.o ../common.cc '-DNODE_GYP_MODULE_NAME=sharp-linux-x64' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DNAPI_VERSION=9' '-DNODE_ADDON_API_DISABLE_DEPRECATED' '-DNODE_API_SWALLOW_UNTHROWABLE_EXCEPTIONS' '-DSHARP_USE_GLOBAL_LIBVIPS' '-DBUILDING_NODE_EXTENSION' -I/usr/include/nodejs/include/node -I/usr/include/nodejs/src -I/usr/include/nodejs/deps/openssl/config -I/usr/include/nodejs/deps/openssl/openssl/include -I/usr/include/nodejs/deps/uv/include -I/usr/include/nodejs/deps/zlib -I/usr/include/nodejs/deps/v8/include -I../../../../../../../../../../usr/share/nodejs/node-addon-api -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/sysprof-6 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/webp -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/x86_64-linux-gnu -I/usr/include/librsvg-2.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libxml2 -I/usr/include/hdf5/serial -I/usr/include/OpenEXR -I/usr/include/Imath -I/usr/include/openjpeg-2.5 -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -fPIC -m64 -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -fno-strict-aliasing -std=gnu++17 -std=c++0x -fexceptions -Wall -Os -MMD -MF ./Release/.deps/Release/obj.target/sharp-linux-x64/common.o.d.raw -c
In file included from ../../../../../../../../../../usr/share/nodejs/node-addon-api/napi.h:3293,
from ../common.cc:12:
../../../../../../../../../../usr/share/nodejs/node-addon-api/napi-inl.h: In static member function ‘static void Napi::ObjectWrap::FinalizeCallback(Napi::node_addon_api_basic_env, void*, void*)’:
../../../../../../../../../../usr/share/nodejs/node-addon-api/napi-inl.h:5100:6: warning: ‘if constexpr’ only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
5100 | if constexpr (details::HasBasicFinalizer::value) {
| ^~~~~~~~~
../../../../../../../../../../usr/share/nodejs/node-addon-api/napi-inl.h:5110:6: warning: ‘if constexpr’ only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
5110 | if constexpr (details::HasExtendedFinalizer::value) {
| ^~~~~~~~~
g++ -o Release/obj.target/sharp-linux-x64/metadata.o ../metadata.cc '-DNODE_GYP_MODULE_NAME=sharp-linux-x64' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DNAPI_VERSION=9' '-DNODE_ADDON_API_DISABLE_DEPRECATED' '-DNODE_API_SWALLOW_UNTHROWABLE_EXCEPTIONS' '-DSHARP_USE_GLOBAL_LIBVIPS' '-DBUILDING_NODE_EXTENSION' -I/usr/include/nodejs/include/node -I/usr/include/nodejs/src -I/usr/include/nodejs/deps/openssl/config -I/usr/include/nodejs/deps/openssl/openssl/include -I/usr/include/nodejs/deps/uv/include -I/usr/include/nodejs/deps/zlib -I/usr/include/nodejs/deps/v8/include -I../../../../../../../../../../usr/share/nodejs/node-addon-api -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/sysprof-6 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/webp -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/x86_64-linux-gnu -I/usr/include/librsvg-2.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libxml2 -I/usr/include/hdf5/serial -I/usr/include/OpenEXR -I/usr/include/Imath -I/usr/include/openjpeg-2.5 -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -fPIC -m64 -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -fno-strict-aliasing -std=gnu++17 -std=c++0x -fexceptions -Wall -Os -MMD -MF ./Release/.deps/Release/obj.target/sharp-linux-x64/metadata.o.d.raw -c
In file included from ../../../../../../../../../../usr/share/nodejs/node-addon-api/napi.h:3293,
from ../metadata.cc:7:
../../../../../../../../../../usr/share/nodejs/node-addon-api/napi-inl.h: In static member function ‘static void Napi::ObjectWrap::FinalizeCallback(Napi::node_addon_api_basic_env, void*, void*)’:
../../../../../../../../../../usr/share/nodejs/node-addon-api/napi-inl.h:5100:6: warning: ‘if constexpr’ only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
5100 | if constexpr (details::HasBasicFinalizer::value) {
| ^~~~~~~~~
../../../../../../../../../../usr/share/nodejs/node-addon-api/napi-inl.h:5110:6: warning: ‘if constexpr’ only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
5110 | if constexpr (details::HasExtendedFinalizer::value) {
| ^~~~~~~~~
g++ -o Release/obj.target/sharp-linux-x64/stats.o ../stats.cc '-DNODE_GYP_MODULE_NAME=sharp-linux-x64' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DNAPI_VERSION=9' '-DNODE_ADDON_API_DISABLE_DEPRECATED' '-DNODE_API_SWALLOW_UNTHROWABLE_EXCEPTIONS' '-DSHARP_USE_GLOBAL_LIBVIPS' '-DBUILDING_NODE_EXTENSION' -I/usr/include/nodejs/include/node -I/usr/include/nodejs/src -I/usr/include/nodejs/deps/openssl/config -I/usr/include/nodejs/deps/openssl/openssl/include -I/usr/include/nodejs/deps/uv/include -I/usr/include/nodejs/deps/zlib -I/usr/include/nodejs/deps/v8/include -I../../../../../../../../../../usr/share/nodejs/node-addon-api -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/sysprof-6 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/webp -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/x86_64-linux-gnu -I/usr/include/librsvg-2.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libxml2 -I/usr/include/hdf5/serial -I/usr/include/OpenEXR -I/usr/include/Imath -I/usr/include/openjpeg-2.5 -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -fPIC -m64 -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -fno-strict-aliasing -std=gnu++17 -std=c++0x -fexceptions -Wall -Os -MMD -MF ./Release/.deps/Release/obj.target/sharp-linux-x64/stats.o.d.raw -c
In file included from ../../../../../../../../../../usr/share/nodejs/node-addon-api/napi.h:3293,
from ../stats.cc:8:
../../../../../../../../../../usr/share/nodejs/node-addon-api/napi-inl.h: In static member function ‘static void Napi::ObjectWrap::FinalizeCallback(Napi::node_addon_api_basic_env, void*, void*)’:
../../../../../../../../../../usr/share/nodejs/node-addon-api/napi-inl.h:5100:6: warning: ‘if constexpr’ only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
5100 | if constexpr (details::HasBasicFinalizer::value) {
| ^~~~~~~~~
../../../../../../../../../../usr/share/nodejs/node-addon-api/napi-inl.h:5110:6: warning: ‘if constexpr’ only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
5110 | if constexpr (details::HasExtendedFinalizer::value) {
| ^~~~~~~~~
g++ -o Release/obj.target/sharp-linux-x64/operations.o ../operations.cc '-DNODE_GYP_MODULE_NAME=sharp-linux-x64' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DNAPI_VERSION=9' '-DNODE_ADDON_API_DISABLE_DEPRECATED' '-DNODE_API_SWALLOW_UNTHROWABLE_EXCEPTIONS' '-DSHARP_USE_GLOBAL_LIBVIPS' '-DBUILDING_NODE_EXTENSION' -I/usr/include/nodejs/include/node -I/usr/include/nodejs/src -I/usr/include/nodejs/deps/openssl/config -I/usr/include/nodejs/deps/openssl/openssl/include -I/usr/include/nodejs/deps/uv/include -I/usr/include/nodejs/deps/zlib -I/usr/include/nodejs/deps/v8/include -I../../../../../../../../../../usr/share/nodejs/node-addon-api -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/sysprof-6 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/webp -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/x86_64-linux-gnu -I/usr/include/librsvg-2.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libxml2 -I/usr/include/hdf5/serial -I/usr/include/OpenEXR -I/usr/include/Imath -I/usr/include/openjpeg-2.5 -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -fPIC -m64 -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -fno-strict-aliasing -std=gnu++17 -std=c++0x -fexceptions -Wall -Os -MMD -MF ./Release/.deps/Release/obj.target/sharp-linux-x64/operations.o.d.raw -c
In file included from ../../../../../../../../../../usr/share/nodejs/node-addon-api/napi.h:3293,
from ../common.h:12,
from ../operations.cc:11:
../../../../../../../../../../usr/share/nodejs/node-addon-api/napi-inl.h: In static member function ‘static void Napi::ObjectWrap::FinalizeCallback(Napi::node_addon_api_basic_env, void*, void*)’:
../../../../../../../../../../usr/share/nodejs/node-addon-api/napi-inl.h:5100:6: warning: ‘if constexpr’ only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
5100 | if constexpr (details::HasBasicFinalizer::value) {
| ^~~~~~~~~
../../../../../../../../../../usr/share/nodejs/node-addon-api/napi-inl.h:5110:6: warning: ‘if constexpr’ only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
5110 | if constexpr (details::HasExtendedFinalizer::value) {
| ^~~~~~~~~
g++ -o Release/obj.target/sharp-linux-x64/pipeline.o ../pipeline.cc '-DNODE_GYP_MODULE_NAME=sharp-linux-x64' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DNAPI_VERSION=9' '-DNODE_ADDON_API_DISABLE_DEPRECATED' '-DNODE_API_SWALLOW_UNTHROWABLE_EXCEPTIONS' '-DSHARP_USE_GLOBAL_LIBVIPS' '-DBUILDING_NODE_EXTENSION' -I/usr/include/nodejs/include/node -I/usr/include/nodejs/src -I/usr/include/nodejs/deps/openssl/config -I/usr/include/nodejs/deps/openssl/openssl/include -I/usr/include/nodejs/deps/uv/include -I/usr/include/nodejs/deps/zlib -I/usr/include/nodejs/deps/v8/include -I../../../../../../../../../../usr/share/nodejs/node-addon-api -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/sysprof-6 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/webp -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/x86_64-linux-gnu -I/usr/include/librsvg-2.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libxml2 -I/usr/include/hdf5/serial -I/usr/include/OpenEXR -I/usr/include/Imath -I/usr/include/openjpeg-2.5 -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -fPIC -m64 -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -fno-strict-aliasing -std=gnu++17 -std=c++0x -fexceptions -Wall -Os -MMD -MF ./Release/.deps/Release/obj.target/sharp-linux-x64/pipeline.o.d.raw -c
In file included from ../../../../../../../../../../usr/share/nodejs/node-addon-api/napi.h:3293,
from ../pipeline.cc:17:
../../../../../../../../../../usr/share/nodejs/node-addon-api/napi-inl.h: In static member function ‘static void Napi::ObjectWrap::FinalizeCallback(Napi::node_addon_api_basic_env, void*, void*)’:
../../../../../../../../../../usr/share/nodejs/node-addon-api/napi-inl.h:5100:6: warning: ‘if constexpr’ only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
5100 | if constexpr (details::HasBasicFinalizer::value) {
| ^~~~~~~~~
../../../../../../../../../../usr/share/nodejs/node-addon-api/napi-inl.h:5110:6: warning: ‘if constexpr’ only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
5110 | if constexpr (details::HasExtendedFinalizer::value) {
| ^~~~~~~~~
g++ -o Release/obj.target/sharp-linux-x64/utilities.o ../utilities.cc '-DNODE_GYP_MODULE_NAME=sharp-linux-x64' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DNAPI_VERSION=9' '-DNODE_ADDON_API_DISABLE_DEPRECATED' '-DNODE_API_SWALLOW_UNTHROWABLE_EXCEPTIONS' '-DSHARP_USE_GLOBAL_LIBVIPS' '-DBUILDING_NODE_EXTENSION' -I/usr/include/nodejs/include/node -I/usr/include/nodejs/src -I/usr/include/nodejs/deps/openssl/config -I/usr/include/nodejs/deps/openssl/openssl/include -I/usr/include/nodejs/deps/uv/include -I/usr/include/nodejs/deps/zlib -I/usr/include/nodejs/deps/v8/include -I../../../../../../../../../../usr/share/nodejs/node-addon-api -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/sysprof-6 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/webp -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/x86_64-linux-gnu -I/usr/include/librsvg-2.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libxml2 -I/usr/include/hdf5/serial -I/usr/include/OpenEXR -I/usr/include/Imath -I/usr/include/openjpeg-2.5 -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -fPIC -m64 -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -fno-strict-aliasing -std=gnu++17 -std=c++0x -fexceptions -Wall -Os -MMD -MF ./Release/.deps/Release/obj.target/sharp-linux-x64/utilities.o.d.raw -c
In file included from ../../../../../../../../../../usr/share/nodejs/node-addon-api/napi.h:3293,
from ../utilities.cc:8:
../../../../../../../../../../usr/share/nodejs/node-addon-api/napi-inl.h: In static member function ‘static void Napi::ObjectWrap::FinalizeCallback(Napi::node_addon_api_basic_env, void*, void*)’:
../../../../../../../../../../usr/share/nodejs/node-addon-api/napi-inl.h:5100:6: warning: ‘if constexpr’ only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
5100 | if constexpr (details::HasBasicFinalizer::value) {
| ^~~~~~~~~
../../../../../../../../../../usr/share/nodejs/node-addon-api/napi-inl.h:5110:6: warning: ‘if constexpr’ only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
5110 | if constexpr (details::HasExtendedFinalizer::value) {
| ^~~~~~~~~
g++ -o Release/obj.target/sharp-linux-x64/sharp.o ../sharp.cc '-DNODE_GYP_MODULE_NAME=sharp-linux-x64' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DNAPI_VERSION=9' '-DNODE_ADDON_API_DISABLE_DEPRECATED' '-DNODE_API_SWALLOW_UNTHROWABLE_EXCEPTIONS' '-DSHARP_USE_GLOBAL_LIBVIPS' '-DBUILDING_NODE_EXTENSION' -I/usr/include/nodejs/include/node -I/usr/include/nodejs/src -I/usr/include/nodejs/deps/openssl/config -I/usr/include/nodejs/deps/openssl/openssl/include -I/usr/include/nodejs/deps/uv/include -I/usr/include/nodejs/deps/zlib -I/usr/include/nodejs/deps/v8/include -I../../../../../../../../../../usr/share/nodejs/node-addon-api -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/sysprof-6 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/webp -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/x86_64-linux-gnu -I/usr/include/librsvg-2.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libxml2 -I/usr/include/hdf5/serial -I/usr/include/OpenEXR -I/usr/include/Imath -I/usr/include/openjpeg-2.5 -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -fPIC -m64 -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -fno-strict-aliasing -std=gnu++17 -std=c++0x -fexceptions -Wall -Os -MMD -MF ./Release/.deps/Release/obj.target/sharp-linux-x64/sharp.o.d.raw -c
In file included from ../../../../../../../../../../usr/share/nodejs/node-addon-api/napi.h:3293,
from ../sharp.cc:6:
../../../../../../../../../../usr/share/nodejs/node-addon-api/napi-inl.h: In static member function ‘static void Napi::ObjectWrap::FinalizeCallback(Napi::node_addon_api_basic_env, void*, void*)’:
../../../../../../../../../../usr/share/nodejs/node-addon-api/napi-inl.h:5100:6: warning: ‘if constexpr’ only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
5100 | if constexpr (details::HasBasicFinalizer::value) {
| ^~~~~~~~~
../../../../../../../../../../usr/share/nodejs/node-addon-api/napi-inl.h:5110:6: warning: ‘if constexpr’ only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
5110 | if constexpr (details::HasExtendedFinalizer::value) {
| ^~~~~~~~~
g++ -o Release/obj.target/sharp-linux-x64.node -shared -pthread -rdynamic -m64 -Wl,-soname=sharp-linux-x64.node -Wl,--start-group Release/obj.target/sharp-linux-x64/common.o Release/obj.target/sharp-linux-x64/metadata.o Release/obj.target/sharp-linux-x64/stats.o Release/obj.target/sharp-linux-x64/operations.o Release/obj.target/sharp-linux-x64/pipeline.o Release/obj.target/sharp-linux-x64/utilities.o Release/obj.target/sharp-linux-x64/sharp.o Release/obj.target/../../../../../../../../../usr/share/nodejs/node-addon-api/nothing.a -Wl,--end-group -lnode -lvips-cpp -lvips -lgio-2.0 -lgobject-2.0 -lglib-2.0
ln -f "Release/obj.target/sharp-linux-x64.node" "Release/sharp-linux-x64.node" 2>/dev/null || (rm -rf "Release/sharp-linux-x64.node" && cp -af "Release/obj.target/sharp-linux-x64.node" "Release/sharp-linux-x64.node")
touch Release/obj.target/copy-dll.stamp
make : on quitte le répertoire « what/node_modules/sharp/src/build »
gyp info ok
npm info run [email protected] install { code: 0, signal: null }

added 13 packages in 25s

5 packages are looking for funding
run npm fund for details
npm verb exit 0
npm info ok


</details>

### What is the output of running `npx envinfo --binaries --system --npmPackages=sharp --npmGlobalPackages=sharp`?
  System:
    OS: Linux 6.12 Debian GNU/Linux trixie/sid
    CPU: (4) x64 Intel(R) Core(TM) i5-2500S CPU @ 2.70GHz
    Memory: 16.66 GB / 23.45 GB
    Container: Yes
    Shell: 5.2.37 - /bin/bash
  Binaries:
    Node: 20.18.3 - /usr/bin/node
    npm: 9.2.0 - /usr/bin/npm
    pnpm: 9.15.3 - /usr/bin/pnpm

@kapouer
Copy link
Contributor Author

kapouer commented Feb 14, 2025

Something in the toolchain got updated and it broke... any clue what would that be ?

@kleisauke
Copy link
Contributor

Do you perhaps know where -std=c++0x came from? It seems that overrides -std=gnu++17 and also causes a few compile warnings like:

/usr/share/nodejs/node-addon-api/napi-inl.h:5100:6: warning: ‘if constexpr’ only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
5100 | if constexpr (details::HasBasicFinalizer::value) {
     | ^~~~~~~~~

@kleisauke
Copy link
Contributor

Ah, could you retry with commit 06b08bf or compile from the hat branch? You'll probably need to pin node-addon-api to 8.1.0 if you compile from the main branch.

@kapouer
Copy link
Contributor Author

kapouer commented Feb 17, 2025

I got confused too with node-addon-api posing problems with some other situations.
However this time it's me - I had bad nodejs development headers installed. Sorry for that.

@kapouer kapouer closed this as completed Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants