GithubHelp home page GithubHelp logo

avz / node-posix-clock Goto Github PK

View Code? Open in Web Editor NEW
10.0 10.0 2.0 244 KB

POSIX clock_gettime(2), clock_getres(2) and clock_nanosleep(2) for NodeJS

License: MIT License

Python 3.57% JavaScript 45.17% C++ 51.26%

node-posix-clock's People

Contributors

avz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

oliwer tufosa

node-posix-clock's Issues

Node v16+ support

Hi,

Thanks again for this project! We've been using it for many years.

We are trying to upgrade to Node v16-19+, I noticed node-posix-clock is incompatible. Here are the errors I'm getting:

> [email protected] install /Users/**/*/node_modules/posix-clock
> node-gyp rebuild

  CC(target) Release/obj.target/nothing/../node-addon-api/src/nothing.o
  LIBTOOL-STATIC Release/nothing.a
env: python: No such file or directory
make: *** [Release/nothing.a] Error 127
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Darwin 21.6.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/**/*/node_modules/posix-clock
gyp ERR! node -v v12.22.7
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
npm WARN notsup Unsupported engine for @fastify/[email protected]: wanted: {"node":">=14"} (current: {"node":"12.22.7","npm":"6.14.15"})
npm WARN notsup Not compatible with your version of node/npm: @fastify/[email protected]

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] 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/***/.npm/_logs/2023-01-28T00_00_18_341Z-debug.log

Node 12 support

Hi,

Thanks for this project!

After upgrading to Node 12, I noticed node-posix-clock is incompatible. Here are the errors I'm getting:

> node-gyp rebuild

  CXX(target) Release/obj.target/posix-clock/src/posix-clock.o
../src/posix-clock.cpp:32:53: error: too few arguments to function call, single argument
      'context' was not specified
        clockid_t clockId = (clockid_t)info[0]->Int32Value();
                                       ~~~~~~~~~~~~~~~~~~~ ^
/Users/alexcastillo/.node-gyp/12.2.0/include/node/v8.h:2569:3: note: 'Int32Value' declared here
  V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
  ^
/Users/alexcastillo/.node-gyp/12.2.0/include/node/v8config.h:347:31: note: expanded from macro
      'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
../src/posix-clock.cpp:47:2: warning: 'Set' is deprecated: Use maybe version
      [-Wdeprecated-declarations]
        AVZ_FILL_TIMESPEC(obj, ts.tv_sec, ts.tv_nsec);
        ^
../src/posix-clock.cpp:15:13: note: expanded from macro 'AVZ_FILL_TIMESPEC'
                (target)->Set(Nan::New("sec").ToLocalChecked(), Nan::New<Number>(sec)); \
                          ^
/Users/alexcastillo/.node-gyp/12.2.0/include/node/v8.h:3358:3: note: 'Set' has been explicitly
      marked deprecated here
  V8_DEPRECATE_SOON("Use maybe version",
  ^
/Users/alexcastillo/.node-gyp/12.2.0/include/node/v8config.h:322:29: note: expanded from macro
      'V8_DEPRECATE_SOON'
  declarator __attribute__((deprecated(message)))
                            ^
../src/posix-clock.cpp:47:2: warning: 'Set' is deprecated: Use maybe version
      [-Wdeprecated-declarations]
        AVZ_FILL_TIMESPEC(obj, ts.tv_sec, ts.tv_nsec);
        ^
../src/posix-clock.cpp:16:13: note: expanded from macro 'AVZ_FILL_TIMESPEC'
                (target)->Set(Nan::New("nsec").ToLocalChecked(), Nan::New<Number>(nsec));
                          ^
/Users/alexcastillo/.node-gyp/12.2.0/include/node/v8.h:3358:3: note: 'Set' has been explicitly
      marked deprecated here
  V8_DEPRECATE_SOON("Use maybe version",
  ^
/Users/alexcastillo/.node-gyp/12.2.0/include/node/v8config.h:322:29: note: expanded from macro
      'V8_DEPRECATE_SOON'
  declarator __attribute__((deprecated(message)))
                            ^
../src/posix-clock.cpp:60:53: error: too few arguments to function call, single argument
      'context' was not specified
        clockid_t clockId = (clockid_t)info[0]->Int32Value();
                                       ~~~~~~~~~~~~~~~~~~~ ^
/Users/alexcastillo/.node-gyp/12.2.0/include/node/v8.h:2569:3: note: 'Int32Value' declared here
  V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
  ^
/Users/alexcastillo/.node-gyp/12.2.0/include/node/v8config.h:347:31: note: expanded from macro
      'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
../src/posix-clock.cpp:75:2: warning: 'Set' is deprecated: Use maybe version
      [-Wdeprecated-declarations]
        AVZ_FILL_TIMESPEC(obj, ts.tv_sec, ts.tv_nsec);
        ^
../src/posix-clock.cpp:15:13: note: expanded from macro 'AVZ_FILL_TIMESPEC'
                (target)->Set(Nan::New("sec").ToLocalChecked(), Nan::New<Number>(sec)); \
                          ^
/Users/alexcastillo/.node-gyp/12.2.0/include/node/v8.h:3358:3: note: 'Set' has been explicitly
      marked deprecated here
  V8_DEPRECATE_SOON("Use maybe version",
  ^
/Users/alexcastillo/.node-gyp/12.2.0/include/node/v8config.h:322:29: note: expanded from macro
      'V8_DEPRECATE_SOON'
  declarator __attribute__((deprecated(message)))
                            ^
../src/posix-clock.cpp:75:2: warning: 'Set' is deprecated: Use maybe version
      [-Wdeprecated-declarations]
        AVZ_FILL_TIMESPEC(obj, ts.tv_sec, ts.tv_nsec);
        ^
../src/posix-clock.cpp:16:13: note: expanded from macro 'AVZ_FILL_TIMESPEC'
                (target)->Set(Nan::New("nsec").ToLocalChecked(), Nan::New<Number>(nsec));
                          ^
/Users/alexcastillo/.node-gyp/12.2.0/include/node/v8.h:3358:3: note: 'Set' has been explicitly
      marked deprecated here
  V8_DEPRECATE_SOON("Use maybe version",
  ^
/Users/alexcastillo/.node-gyp/12.2.0/include/node/v8config.h:322:29: note: expanded from macro
      'V8_DEPRECATE_SOON'
  declarator __attribute__((deprecated(message)))
                            ^
../src/posix-clock.cpp:89:53: error: too few arguments to function call, single argument
      'context' was not specified
        clockid_t clockId = (clockid_t)info[0]->Int32Value();
                                       ~~~~~~~~~~~~~~~~~~~ ^
/Users/alexcastillo/.node-gyp/12.2.0/include/node/v8.h:2569:3: note: 'Int32Value' declared here
  V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
  ^
/Users/alexcastillo/.node-gyp/12.2.0/include/node/v8config.h:347:31: note: expanded from macro
      'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
../src/posix-clock.cpp:96:34: error: too few arguments to function call, single argument
      'context' was not specified
        int flags = info[1]->Int32Value();
                    ~~~~~~~~~~~~~~~~~~~ ^
/Users/alexcastillo/.node-gyp/12.2.0/include/node/v8.h:2569:3: note: 'Int32Value' declared here
  V8_WARN_UNUSED_RESULT Maybe<int32_t> Int32Value(Local<Context> context) const;
  ^
/Users/alexcastillo/.node-gyp/12.2.0/include/node/v8config.h:347:31: note: expanded from macro
      'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
../src/posix-clock.cpp:107:36: error: no matching member function for call to 'ToObject'
        Local<Object> objSleep = info[2]->ToObject();
                                 ~~~~~~~~~^~~~~~~~
/Users/alexcastillo/.node-gyp/12.2.0/include/node/v8.h:2532:44: note: candidate function not
      viable: requires single argument 'context', but no arguments were provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
                                           ^
/Users/alexcastillo/.node-gyp/12.2.0/include/node/v8.h:2546:35: note: candidate function not
      viable: requires single argument 'isolate', but no arguments were provided
                    Local<Object> ToObject(Isolate* isolate) const);
                                  ^
../src/posix-clock.cpp:108:36: warning: 'Get' is deprecated: Use maybe version
      [-Wdeprecated-declarations]
        Local<Value> secValue = objSleep->Get(Nan::New("sec").ToLocalChecked());
                                          ^
/Users/alexcastillo/.node-gyp/12.2.0/include/node/v8.h:3412:3: note: 'Get' has been explicitly
      marked deprecated here
  V8_DEPRECATE_SOON("Use maybe version", Local<Value> Get(Local<Value> key));
  ^
/Users/alexcastillo/.node-gyp/12.2.0/include/node/v8config.h:322:29: note: expanded from macro
      'V8_DEPRECATE_SOON'
  declarator __attribute__((deprecated(message)))
                            ^
../src/posix-clock.cpp:109:37: warning: 'Get' is deprecated: Use maybe version
      [-Wdeprecated-declarations]
        Local<Value> nsecValue = objSleep->Get(Nan::New("nsec").ToLocalChecked());
                                           ^
/Users/alexcastillo/.node-gyp/12.2.0/include/node/v8.h:3412:3: note: 'Get' has been explicitly
      marked deprecated here
  V8_DEPRECATE_SOON("Use maybe version", Local<Value> Get(Local<Value> key));
  ^
/Users/alexcastillo/.node-gyp/12.2.0/include/node/v8config.h:322:29: note: expanded from macro
      'V8_DEPRECATE_SOON'
  declarator __attribute__((deprecated(message)))
                            ^
../src/posix-clock.cpp:123:53: error: too few arguments to function call, single argument
      'context' was not specified
        sleepTimeTs.tv_sec = (time_t)secValue->Uint32Value();
                                     ~~~~~~~~~~~~~~~~~~~~~ ^
/Users/alexcastillo/.node-gyp/12.2.0/include/node/v8.h:2567:3: note: 'Uint32Value' declared here
  V8_WARN_UNUSED_RESULT Maybe<uint32_t> Uint32Value(
  ^
/Users/alexcastillo/.node-gyp/12.2.0/include/node/v8config.h:347:31: note: expanded from macro
      'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
../src/posix-clock.cpp:124:53: error: too few arguments to function call, single argument
      'context' was not specified
        sleepTimeTs.tv_nsec = (long)nsecValue->Uint32Value();
                                    ~~~~~~~~~~~~~~~~~~~~~~ ^
/Users/alexcastillo/.node-gyp/12.2.0/include/node/v8.h:2567:3: note: 'Uint32Value' declared here
  V8_WARN_UNUSED_RESULT Maybe<uint32_t> Uint32Value(
  ^
/Users/alexcastillo/.node-gyp/12.2.0/include/node/v8config.h:347:31: note: expanded from macro
      'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
../src/posix-clock.cpp:177:4: warning: 'Set' is deprecated: Use maybe version
      [-Wdeprecated-declarations]
                        AVZ_FILL_TIMESPEC(obj, remainingTimeTs.tv_sec, remainingTimeTs.tv_nsec);
                        ^
../src/posix-clock.cpp:15:13: note: expanded from macro 'AVZ_FILL_TIMESPEC'
                (target)->Set(Nan::New("sec").ToLocalChecked(), Nan::New<Number>(sec)); \
                          ^
/Users/alexcastillo/.node-gyp/12.2.0/include/node/v8.h:3358:3: note: 'Set' has been explicitly
      marked deprecated here
  V8_DEPRECATE_SOON("Use maybe version",
  ^
/Users/alexcastillo/.node-gyp/12.2.0/include/node/v8config.h:322:29: note: expanded from macro
      'V8_DEPRECATE_SOON'
  declarator __attribute__((deprecated(message)))
                            ^
../src/posix-clock.cpp:177:4: warning: 'Set' is deprecated: Use maybe version
      [-Wdeprecated-declarations]
                        AVZ_FILL_TIMESPEC(obj, remainingTimeTs.tv_sec, remainingTimeTs.tv_nsec);
                        ^
../src/posix-clock.cpp:16:13: note: expanded from macro 'AVZ_FILL_TIMESPEC'
                (target)->Set(Nan::New("nsec").ToLocalChecked(), Nan::New<Number>(nsec));
                          ^
/Users/alexcastillo/.node-gyp/12.2.0/include/node/v8.h:3358:3: note: 'Set' has been explicitly
      marked deprecated here
  V8_DEPRECATE_SOON("Use maybe version",
  ^
/Users/alexcastillo/.node-gyp/12.2.0/include/node/v8config.h:322:29: note: expanded from macro
      'V8_DEPRECATE_SOON'
  declarator __attribute__((deprecated(message)))
                            ^
../src/posix-clock.cpp:192:6: error: variable has incomplete type 'void'
void init(Handle<Object> exports) {
     ^
../src/posix-clock.cpp:192:11: error: use of undeclared identifier 'Handle'
void init(Handle<Object> exports) {
          ^
../src/posix-clock.cpp:192:18: error: 'Object' does not refer to a value
void init(Handle<Object> exports) {
                 ^
/Users/alexcastillo/.node-gyp/12.2.0/include/node/v8.h:3356:17: note: declared here
class V8_EXPORT Object : public Value {
                ^
../src/posix-clock.cpp:192:26: error: use of undeclared identifier 'exports'
void init(Handle<Object> exports) {
                         ^
../src/posix-clock.cpp:192:34: error: expected ';' after top level declarator
void init(Handle<Object> exports) {
                                 ^
                                 ;
8 warnings and 12 errors generated.
make: *** [Release/obj.target/posix-clock/src/posix-clock.o] Error 1

Any advice?

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.