Giter VIP home page Giter VIP logo

Comments (23)

SkeLLLa avatar SkeLLLa commented on June 10, 2024 1

@juanpicado It uses here:
https://github.com/stephenplusplus/hash-stream-validation/blob/46449b8c8a361a5eb6a40be4496832a1a242227f/index.js#L5

And if there's no such lib it will use standard one.

And it is used in download: https://github.com/googleapis/nodejs-storage/blob/f24439dc2be7c6764d539902b3200e053b26ae96/src/file.ts#L1188

https://github.com/googleapis/nodejs-storage/blob/f24439dc2be7c6764d539902b3200e053b26ae96/src/file.ts#L1302

from verdaccio-google-cloud.

DanielRuf avatar DanielRuf commented on June 10, 2024

Hi @SkeLLLa,

So you mean that there is an unused package / dependency?

from verdaccio-google-cloud.

SkeLLLa avatar SkeLLLa commented on June 10, 2024

Looks like. And it's binary package dependency that cause some troubles.

from verdaccio-google-cloud.

DanielRuf avatar DanielRuf commented on June 10, 2024

Yes, it is used for the defaultValidation, see https://github.com/verdaccio/verdaccio-google-cloud/search?utf8=%E2%9C%93&q=crc32c&type=

from verdaccio-google-cloud.

DanielRuf avatar DanielRuf commented on June 10, 2024

Which exact issues did you face?

from verdaccio-google-cloud.

SkeLLLa avatar SkeLLLa commented on June 10, 2024

@DanielRuf according to fast-crc32c docs it should used via require:
https://github.com/ashi009/node-fast-crc32c#usage

And actually there should be .calculate call, which is not present in this repo.

Which exact issues did you face?
That pretty easy. It fails to compile from sources when you're doing npm i.

from verdaccio-google-cloud.

DanielRuf avatar DanielRuf commented on June 10, 2024

That pretty easy. It fails to compile from sources when you're doing npm i.

Please provide the error that you are facing. From the terminal output or logfile of npm / yarn.

from verdaccio-google-cloud.

DanielRuf avatar DanielRuf commented on June 10, 2024

See https://github.com/googleapis/nodejs-storage/search?utf8=%E2%9C%93&q=fast-crc32c&type= for the details about the usage by @google-cloud/storage.

from verdaccio-google-cloud.

SkeLLLa avatar SkeLLLa commented on June 10, 2024

There are too much logs up there, but I think it's easy to reproduce using node 12. Here's the end of logs:

make: *** [sse4_crc32.target.mk:111: Release/obj.target/sse4_crc32/src/crc32c.o] Error 1
make: Leaving directory '/home/user/.nvm/versions/node/v12.1.0/lib/node_modules/fast-crc32c/node_modules/sse4_crc32/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/user/.nvm/versions/node/v12.1.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:196:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:256:12)
gyp ERR! System Linux 5.1.0-pf3

Also it produces deprecation warnings:

npm WARN deprecated [email protected]: Critical bug fixed in v2.0.1, please upgrade to the latest version.
npm WARN deprecated [email protected]: Critical bug fixed in v3.0.1, please upgrade to the latest version.
npm WARN deprecated [email protected]: Critical bug fixed in v3.0.1, please upgrade to the latest version.

Also on node 10 it produces deprecation warning during compilation as well:

In file included from ../src/crc32c.cpp:18:
../node_modules/nan/nan.h: In function 'void Nan::AsyncQueueWorker(Nan::AsyncWorker*)':
../node_modules/nan/nan.h:2200:62: warning: cast between incompatible function types from 'void (*)(uv_work_t*)' {aka 'void (*)(uv_work_s*)'} to 'uv_after_work_cb' {aka 'void (*)(uv_work_s*, int)'} [-Wcast-function-type]
     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
                                                              ^
../src/crc32c.cpp: In function 'Nan::NAN_METHOD_RETURN_TYPE calculateCrc(Nan::NAN_METHOD_ARGS_TYPE)':
../src/crc32c.cpp:203:40: warning: 'uint32_t v8::Value::Uint32Value() const' is deprecated: Use maybe version [-Wdeprecated-declarations]
         initCrc = info[2]->Uint32Value();
                                        ^
In file included from /opt/verdaccio/.node-gyp/10.15.3/include/node/v8.h:26,
                 from /opt/verdaccio/.node-gyp/10.15.3/include/node/node.h:63,
                 from ../node_modules/nan/nan.h:52,
                 from ../src/crc32c.cpp:18:
/opt/verdaccio/.node-gyp/10.15.3/include/node/v8.h:2477:47: note: declared here
   V8_DEPRECATED("Use maybe version", uint32_t Uint32Value() const);
                                               ^~~~~~~~~~~
/opt/verdaccio/.node-gyp/10.15.3/include/node/v8config.h:324:3: note: in definition of macro 'V8_DEPRECATED'
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/crc32c.cpp:210:47: warning: 'v8::Local<v8::Object> v8::Value::ToObject() const' is deprecated: Use maybe version [-Wdeprecated-declarations]
         Local<Object> buf = info[1]->ToObject();
                                               ^
In file included from /opt/verdaccio/.node-gyp/10.15.3/include/node/node.h:63,
                 from ../node_modules/nan/nan.h:52,
                 from ../src/crc32c.cpp:18:
/opt/verdaccio/.node-gyp/10.15.3/include/node/v8.h:10046:15: note: declared here
 Local<Object> Value::ToObject() const {
               ^~~~~
In file included from ../node_modules/nan/nan.h:52,
                 from ../src/crc32c.cpp:18:
../src/crc32c.cpp: At global scope:
/opt/verdaccio/.node-gyp/10.15.3/include/node/node.h:570:43: warning: cast between incompatible function types from 'void (*)(v8::Local<v8::Object>)' to 'node::addon_register_func' {aka 'void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)'} [-Wcast-function-type]
       (node::addon_register_func) (regfunc),                          \
                                           ^
/opt/verdaccio/.node-gyp/10.15.3/include/node/node.h:604:3: note: in expansion of macro 'NODE_MODULE_X'
   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
   ^~~~~~~~~~~~~
../src/crc32c.cpp:247:1: note: in expansion of macro 'NODE_MODULE'
 NODE_MODULE(sse4_crc32, init)
 ^~~~~~~~~~~
In file included from /opt/verdaccio/.node-gyp/10.15.3/include/node/node.h:63,
                 from ../node_modules/nan/nan.h:52,
                 from ../src/crc32c.cpp:18:
/opt/verdaccio/.node-gyp/10.15.3/include/node/v8.h: In instantiation of 'void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)]':
/opt/verdaccio/.node-gyp/10.15.3/include/node/node_object_wrap.h:85:78:   required from here
/opt/verdaccio/.node-gyp/10.15.3/include/node/v8.h:9502:16: warning: cast between incompatible function types from 'v8::WeakCallbackInfo<node::ObjectWrap>::Callback' {aka 'void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)'} to 'Callback' {aka 'void (*)(const v8::WeakCallbackInfo<void>&)'} [-Wcast-function-type]
                reinterpret_cast<Callback>(callback), type);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/verdaccio/.node-gyp/10.15.3/include/node/v8.h: In instantiation of 'void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)]':
../node_modules/nan/nan_object_wrap.h:66:61:   required from here
/opt/verdaccio/.node-gyp/10.15.3/include/node/v8.h:9502:16: warning: cast between incompatible function types from 'v8::WeakCallbackInfo<Nan::ObjectWrap>::Callback' {aka 'void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)'} to 'Callback' {aka 'void (*)(const v8::WeakCallbackInfo<void>&)'} [-Wcast-function-type]

@DanielRuf yes I saw and in such usecase it should be definitely a peer-dependency of cloud-storage plugin, but not main dependency. Cause actual benefit from using this lib could count in milliseconds. But in order to build that library from scratch it takes much more time.

from verdaccio-google-cloud.

DanielRuf avatar DanielRuf commented on June 10, 2024

Warnings can be safely ignored.
The actual error is a few lines above. Often python2 is not defined in PATH. The last lines do not help us to solve your issue.

from verdaccio-google-cloud.

SkeLLLa avatar SkeLLLa commented on June 10, 2024

In my case python2 is defined. The error related to things that were deprecated in node 10 and removed in node 12.

from verdaccio-google-cloud.

DanielRuf avatar DanielRuf commented on June 10, 2024

Cause actual benefit from using this lib could count in milliseconds. But in order to build that library from scratch it takes much more time.

The build step is a onetime action. Well, this is how node-gyp is supposed to work. It takes time to compile C++ code against new Node headers for your platform.

There were probably good reasons to add it as normal dependency.

from verdaccio-google-cloud.

DanielRuf avatar DanielRuf commented on June 10, 2024

The error related to things that were deprecated in node 10 and removed in node 12.

Still, we need the actual error / more lines. Warnings are not errors.

from verdaccio-google-cloud.

SkeLLLa avatar SkeLLLa commented on June 10, 2024

There were probably good reasons to add it as normal dependency as this can prevent content musmatch errors and other issues like it is described in the storage repository of Google.

No. It just used as "faster" replacement of native js crc32c implementation and google storage works without it.

Still, we need the actual error / more lines. Warnings are not errors.

Here it is (with link to original bug of underlying library anandsuresh/sse4_crc32#74):

In file included from ../../nan/nan_converters.h:67,
                 from ../../nan/nan.h:221,
                 from ../src/crc32c.cpp:18:
../../nan/nan_converters_43_inl.h: In static member function ‘static Nan::imp::ToFactoryBase<v8::Boolean>::return_t Nan::imp::ToFactory<v8::Boolean>::convert(v8::Local<v8::Value>)’:
../../nan/nan_converters_43_inl.h:18:51: warning: ‘v8::MaybeLocal<v8::Boolean> v8::Value::ToBoolean(v8::Local<v8::Context>) const’ is deprecated: ToBoolean can never throw. Use Local version. [-Wdeprecated-declarations]
       val->To ## TYPE(isolate->GetCurrentContext())                            \
                                                   ^
../../nan/nan_converters_43_inl.h:22:1: note: in expansion of macro ‘X’
 X(Boolean)
 ^
In file included from /home/m03geek/.node-gyp/12.1.0/include/node/v8-internal.h:14,
                 from /home/m03geek/.node-gyp/12.1.0/include/node/v8.h:25,
                 from /home/m03geek/.node-gyp/12.1.0/include/node/node.h:63,
                 from ../../nan/nan.h:52,
                 from ../src/crc32c.cpp:18:
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:2524:63: note: declared here
                     V8_WARN_UNUSED_RESULT MaybeLocal<Boolean> ToBoolean(
                                                               ^~~~~~~~~
/home/m03geek/.node-gyp/12.1.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
In file included from ../../nan/nan_converters.h:67,
                 from ../../nan/nan.h:221,
                 from ../src/crc32c.cpp:18:
../../nan/nan_converters_43_inl.h: In static member function ‘static Nan::imp::ValueFactoryBase<bool>::return_t Nan::imp::ToFactory<bool>::convert(v8::Local<v8::Value>)’:
../../nan/nan_converters_43_inl.h:37:57: warning: ‘v8::Maybe<bool> v8::Value::BooleanValue(v8::Local<v8::Context>) const’ is deprecated: BooleanValue can never throw. Use Isolate version. [-Wdeprecated-declarations]
   return val->NAME ## Value(isolate->GetCurrentContext());                     \
                                                         ^
../../nan/nan_converters_43_inl.h:40:1: note: in expansion of macro ‘X’
 X(bool, Boolean)
 ^
In file included from /home/m03geek/.node-gyp/12.1.0/include/node/v8-internal.h:14,
                 from /home/m03geek/.node-gyp/12.1.0/include/node/v8.h:25,
                 from /home/m03geek/.node-gyp/12.1.0/include/node/node.h:63,
                 from ../../nan/nan.h:52,
                 from ../src/crc32c.cpp:18:
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:2562:51: note: declared here
                 V8_WARN_UNUSED_RESULT Maybe<bool> BooleanValue(
                                                   ^~~~~~~~~~~~
/home/m03geek/.node-gyp/12.1.0/include/node/v8config.h:307:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
In file included from ../../nan/nan_new.h:189,
                 from ../../nan/nan.h:222,
                 from ../src/crc32c.cpp:18:
../../nan/nan_implementation_12_inl.h: In static member function ‘static Nan::imp::FactoryBase<v8::Function>::return_t Nan::imp::Factory<v8::Function>::New(Nan::FunctionCallback, v8::Local<v8::Value>)’:
../../nan/nan_implementation_12_inl.h:105:32: error: no matching function for call to ‘v8::Function::New(v8::Isolate*&, void (&)(const v8::FunctionCallbackInfo<v8::Value>&), v8::Local<v8::Object>&)’
                           , obj));
                                ^
In file included from /home/m03geek/.node-gyp/12.1.0/include/node/node.h:63,
                 from ../../nan/nan.h:52,
                 from ../src/crc32c.cpp:18:
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:4125:31: note: candidate: ‘static v8::MaybeLocal<v8::Function> v8::Function::New(v8::Local<v8::Context>, v8::FunctionCallback, v8::Local<v8::Value>, int, v8::ConstructorBehavior, v8::SideEffectType)’
   static MaybeLocal<Function> New(
                               ^~~
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:4125:31: note:   no known conversion for argument 1 from ‘v8::Isolate*’ to ‘v8::Local<v8::Context>’
In file included from ../../nan/nan_new.h:189,
                 from ../../nan/nan.h:222,
                 from ../src/crc32c.cpp:18:
../../nan/nan_implementation_12_inl.h: In static member function ‘static Nan::imp::FactoryBase<v8::StringObject>::return_t Nan::imp::Factory<v8::StringObject>::New(v8::Local<v8::String>)’:
../../nan/nan_implementation_12_inl.h:337:37: error: no matching function for call to ‘v8::StringObject::New(v8::Local<v8::String>&)’
   return v8::StringObject::New(value).As<v8::StringObject>();
                                     ^
In file included from /home/m03geek/.node-gyp/12.1.0/include/node/node.h:63,
                 from ../../nan/nan.h:52,
                 from ../src/crc32c.cpp:18:
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:5380:23: note: candidate: ‘static v8::Local<v8::Value> v8::StringObject::New(v8::Isolate*, v8::Local<v8::String>)’
   static Local<Value> New(Isolate* isolate, Local<String> value);
                       ^~~
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:5380:23: note:   candidate expects 2 arguments, 1 provided
In file included from ../../nan/nan_new.h:189,
                 from ../../nan/nan.h:222,
                 from ../src/crc32c.cpp:18:
../../nan/nan_implementation_12_inl.h:337:58: error: expected primary-expression before ‘>’ token
   return v8::StringObject::New(value).As<v8::StringObject>();
                                                          ^
../../nan/nan_implementation_12_inl.h:337:60: error: expected primary-expression before ‘)’ token
   return v8::StringObject::New(value).As<v8::StringObject>();
                                                            ^
In file included from ../src/crc32c.cpp:18:
../../nan/nan.h: In constructor ‘Nan::Utf8String::Utf8String(v8::Local<v8::Value>)’:
../../nan/nan.h:1063:53: error: no matching function for call to ‘v8::Value::ToString()’
       v8::Local<v8::String> string = from->ToString();
                                                     ^
In file included from /home/m03geek/.node-gyp/12.1.0/include/node/node.h:63,
                 from ../../nan/nan.h:52,
                 from ../src/crc32c.cpp:18:
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:2528:44: note: candidate: ‘v8::MaybeLocal<v8::String> v8::Value::ToString(v8::Local<v8::Context>) const’
   V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(
                                            ^~~~~~~~
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:2528:44: note:   candidate expects 1 argument, 0 provided
In file included from /home/m03geek/.node-gyp/12.1.0/include/node/v8-internal.h:14,
                 from /home/m03geek/.node-gyp/12.1.0/include/node/v8.h:25,
                 from /home/m03geek/.node-gyp/12.1.0/include/node/node.h:63,
                 from ../../nan/nan.h:52,
                 from ../src/crc32c.cpp:18:
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:2544:35: note: candidate: ‘v8::Local<v8::String> v8::Value::ToString(v8::Isolate*) const’
                     Local<String> ToString(Isolate* isolate) const);
                                   ^~~~~~~~
/home/m03geek/.node-gyp/12.1.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:2544:35: note:   candidate expects 1 argument, 0 provided
                     Local<String> ToString(Isolate* isolate) const);
                                   ^~~~~~~~
/home/m03geek/.node-gyp/12.1.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
In file included from ../src/crc32c.cpp:18:
../../nan/nan.h:1073:74: error: no matching function for call to ‘v8::String::WriteUtf8(char*&, int, int, const int&)’
         length_ = string->WriteUtf8(str_, static_cast<int>(len), 0, flags);
                                                                          ^
In file included from /home/m03geek/.node-gyp/12.1.0/include/node/node.h:63,
                 from ../../nan/nan.h:52,
                 from ../src/crc32c.cpp:18:
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:2738:7: note: candidate: ‘int v8::String::WriteUtf8(v8::Isolate*, char*, int, int*, int) const’
   int WriteUtf8(Isolate* isolate, char* buffer, int length = -1,
       ^~~~~~~~~
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:2738:7: note:   no known conversion for argument 1 from ‘char*’ to ‘v8::Isolate*’
In file included from ../src/crc32c.cpp:18:
../../nan/nan.h: In member function ‘void Nan::AsyncWorker::SaveToPersistent(const char*, const v8::Local<v8::Value>&)’:
../../nan/nan.h:1847:64: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
     New(persistentHandle)->Set(New(key).ToLocalChecked(), value);
                                                                ^
In file included from /home/m03geek/.node-gyp/12.1.0/include/node/v8-internal.h:14,
                 from /home/m03geek/.node-gyp/12.1.0/include/node/v8.h:25,
                 from /home/m03geek/.node-gyp/12.1.0/include/node/node.h:63,
                 from ../../nan/nan.h:52,
                 from ../src/crc32c.cpp:18:
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:3359:26: note: declared here
                     bool Set(Local<Value> key, Local<Value> value));
                          ^~~
/home/m03geek/.node-gyp/12.1.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
In file included from ../src/crc32c.cpp:18:
../../nan/nan.h: In member function ‘void Nan::AsyncWorker::SaveToPersistent(const v8::Local<v8::String>&, const v8::Local<v8::Value>&)’:
../../nan/nan.h:1853:42: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
     New(persistentHandle)->Set(key, value);
                                          ^
In file included from /home/m03geek/.node-gyp/12.1.0/include/node/v8-internal.h:14,
                 from /home/m03geek/.node-gyp/12.1.0/include/node/v8.h:25,
                 from /home/m03geek/.node-gyp/12.1.0/include/node/node.h:63,
                 from ../../nan/nan.h:52,
                 from ../src/crc32c.cpp:18:
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:3359:26: note: declared here
                     bool Set(Local<Value> key, Local<Value> value));
                          ^~~
/home/m03geek/.node-gyp/12.1.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
In file included from ../src/crc32c.cpp:18:
../../nan/nan.h: In member function ‘void Nan::AsyncWorker::SaveToPersistent(uint32_t, const v8::Local<v8::Value>&)’:
../../nan/nan.h:1859:44: warning: ‘bool v8::Object::Set(uint32_t, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
     New(persistentHandle)->Set(index, value);
                                            ^
In file included from /home/m03geek/.node-gyp/12.1.0/include/node/v8-internal.h:14,
                 from /home/m03geek/.node-gyp/12.1.0/include/node/v8.h:25,
                 from /home/m03geek/.node-gyp/12.1.0/include/node/node.h:63,
                 from ../../nan/nan.h:52,
                 from ../src/crc32c.cpp:18:
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:3368:26: note: declared here
                     bool Set(uint32_t index, Local<Value> value));
                          ^~~
/home/m03geek/.node-gyp/12.1.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
In file included from ../src/crc32c.cpp:18:
../../nan/nan.h: In member function ‘v8::Local<v8::Value> Nan::AsyncWorker::GetFromPersistent(const char*) const’:
../../nan/nan.h:1865:61: warning: ‘v8::Local<v8::Value> v8::Object::Get(v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
         New(persistentHandle)->Get(New(key).ToLocalChecked()));
                                                             ^
In file included from /home/m03geek/.node-gyp/12.1.0/include/node/v8-internal.h:14,
                 from /home/m03geek/.node-gyp/12.1.0/include/node/v8.h:25,
                 from /home/m03geek/.node-gyp/12.1.0/include/node/node.h:63,
                 from ../../nan/nan.h:52,
                 from ../src/crc32c.cpp:18:
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:3412:55: note: declared here
   V8_DEPRECATE_SOON("Use maybe version", Local<Value> Get(Local<Value> key));
                                                       ^~~
/home/m03geek/.node-gyp/12.1.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
In file included from ../src/crc32c.cpp:18:
../../nan/nan.h: In member function ‘v8::Local<v8::Value> Nan::AsyncWorker::GetFromPersistent(const v8::Local<v8::String>&) const’:
../../nan/nan.h:1871:55: warning: ‘v8::Local<v8::Value> v8::Object::Get(v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
     return scope.Escape(New(persistentHandle)->Get(key));
                                                       ^
In file included from /home/m03geek/.node-gyp/12.1.0/include/node/v8-internal.h:14,
                 from /home/m03geek/.node-gyp/12.1.0/include/node/v8.h:25,
                 from /home/m03geek/.node-gyp/12.1.0/include/node/node.h:63,
                 from ../../nan/nan.h:52,
                 from ../src/crc32c.cpp:18:
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:3412:55: note: declared here
   V8_DEPRECATE_SOON("Use maybe version", Local<Value> Get(Local<Value> key));
                                                       ^~~
/home/m03geek/.node-gyp/12.1.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
In file included from ../src/crc32c.cpp:18:
../../nan/nan.h: In member function ‘v8::Local<v8::Value> Nan::AsyncWorker::GetFromPersistent(uint32_t) const’:
../../nan/nan.h:1876:57: warning: ‘v8::Local<v8::Value> v8::Object::Get(uint32_t)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
     return scope.Escape(New(persistentHandle)->Get(index));
                                                         ^
In file included from /home/m03geek/.node-gyp/12.1.0/include/node/v8-internal.h:14,
                 from /home/m03geek/.node-gyp/12.1.0/include/node/v8.h:25,
                 from /home/m03geek/.node-gyp/12.1.0/include/node/node.h:63,
                 from ../../nan/nan.h:52,
                 from ../src/crc32c.cpp:18:
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:3416:55: note: declared here
   V8_DEPRECATE_SOON("Use maybe version", Local<Value> Get(uint32_t index));
                                                       ^~~
/home/m03geek/.node-gyp/12.1.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
In file included from ../src/crc32c.cpp:18:
../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../nan/nan.h:2200:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
                                                              ^
In file included from ../../nan/nan.h:2690,
                 from ../src/crc32c.cpp:18:
../../nan/nan_object_wrap.h: In member function ‘void Nan::ObjectWrap::MakeWeak()’:
../../nan/nan_object_wrap.h:67:34: warning: ‘void v8::PersistentBase<T>::MarkIndependent() [with T = v8::Object]’ is deprecated: Weak objects are always considered independent. Use TracedGlobal when trying to use EmbedderHeapTracer. Use a strong handle when trying to keep an object alive. [-Wdeprecated-declarations]
     persistent().MarkIndependent();
                                  ^
In file included from /home/m03geek/.node-gyp/12.1.0/include/node/v8-internal.h:14,
                 from /home/m03geek/.node-gyp/12.1.0/include/node/v8.h:25,
                 from /home/m03geek/.node-gyp/12.1.0/include/node/node.h:63,
                 from ../../nan/nan.h:52,
                 from ../src/crc32c.cpp:18:
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:567:22: note: declared here
       V8_INLINE void MarkIndependent());
                      ^~~~~~~~~~~~~~~
/home/m03geek/.node-gyp/12.1.0/include/node/v8config.h:307:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/crc32c.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE calculateCrc(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/crc32c.cpp:195:44: error: no matching function for call to ‘v8::Value::BooleanValue()’
     useHardwareCrc = info[0]->BooleanValue();
                                            ^
In file included from /home/m03geek/.node-gyp/12.1.0/include/node/node.h:63,
                 from ../../nan/nan.h:52,
                 from ../src/crc32c.cpp:18:
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:2559:8: note: candidate: ‘bool v8::Value::BooleanValue(v8::Isolate*) const’
   bool BooleanValue(Isolate* isolate) const;
        ^~~~~~~~~~~~
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:2559:8: note:   candidate expects 1 argument, 0 provided
In file included from /home/m03geek/.node-gyp/12.1.0/include/node/v8-internal.h:14,
                 from /home/m03geek/.node-gyp/12.1.0/include/node/v8.h:25,
                 from /home/m03geek/.node-gyp/12.1.0/include/node/node.h:63,
                 from ../../nan/nan.h:52,
                 from ../src/crc32c.cpp:18:
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:2562:51: note: candidate: ‘v8::Maybe<bool> v8::Value::BooleanValue(v8::Local<v8::Context>) const’
                 V8_WARN_UNUSED_RESULT Maybe<bool> BooleanValue(
                                                   ^~~~~~~~~~~~
/home/m03geek/.node-gyp/12.1.0/include/node/v8config.h:307:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:2562:51: note:   candidate expects 1 argument, 0 provided
                 V8_WARN_UNUSED_RESULT Maybe<bool> BooleanValue(
                                                   ^~~~~~~~~~~~
/home/m03geek/.node-gyp/12.1.0/include/node/v8config.h:307:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/crc32c.cpp:203:40: error: no matching function for call to ‘v8::Value::Uint32Value()’
         initCrc = info[2]->Uint32Value();
                                        ^
In file included from /home/m03geek/.node-gyp/12.1.0/include/node/node.h:63,
                 from ../../nan/nan.h:52,
                 from ../src/crc32c.cpp:18:
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:2567:41: note: candidate: ‘v8::Maybe<unsigned int> v8::Value::Uint32Value(v8::Local<v8::Context>) const’
   V8_WARN_UNUSED_RESULT Maybe<uint32_t> Uint32Value(
                                         ^~~~~~~~~~~
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:2567:41: note:   candidate expects 1 argument, 0 provided
../src/crc32c.cpp:210:47: error: no matching function for call to ‘v8::Value::ToObject()’
         Local<Object> buf = info[1]->ToObject();
                                               ^
In file included from /home/m03geek/.node-gyp/12.1.0/include/node/node.h:63,
                 from ../../nan/nan.h:52,
                 from ../src/crc32c.cpp:18:
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:2532:44: note: candidate: ‘v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const’
   V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
                                            ^~~~~~~~
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:2532:44: note:   candidate expects 1 argument, 0 provided
In file included from /home/m03geek/.node-gyp/12.1.0/include/node/v8-internal.h:14,
                 from /home/m03geek/.node-gyp/12.1.0/include/node/v8.h:25,
                 from /home/m03geek/.node-gyp/12.1.0/include/node/node.h:63,
                 from ../../nan/nan.h:52,
                 from ../src/crc32c.cpp:18:
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:2546:35: note: candidate: ‘v8::Local<v8::Object> v8::Value::ToObject(v8::Isolate*) const’
                     Local<Object> ToObject(Isolate* isolate) const);
                                   ^~~~~~~~
/home/m03geek/.node-gyp/12.1.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:2546:35: note:   candidate expects 1 argument, 0 provided
                     Local<Object> ToObject(Isolate* isolate) const);
                                   ^~~~~~~~
/home/m03geek/.node-gyp/12.1.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/crc32c.cpp:221:52: error: no matching function for call to ‘v8::Value::ToString()’
         Local<String> strInput = info[1]->ToString();
                                                    ^
In file included from /home/m03geek/.node-gyp/12.1.0/include/node/node.h:63,
                 from ../../nan/nan.h:52,
                 from ../src/crc32c.cpp:18:
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:2528:44: note: candidate: ‘v8::MaybeLocal<v8::String> v8::Value::ToString(v8::Local<v8::Context>) const’
   V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(
                                            ^~~~~~~~
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:2528:44: note:   candidate expects 1 argument, 0 provided
In file included from /home/m03geek/.node-gyp/12.1.0/include/node/v8-internal.h:14,
                 from /home/m03geek/.node-gyp/12.1.0/include/node/v8.h:25,
                 from /home/m03geek/.node-gyp/12.1.0/include/node/node.h:63,
                 from ../../nan/nan.h:52,
                 from ../src/crc32c.cpp:18:
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:2544:35: note: candidate: ‘v8::Local<v8::String> v8::Value::ToString(v8::Isolate*) const’
                     Local<String> ToString(Isolate* isolate) const);
                                   ^~~~~~~~
/home/m03geek/.node-gyp/12.1.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:2544:35: note:   candidate expects 1 argument, 0 provided
                     Local<String> ToString(Isolate* isolate) const);
                                   ^~~~~~~~
/home/m03geek/.node-gyp/12.1.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../src/crc32c.cpp:224:110: error: no matching function for call to ‘v8::String::Utf8Length()’
 c = hwCrc32c(initCrc, (const char *)(*Nan::Utf8String(strInput)), (size_t)strInput->Utf8Length());
                                                                                                ^

In file included from /home/m03geek/.node-gyp/12.1.0/include/node/node.h:63,
                 from ../../nan/nan.h:52,
                 from ../src/crc32c.cpp:18:
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:2678:7: note: candidate: ‘int v8::String::Utf8Length(v8::Isolate*) const’
   int Utf8Length(Isolate* isolate) const;
       ^~~~~~~~~~
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:2678:7: note:   candidate expects 1 argument, 0 provided
../src/crc32c.cpp:226:110: error: no matching function for call to ‘v8::String::Utf8Length()’
 c = swCrc32c(initCrc, (const char *)(*Nan::Utf8String(strInput)), (size_t)strInput->Utf8Length());
                                                                                                ^

In file included from /home/m03geek/.node-gyp/12.1.0/include/node/node.h:63,
                 from ../../nan/nan.h:52,
                 from ../src/crc32c.cpp:18:
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:2678:7: note: candidate: ‘int v8::String::Utf8Length(v8::Isolate*) const’
   int Utf8Length(Isolate* isolate) const;
       ^~~~~~~~~~
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:2678:7: note:   candidate expects 1 argument, 0 provided
In file included from ../../nan/nan.h:52,
                 from ../src/crc32c.cpp:18:
../src/crc32c.cpp: At global scope:
/home/m03geek/.node-gyp/12.1.0/include/node/node.h:556:43: warning: cast between incompatible function types from ‘void (*)(v8::Local<v8::Object>)’ to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
       (node::addon_register_func) (regfunc),                          \
                                           ^
/home/m03geek/.node-gyp/12.1.0/include/node/node.h:590:3: note: in expansion of macro ‘NODE_MODULE_X’
   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
   ^~~~~~~~~~~~~
../src/crc32c.cpp:247:1: note: in expansion of macro ‘NODE_MODULE’
 NODE_MODULE(sse4_crc32, init)
 ^~~~~~~~~~~
In file included from /home/m03geek/.node-gyp/12.1.0/include/node/node.h:63,
                 from ../../nan/nan.h:52,
                 from ../src/crc32c.cpp:18:
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)]’:
/home/m03geek/.node-gyp/12.1.0/include/node/node_object_wrap.h:84:78:   required from here
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:9817:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<node::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
                reinterpret_cast<Callback>(callback), type);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)]’:
../../nan/nan_object_wrap.h:66:61:   required from here
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:9817:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<Nan::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
In file included from ../src/crc32c.cpp:18:
../../nan/nan.h: In instantiation of ‘void Nan::imp::SetMethodAux(T, v8::Local<v8::String>, v8::Local<v8::FunctionTemplate>, ...) [with T = v8::Local<v8::Object>]’:
../../nan/nan.h:2386:20:   required from ‘void Nan::SetMethod(HandleType<T>, const char*, Nan::FunctionCallback) [with T = v8::Object; HandleType = v8::Local; Nan::FunctionCallback = void (*)(const Nan::FunctionCallbackInfo<v8::Value>&)]’
../src/crc32c.cpp:242:77:   required from here
../../nan/nan.h:2370:3: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
   recv->Set(name, GetFunction(tpl).ToLocalChecked());
   ^~~~
In file included from /home/m03geek/.node-gyp/12.1.0/include/node/v8-internal.h:14,
                 from /home/m03geek/.node-gyp/12.1.0/include/node/v8.h:25,
                 from /home/m03geek/.node-gyp/12.1.0/include/node/node.h:63,
                 from ../../nan/nan.h:52,
                 from ../src/crc32c.cpp:18:
/home/m03geek/.node-gyp/12.1.0/include/node/v8.h:3359:26: note: declared here
                     bool Set(Local<Value> key, Local<Value> value));
                          ^~~
/home/m03geek/.node-gyp/12.1.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
make: *** [sse4_crc32.target.mk:111: Release/obj.target/sse4_crc32/src/crc32c.o] Error 1
make: Leaving directory '/home/m03geek/dev/os/node-fast-crc32c/node_modules/sse4_crc32/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/m03geek/.nvm/versions/node/v12.1.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:196:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:256:12)
gyp ERR! System Linux 5.1.0-pf3
gyp ERR! command "/home/m03geek/.nvm/versions/node/v12.1.0/bin/node" "/home/m03geek/.nvm/versions/node/v12.1.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/m03geek/dev/os/node-fast-crc32c/node_modules/sse4_crc32
gyp ERR! node -v v12.1.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/sse4_crc32):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

So the following library is:

  • Not maintained
  • Uses deprecated APIs of node and V8
  • Google storage works without it and recommends it only "For faster crc32c computation, you must manually install fast-crc32c"

So I think it's perfect candidate to be optional dependency, not mandatory.

from verdaccio-google-cloud.

DanielRuf avatar DanielRuf commented on June 10, 2024

The issue comes from sse4-crc32.

See anandsuresh/sse4_crc32#74

Try downgrading to 10 LTS (12 is stable, not LTS) or try npm install --no-optional.

We will check the fast-crc32c dependency to see if we can remove it.

from verdaccio-google-cloud.

juanpicado avatar juanpicado commented on June 10, 2024

It seems this dependency is needed whether resumsable on upload files is enabled.

* You can specify whether or not an upload is resumable by setting
   * `options.resumable`. *Resumable uploads are enabled by default if your
   * input file is larger than 5 MB.*
   *
   * For faster crc32c computation, you must manually install
   * [`fast-crc32c`](http://www.gitnpm.com/fast-crc32c):
   *
   *     $ npm install --save fast-crc32c
   *

https://github.com/googleapis/nodejs-storage/blob/788113ac6c0922ba458fcef729d2d93f340a0381/src/bucket.ts#L2927

from verdaccio-google-cloud.

DanielRuf avatar DanielRuf commented on June 10, 2024

It seems this dependency is needed whether resumsable on upload files is enabled.

Not really as it is only a "faster" replacement. According to @SkeLLLa it also should work without it.

from verdaccio-google-cloud.

juanpicado avatar juanpicado commented on June 10, 2024

Then :) we have only one option. PR. But I would go with a feat:() instead

from verdaccio-google-cloud.

juanpicado avatar juanpicado commented on June 10, 2024

What if we ...

"optionalDependencies": {
    "fast-crc32c": "1.0.4"
  },

?

from verdaccio-google-cloud.

DanielRuf avatar DanielRuf commented on June 10, 2024

The native dependency which throws the error is already an optional dependency afaik. Not sure if --no-optional would already solve that. But we can also move it in our root package.json to the optional dependencies.

from verdaccio-google-cloud.

juanpicado avatar juanpicado commented on June 10, 2024

I think it is not, I haven't found any reference in their source code.
https://cloud.google.com/nodejs/docs/reference/storage/1.7.x/File

Screen Shot 2019-06-30 at 8 00 57 AM

So, I think we have answered the question. I think a future PR might either remove it or add it as optionalDepedency, but I'd rather remove it and update the README file since there is nothing to add in this plugin, the google npm dependency will detect that automatically.

from verdaccio-google-cloud.

DanielRuf avatar DanielRuf commented on June 10, 2024

The native dependency which throws the error is already an optional dependency afaik.

See #16 (comment) ;-)

I do not directly mean fast-crc32c but one of its optional dependencies.

from verdaccio-google-cloud.

juanpicado avatar juanpicado commented on June 10, 2024

Ahh, sorry my bad @DanielRuf I did not read that part 👍 thanks for the clarification 😊

from verdaccio-google-cloud.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.