RocketChat / Rocket.Chat

The communications platform that puts data protection first.
https://rocket.chat/
Other
40.61k stars 10.61k forks source link

Installing on macOS fails with due to sharp dependency build error in 3.17.1 #22988

Closed ajmas closed 3 years ago

ajmas commented 3 years ago

Description:

Runnning npm install in the 3.17.1 branch results in a build failure in the sharp dependency. The HEAD

Steps to reproduce:

  1. Run npm install Result:
...
warning "@storybook/addon-essentials > @storybook/addon-measure@2.0.0" has unmet peer dependency "@storybook/theming@^6.3.0".
warning "@storybook/addon-essentials > @storybook/api > @reach/router@1.3.4" has incorrect peer dependency "react@15.x || 16.x || 16.4.0-alpha.0911da3".
warning "@storybook/addon-essentials > @storybook/api > @reach/router@1.3.4" has incorrect peer dependency "react-dom@15.x || 16.x || 16.4.0-alpha.0911da3".
warning "@storybook/addon-essentials > @storybook/api > @reach/router > create-react-context@0.3.0" has incorrect peer dependency "react@^0.14.0 || ^15.0.0 || ^16.0.0".
warning " > @typescript-eslint/eslint-plugin@2.34.0" has incorrect peer dependency "@typescript-eslint/parser@^2.0.0".
warning " > eslint-config-prettier@8.3.0" has incorrect peer dependency "eslint@>=7.0.0".
warning " > stylelint-order@2.2.1" has incorrect peer dependency "stylelint@^9.10.1 || ^10.0.0".
[4/4] 🔨  Building fresh packages...
[12/22] ⠁ sharp
[19/22] ⠁ cypress
[-/22] ⠁ waiting...
[-/22] ⠁ waiting...
error /Users/ajmas/Development/third-party/Rocket.Chat/node_modules/sharp: Command failed.
Exit code: 1
Command: (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
Arguments: 
Directory: /Users/ajmas/Development/third-party/Rocket.Chat/node_modules/sharp
Output:
info sharp Using cached /Users/ajmas/.npm/_libvips/libvips-8.7.4-darwin-x64.tar.gz
prebuild-install WARN install No prebuilt binaries found (target=14.15.1 runtime=node arch=x64 libc= platform=darwin)
gyp info it worked if it ends with ok
gyp info using node-gyp@5.1.0
gyp info using node@14.15.1 | darwin | x64
gyp info find Python using Python version 3.9.5 found at "/opt/local/bin/python"
gyp info spawn /opt/local/bin/python
gyp info spawn args [
gyp info spawn args   '/opt/local/lib/node_modules/npm/node_modules/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   '/Users/ajmas/Development/third-party/Rocket.Chat/node_modules/sharp/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/opt/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/ajmas/Library/Caches/node-gyp/14.15.1/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/ajmas/Library/Caches/node-gyp/14.15.1',
gyp info spawn args   '-Dnode_gyp_dir=/opt/local/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/ajmas/Library/Caches/node-gyp/14.15.1/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/ajmas/Development/third-party/Rocket.Chat/node_modules/sharp',
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 ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  TOUCH Release/obj.target/libvips-cpp.stamp
  CXX(target) Release/obj.target/sharp/src/common.o
  CXX(target) Release/obj.target/sharp/src/metadata.o
  CXX(target) Release/obj.target/sharp/src/stats.o
../src/stats.cc:130:19: error: no matching member function for call to 'Set'
        channels->Set(i, channelStat);
        ~~~~~~~~~~^~~
/Users/ajmas/Library/Caches/node-gyp/14.15.1/include/node/v8.h:3670:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/ajmas/Library/Caches/node-gyp/14.15.1/include/node/v8.h:3673:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
1 error generated.
make: *** [Release/obj.target/sharp/src/stats.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/opt/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Darwin 20.5.0
gyp ERR! command "/opt/local/bin/node" "/opt/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/ajmas/Development/third-party/Rocket.Chat/node_modules/sharp

Expected behavior:

For the npm install step to complete susccessfully.

Actual behavior:

Server Setup Information:

Client Setup Information

Additional context

Relevant logs:

ajmas commented 3 years ago

Note, using develop branch at 94ee74e532d8e7649f4889ac18f7a348b1fea2fb also fails:

~/Development/third-party/Rocket.Chat(develop) » npm install                                                                                                                ajmas@myhost

> fsevents@1.2.13 install /Users/ajmas/Development/third-party/Rocket.Chat/node_modules/fsevents
> node install.js

  SOLINK_MODULE(target) Release/.node
  CXX(target) Release/obj.target/fse/fsevents.o
In file included from ../fsevents.cc:6:
In file included from ../node_modules/nan/nan.h:2884:
../node_modules/nan/nan_typedarray_contents.h:34:43: warning: 'GetContents' is deprecated: Use GetBackingStore. See http://crbug.com/v8/9908. [-Wdeprecated-declarations]
      data   = static_cast<char*>(buffer->GetContents().Data()) + byte_offset;
                                          ^
/Users/ajmas/Library/Caches/node-gyp/14.15.1/include/node/v8.h:5265:3: note: 'GetContents' has been explicitly marked deprecated here
  V8_DEPRECATE_SOON("Use GetBackingStore. See http://crbug.com/v8/9908.")
  ^
/Users/ajmas/Library/Caches/node-gyp/14.15.1/include/node/v8config.h:402:39: note: expanded from macro 'V8_DEPRECATE_SOON'
# define V8_DEPRECATE_SOON(message) [[deprecated(message)]]
                                      ^
1 warning generated.
  SOLINK_MODULE(target) Release/fse.node

> gc-stats@1.4.0 install /Users/ajmas/Development/third-party/Rocket.Chat/node_modules/gc-stats
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download 
node-pre-gyp WARN Tried to download(403): https://node-binaries.s3.amazonaws.com/gcstats/v1.4.0/Release/node-v83-darwin-x64.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for gc-stats@1.4.0 and node@14.15.1 (node-v83 ABI, unknown) (falling back to source compile with node-gyp) 
  CXX(target) Release/obj.target/gcstats/src/gcstats.o
In file included from ../src/gcstats.cc:1:
In file included from ../node_modules/nan/nan.h:2884:
../node_modules/nan/nan_typedarray_contents.h:34:43: warning: 'GetContents' is deprecated: Use GetBackingStore. See http://crbug.com/v8/9908. [-Wdeprecated-declarations]
      data   = static_cast<char*>(buffer->GetContents().Data()) + byte_offset;
                                          ^
/Users/ajmas/Library/Caches/node-gyp/14.15.1/include/node/v8.h:5265:3: note: 'GetContents' has been explicitly marked deprecated here
  V8_DEPRECATE_SOON("Use GetBackingStore. See http://crbug.com/v8/9908.")
  ^
/Users/ajmas/Library/Caches/node-gyp/14.15.1/include/node/v8config.h:402:39: note: expanded from macro 'V8_DEPRECATE_SOON'
# define V8_DEPRECATE_SOON(message) [[deprecated(message)]]
                                      ^
1 warning generated.
  SOLINK_MODULE(target) Release/gcstats.node
  COPY /Users/ajmas/Development/third-party/Rocket.Chat/node_modules/gc-stats/build/gcstats/v1.4.0/Release/node-v83-darwin-x64/gcstats.node
  TOUCH Release/obj.target/action_after_build.stamp

> dtrace-provider@0.8.7 install /Users/ajmas/Development/third-party/Rocket.Chat/node_modules/dtrace-provider
> node-gyp rebuild || node suppress-error.js

  ACTION binding_gyp_ndtp_target_build_ndtp .
-----------------------------------------------------------------
Building dtrace-provider failed with exit code 1, falling back
on stub implementation.

Re-run install with V set in your environment to see the build
output, or NODE_DTRACE_PROVIDER_REQUIRE=hard to force an
installation failure.
-----------------------------------------------------------------
  TOUCH Release/obj.target/ndtp.stamp

> tiny-secp256k1@1.1.3 install /Users/ajmas/Development/third-party/Rocket.Chat/node_modules/tiny-secp256k1
> npm run build || echo "secp256k1 bindings compilation fail. Pure JS implementation will be used."

> tiny-secp256k1@1.1.3 build /Users/ajmas/Development/third-party/Rocket.Chat/node_modules/tiny-secp256k1
> node-gyp rebuild

  CXX(target) Release/obj.target/secp256k1/native/addon.o
In file included from ../native/addon.cpp:4:
In file included from ../node_modules/nan/nan.h:2884:
../node_modules/nan/nan_typedarray_contents.h:34:43: warning: 'GetContents' is deprecated: Use GetBackingStore. See http://crbug.com/v8/9908. [-Wdeprecated-declarations]
      data   = static_cast<char*>(buffer->GetContents().Data()) + byte_offset;
                                          ^
/Users/ajmas/Library/Caches/node-gyp/14.15.1/include/node/v8.h:5265:3: note: 'GetContents' has been explicitly marked deprecated here
  V8_DEPRECATE_SOON("Use GetBackingStore. See http://crbug.com/v8/9908.")
  ^
/Users/ajmas/Library/Caches/node-gyp/14.15.1/include/node/v8config.h:402:39: note: expanded from macro 'V8_DEPRECATE_SOON'
# define V8_DEPRECATE_SOON(message) [[deprecated(message)]]
                                      ^
../native/addon.cpp:240:2: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
        secp256k1_ec_privkey_negate(context, tweak_negated); // returns 1 always
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
../native/addon.cpp:320:34: error: no viable conversion from 'v8::Local<v8::Context>' to 'v8::Isolate *'
                strict = info[3]->BooleanValue(Nan::GetCurrentContext()).FromJust();
                                               ^~~~~~~~~~~~~~~~~~~~~~~~
/Users/ajmas/Library/Caches/node-gyp/14.15.1/include/node/v8.h:2858:30: note: passing argument to parameter 'isolate' here
  bool BooleanValue(Isolate* isolate) const;
                             ^
../native/addon.cpp:82:36: error: no viable conversion from 'v8::Local<v8::Context>' to 'v8::Isolate *'
                return info[index]->BooleanValue(Nan::GetCurrentContext()).FromJust() ? SECP256K1_EC_COMPRESSED : SECP256K1_EC_UNCOMPRESSED;
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~
../native/addon.cpp:142:21: note: in instantiation of function template specialization '(anonymous namespace)::assumeCompression<2, Nan::FunctionCallbackInfo<v8::Value>, v8::Local<v8::Object>>' requested here
        const auto flags = assumeCompression<2>(info, pA);
                           ^
/Users/ajmas/Library/Caches/node-gyp/14.15.1/include/node/v8.h:2858:30: note: passing argument to parameter 'isolate' here
  bool BooleanValue(Isolate* isolate) const;
                             ^
../native/addon.cpp:80:21: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
                if (info.Length() <= index) return __isPointCompressed(p) ? SECP256K1_EC_COMPRESSED : SECP256K1_EC_UNCOMPRESSED;
                    ~~~~~~~~~~~~~ ^  ~~~~~
../native/addon.cpp:82:36: error: no viable conversion from 'v8::Local<v8::Context>' to 'v8::Isolate *'
                return info[index]->BooleanValue(Nan::GetCurrentContext()).FromJust() ? SECP256K1_EC_COMPRESSED : SECP256K1_EC_UNCOMPRESSED;
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~
../native/addon.cpp:174:21: note: in instantiation of function template specialization '(anonymous namespace)::assumeCompression<1, Nan::FunctionCallbackInfo<v8::Value>, v8::Local<v8::Object>>' requested here
        const auto flags = assumeCompression<1>(info, p);
                           ^
/Users/ajmas/Library/Caches/node-gyp/14.15.1/include/node/v8.h:2858:30: note: passing argument to parameter 'isolate' here
  bool BooleanValue(Isolate* isolate) const;
                             ^
../native/addon.cpp:80:21: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
                if (info.Length() <= index) return __isPointCompressed(p) ? SECP256K1_EC_COMPRESSED : SECP256K1_EC_UNCOMPRESSED;
                    ~~~~~~~~~~~~~ ^  ~~~~~
../native/addon.cpp:89:36: error: no viable conversion from 'v8::Local<v8::Context>' to 'v8::Isolate *'
                return info[index]->BooleanValue(Nan::GetCurrentContext()).FromJust() ? SECP256K1_EC_COMPRESSED : SECP256K1_EC_UNCOMPRESSED;
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~
../native/addon.cpp:189:21: note: in instantiation of function template specialization '(anonymous namespace)::assumeCompression<1, Nan::FunctionCallbackInfo<v8::Value>>' requested here
        const auto flags = assumeCompression<1>(info);
                           ^
/Users/ajmas/Library/Caches/node-gyp/14.15.1/include/node/v8.h:2858:30: note: passing argument to parameter 'isolate' here
  bool BooleanValue(Isolate* isolate) const;
                             ^
../native/addon.cpp:87:21: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
                if (info.Length() <= index) return SECP256K1_EC_COMPRESSED;
                    ~~~~~~~~~~~~~ ^  ~~~~~
5 warnings and 4 errors generated.
make: *** [Release/obj.target/secp256k1/native/addon.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/opt/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Darwin 20.5.0
gyp ERR! command "/opt/local/bin/node" "/opt/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/ajmas/Development/third-party/Rocket.Chat/node_modules/tiny-secp256k1
gyp ERR! node -v v14.15.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! tiny-secp256k1@1.1.3 build: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the tiny-secp256k1@1.1.3 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/ajmas/.npm/_logs/2021-08-20T18_08_39_230Z-debug.log
secp256k1 bindings compilation fail. Pure JS implementation will be used.

> nodejieba@2.4.1 install /Users/ajmas/Development/third-party/Rocket.Chat/node_modules/nodejieba
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download 
node-pre-gyp WARN Tried to download(404): https://github.com/yanyiwu/nodejieba/releases/download/2.4.1/nodejieba-v2.4.1-node-v83-darwin-x64.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for nodejieba@2.4.1 and node@14.15.1 (node-v83 ABI, unknown) (falling back to source compile with node-gyp) 
  CXX(target) Release/obj.target/nodejieba/lib/index.o
  CXX(target) Release/obj.target/nodejieba/lib/nodejieba.o
In file included from ../lib/nodejieba.cpp:3:
In file included from ../deps/cppjieba/Jieba.hpp:4:
In file included from ../deps/cppjieba/QuerySegment.hpp:8:
In file included from ../deps/cppjieba/DictTrie.hpp:13:
../deps/limonp/StringUtil.hpp:87:70: warning: 'ptr_fun<unsigned int, bool>' is deprecated [-Wdeprecated-declarations]
  s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun<unsigned, bool>(IsSpace))));
                                                                     ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:1107:1: note: 'ptr_fun<unsigned int, bool>' has been explicitly marked deprecated here
_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:1046:39: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX11'
#  define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED
                                      ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:1035:48: note: expanded from macro '_LIBCPP_DEPRECATED'
#    define _LIBCPP_DEPRECATED __attribute__ ((deprecated))
                                               ^
In file included from ../lib/nodejieba.cpp:3:
In file included from ../deps/cppjieba/Jieba.hpp:4:
In file included from ../deps/cppjieba/QuerySegment.hpp:8:
In file included from ../deps/cppjieba/DictTrie.hpp:13:
../deps/limonp/StringUtil.hpp:92:61: warning: 'ptr_fun<unsigned int, bool>' is deprecated [-Wdeprecated-declarations]
  s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun<unsigned, bool>(IsSpace))).base(), s.end());
                                                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:1107:1: note: 'ptr_fun<unsigned int, bool>' has been explicitly marked deprecated here
_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:1046:39: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX11'
#  define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED
                                      ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:1035:48: note: expanded from macro '_LIBCPP_DEPRECATED'
#    define _LIBCPP_DEPRECATED __attribute__ ((deprecated))
                                               ^
In file included from ../lib/nodejieba.cpp:3:
In file included from ../deps/cppjieba/Jieba.hpp:4:
In file included from ../deps/cppjieba/QuerySegment.hpp:8:
In file included from ../deps/cppjieba/DictTrie.hpp:13:
../deps/limonp/StringUtil.hpp:101:70: warning: 'bind2nd<std::__1::equal_to<char>, char>' is deprecated [-Wdeprecated-declarations]
  s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::bind2nd(std::equal_to<char>(), x))));
                                                                     ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:1089:1: note: 'bind2nd<std::__1::equal_to<char>, char>' has been explicitly marked deprecated here
_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:1046:39: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX11'
#  define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED
                                      ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:1035:48: note: expanded from macro '_LIBCPP_DEPRECATED'
#    define _LIBCPP_DEPRECATED __attribute__ ((deprecated))
                                               ^
In file included from ../lib/nodejieba.cpp:3:
In file included from ../deps/cppjieba/Jieba.hpp:4:
In file included from ../deps/cppjieba/QuerySegment.hpp:8:
In file included from ../deps/cppjieba/DictTrie.hpp:13:
../deps/limonp/StringUtil.hpp:106:61: warning: 'bind2nd<std::__1::equal_to<char>, char>' is deprecated [-Wdeprecated-declarations]
  s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::bind2nd(std::equal_to<char>(), x))).base(), s.end());
                                                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:1089:1: note: 'bind2nd<std::__1::equal_to<char>, char>' has been explicitly marked deprecated here
_LIBCPP_DEPRECATED_IN_CXX11 inline _LIBCPP_INLINE_VISIBILITY
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:1046:39: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX11'
#  define _LIBCPP_DEPRECATED_IN_CXX11 _LIBCPP_DEPRECATED
                                      ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:1035:48: note: expanded from macro '_LIBCPP_DEPRECATED'
#    define _LIBCPP_DEPRECATED __attribute__ ((deprecated))
                                               ^
4 warnings generated.
  SOLINK_MODULE(target) Release/nodejieba.node

> bcrypt@5.0.1 install /Users/ajmas/Development/third-party/Rocket.Chat/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build

[bcrypt] Success: "/Users/ajmas/Development/third-party/Rocket.Chat/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node" is installed via remote

> fibers@4.0.3 install /Users/ajmas/Development/third-party/Rocket.Chat/node_modules/fibers
> node build.js || nodejs build.js

  CXX(target) Release/obj.target/fibers/src/fibers.o
  CXX(target) Release/obj.target/fibers/src/coroutine.o
  CC(target) Release/obj.target/fibers/src/libcoro/coro.o
  SOLINK_MODULE(target) Release/fibers.node
Installed in `/Users/ajmas/Development/third-party/Rocket.Chat/node_modules/fibers/bin/darwin-x64-83/fibers.node`

> sharp@0.22.1 install /Users/ajmas/Development/third-party/Rocket.Chat/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

info sharp Using cached /Users/ajmas/.npm/_libvips/libvips-8.7.4-darwin-x64.tar.gz
prebuild-install WARN install No prebuilt binaries found (target=14.15.1 runtime=node arch=x64 libc= platform=darwin)
  TOUCH Release/obj.target/libvips-cpp.stamp
  CXX(target) Release/obj.target/sharp/src/common.o
  CXX(target) Release/obj.target/sharp/src/metadata.o
  CXX(target) Release/obj.target/sharp/src/stats.o
../src/stats.cc:130:19: error: no matching member function for call to 'Set'
        channels->Set(i, channelStat);
        ~~~~~~~~~~^~~
/Users/ajmas/Library/Caches/node-gyp/14.15.1/include/node/v8.h:3670:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/ajmas/Library/Caches/node-gyp/14.15.1/include/node/v8.h:3673:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
1 error generated.
make: *** [Release/obj.target/sharp/src/stats.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/opt/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Darwin 20.5.0
gyp ERR! command "/opt/local/bin/node" "/opt/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/ajmas/Development/third-party/Rocket.Chat/node_modules/sharp
gyp ERR! node -v v14.15.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
npm WARN The package eslint-plugin-import is included as both a dev and production dependency.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp@0.22.1 install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the sharp@0.22.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/ajmas/.npm/_logs/2021-08-20T18_09_10_540Z-debug.log
ajmas commented 3 years ago

Upgrading sharp to 0.29.0 resolves the npm install issue.

Nezisi commented 3 years ago

In our build chain for rocketchat we used the latest meteor version - which is 2.3.5 ( https://install.meteor.com/ )

As meteor includes NodeJS 14 ( https://docs.meteor.com/changelog.html#v2320210624 ), this breaks all kinds of things in a non-funny way.

Fix is rather simple - grab https://install.meteor.com/ script, replace the RELEASE line with 2.2.3 instead of 2.3.5 (latest 2.2 release currently), reinstall meteor binary.

Then rerun meteor npm install.

The problem stems from linking / installing with NodeJS 14 instead of NodeJS 12.

ajmas commented 3 years ago

@Nezisi this looks unrelated to the issue reported in this ticket and therefore you should open a separate issue for this.

debdutdeb commented 3 years ago

Hi ajmas. Thanks for reporting!

I've just asked our developer team to look at this. Someone will come by as soon as he/she gets the time 😅

debdutdeb commented 3 years ago

Hi

Looks like you;re using npm i - need to use meteor npm i.

Have a read here - https://handbook.rocket.chat/product/development/development-guidelines#setup

ajmas commented 3 years ago

I'll check this and get back to you.

ajmas commented 3 years ago

I can confirm that using meteor npm i (same as meteor npm install) resolves things - thanks.

At the same time, would it be worth upgrading the sharp package version dependency?

debdutdeb commented 3 years ago

I can confirm that using meteor npm i (same as meteor npm install) resolves things

Awesome ! Closing the issue then :)

would it be worth upgrading the sharp package version dependency?

Something I can't comment on - mostly because I have no idea 😶

You can send a message on https://open.rocket.chat/channel/dev - some developer might be able to answer this there.