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

nan dependency version #1

Closed
romankoblov opened this issue Aug 11, 2015 · 7 comments
Closed

nan dependency version #1

romankoblov opened this issue Aug 11, 2015 · 7 comments

Comments

@romankoblov
Copy link
Contributor

Hi,
currently mmap-io have wildcard dependency version for nan library:

     "dependencies": {
        "bindings": "1.2.1",
        "nan":      "*"
    },

and doesn't work with latest nan version (2.0.5), can you pin 'nan' version to 1.7.0 for example (this one is works correctly)?

Log of compilation with new version

make: Entering directory `/usr/lib/node_modules/mmap-io/build'
  CXX(target) Release/obj.target/mmap-io/src/mmap-io.o
../src/mmap-io.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE mmap_map(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/mmap-io.cc:45:22: error: ‘NanScope’ was not declared in this scope
             NanScope();
                      ^
../src/mmap-io.cc:47:17: error: ‘args’ was not declared in this scope
             if (args.Length() < 4 && args.Length() > 6) {
                 ^
../src/mmap-io.cc:51:17: error: ‘NanThrowError’ was not declared in this scope
                 );
                 ^
../src/mmap-io.cc:51:17: error: return-statement with a value, in function returning 'void' [-fpermissive]
../src/mmap-io.cc:55:18: error: ‘args’ was not declared in this scope
             if (!args[0]->IsNumber())    return NanThrowError("mmap: size (arg[0]) must be an integer", EINVAL);
                  ^
../src/mmap-io.cc:55:111: error: ‘NanThrowError’ was not declared in this scope
             if (!args[0]->IsNumber())    return NanThrowError("mmap: size (arg[0]) must be an integer", EINVAL);
                                                                                                               ^
../src/mmap-io.cc:55:111: error: return-statement with a value, in function returning 'void' [-fpermissive]
../src/mmap-io.cc:56:18: error: ‘args’ was not declared in this scope
             if (!args[1]->IsNumber())    return NanThrowError("mmap: protection_flags (arg[1]) must be an integer", EINVAL);
                  ^
../src/mmap-io.cc:56:123: error: ‘NanThrowError’ was not declared in this scope
             if (!args[1]->IsNumber())    return NanThrowError("mmap: protection_flags (arg[1]) must be an integer", EINVAL);
                                                                                                                           ^
../src/mmap-io.cc:56:123: error: return-statement with a value, in function returning 'void' [-fpermissive]
../src/mmap-io.cc:57:18: error: ‘args’ was not declared in this scope
             if (!args[2]->IsNumber())    return NanThrowError("mmap: flags (arg[2]) must be an integer", EINVAL);
                  ^
../src/mmap-io.cc:57:112: error: ‘NanThrowError’ was not declared in this scope
             if (!args[2]->IsNumber())    return NanThrowError("mmap: flags (arg[2]) must be an integer", EINVAL);
                                                                                                                ^
../src/mmap-io.cc:57:112: error: return-statement with a value, in function returning 'void' [-fpermissive]
../src/mmap-io.cc:58:18: error: ‘args’ was not declared in this scope
             if (!args[3]->IsNumber())    return NanThrowError("mmap: fd (arg[3]) must be an integer (a file descriptor)", EINVAL);
                  ^
../src/mmap-io.cc:58:129: error: ‘NanThrowError’ was not declared in this scope
             if (!args[3]->IsNumber())    return NanThrowError("mmap: fd (arg[3]) must be an integer (a file descriptor)", EINVAL);
                                                                                                                                 ^
../src/mmap-io.cc:58:129: error: return-statement with a value, in function returning 'void' [-fpermissive]
../src/mmap-io.cc:62:47: error: ‘args’ was not declared in this scope
             const size_t    size            = args[0]->ToInteger()->Value();   // ToUint64()->Value();
                                               ^
../src/mmap-io.cc:72:58: error: ‘NanThrowError’ was not declared in this scope
                 return NanThrowError("mmap failed", errno);
                                                          ^
../src/mmap-io.cc:72:58: error: return-statement with a value, in function returning 'void' [-fpermissive]
../src/mmap-io.cc:78:71: error: ‘NanThrowError’ was not declared in this scope
                         return NanThrowError("madvise() failed", errno);
                                                                       ^
../src/mmap-io.cc:78:71: error: return-statement with a value, in function returning 'void' [-fpermissive]
../src/mmap-io.cc:83:113: error: ‘NanNewBufferHandle’ was not declared in this scope
                 Local<Object> buf = NanNewBufferHandle(data, size, do_mmap_cleanup, static_cast<void*>(map_info));
                                                                                                                 ^
../src/mmap-io.cc:84:35: error: ‘NanReturnValue’ was not declared in this scope
                 NanReturnValue(buf);
                                   ^
../src/mmap-io.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE mmap_advise(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/mmap-io.cc:89:22: error: ‘NanScope’ was not declared in this scope
             NanScope();
                      ^
../src/mmap-io.cc:91:17: error: ‘args’ was not declared in this scope
             if (args.Length() != 2 && args.Length() != 4) {
                 ^
../src/mmap-io.cc:95:17: error: ‘NanThrowError’ was not declared in this scope
                 );
                 ^
../src/mmap-io.cc:95:17: error: return-statement with a value, in function returning 'void' [-fpermissive]
../src/mmap-io.cc:97:18: error: ‘args’ was not declared in this scope
             if (!args[0]->IsObject())    return NanThrowError("advice(): buffer (arg[0]) must be a Buffer", EINVAL);
                  ^
../src/mmap-io.cc:97:115: error: ‘NanThrowError’ was not declared in this scope
             if (!args[0]->IsObject())    return NanThrowError("advice(): buffer (arg[0]) must be a Buffer", EINVAL);
                                                                                                                   ^
../src/mmap-io.cc:97:115: error: return-statement with a value, in function returning 'void' [-fpermissive]
../src/mmap-io.cc:98:18: error: ‘args’ was not declared in this scope
             if (!args[1]->IsNumber())    return NanThrowError("advice(): (arg[1]) must be an integer", EINVAL);
                  ^
../src/mmap-io.cc:98:110: error: ‘NanThrowError’ was not declared in this scope
             if (!args[1]->IsNumber())    return NanThrowError("advice(): (arg[1]) must be an integer", EINVAL);
                                                                                                              ^
../src/mmap-io.cc:98:110: error: return-statement with a value, in function returning 'void' [-fpermissive]
../src/mmap-io.cc:100:39: error: ‘args’ was not declared in this scope
             Local<Object>   buf     = args[0]->ToObject();
                                       ^
../src/mmap-io.cc:116:63: error: ‘NanThrowError’ was not declared in this scope
                 return NanThrowError("madvise() failed", errno);
                                                               ^
../src/mmap-io.cc:116:63: error: return-statement with a value, in function returning 'void' [-fpermissive]
../src/mmap-io.cc:118:32: error: ‘NanReturnUndefined’ was not declared in this scope
             NanReturnUndefined();
                                ^
../src/mmap-io.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE mmap_sync_lib_private_(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/mmap-io.cc:122:22: error: ‘NanScope’ was not declared in this scope
             NanScope();
                      ^
../src/mmap-io.cc:126:17: error: ‘args’ was not declared in this scope
             if (args.Length() != 5) {
                 ^
../src/mmap-io.cc:130:17: error: ‘NanThrowError’ was not declared in this scope
                 );
                 ^
../src/mmap-io.cc:130:17: error: return-statement with a value, in function returning 'void' [-fpermissive]
../src/mmap-io.cc:132:18: error: ‘args’ was not declared in this scope
             if (!args[0]->IsObject())    return NanThrowError("sync(): buffer (arg[0]) must be a Buffer", EINVAL);
                  ^
../src/mmap-io.cc:132:113: error: ‘NanThrowError’ was not declared in this scope
             if (!args[0]->IsObject())    return NanThrowError("sync(): buffer (arg[0]) must be a Buffer", EINVAL);
                                                                                                                 ^
../src/mmap-io.cc:132:113: error: return-statement with a value, in function returning 'void' [-fpermissive]
../src/mmap-io.cc:135:39: error: ‘args’ was not declared in this scope
             Local<Object>   buf     = args[0]->ToObject();
                                       ^
../src/mmap-io.cc:148:61: error: ‘NanThrowError’ was not declared in this scope
                 return NanThrowError("msync() failed", errno);
                                                             ^
../src/mmap-io.cc:148:61: error: return-statement with a value, in function returning 'void' [-fpermissive]
../src/mmap-io.cc:150:32: error: ‘NanReturnUndefined’ was not declared in this scope
             NanReturnUndefined();
                                ^
../src/mmap-io.cc: In lambda function:
../src/mmap-io.cc:158:48: error: ‘NanNew’ was not declared in this scope
                    exports->ForceSet(NanNew(key), NanNew(val), property_attrs);
                                                ^
../src/mmap-io.cc: In function ‘void Init(v8::Handle<v8::Object>, v8::Handle<v8::Object>)’:
../src/mmap-io.cc:181:43: error: ‘NanNew’ was not declared in this scope
             exports->ForceSet(NanNew("map"), NanNew<FunctionTemplate>(mmap_map)->GetFunction(), property_attrs);
                                           ^
../src/mmap-io.cc:181:69: error: expected primary-expression before ‘>’ token
             exports->ForceSet(NanNew("map"), NanNew<FunctionTemplate>(mmap_map)->GetFunction(), property_attrs);
                                                                     ^
../src/mmap-io.cc:181:82: error: request for member ‘GetFunction’ in ‘mmap_map’, which is of non-class type ‘Nan::NAN_METHOD_RETURN_TYPE(Nan::NAN_METHOD_ARGS_TYPE) {aka void(const Nan::FunctionCallbackInfo<v8::Value>&)}’
             exports->ForceSet(NanNew("map"), NanNew<FunctionTemplate>(mmap_map)->GetFunction(), property_attrs);
                                                                                  ^
../src/mmap-io.cc:182:72: error: expected primary-expression before ‘>’ token
             exports->ForceSet(NanNew("advise"), NanNew<FunctionTemplate>(mmap_advise)->GetFunction(), property_attrs);
                                                                        ^
../src/mmap-io.cc:182:88: error: request for member ‘GetFunction’ in ‘mmap_advise’, which is of non-class type ‘Nan::NAN_METHOD_RETURN_TYPE(Nan::NAN_METHOD_ARGS_TYPE) {aka void(const Nan::FunctionCallbackInfo<v8::Value>&)}’
             exports->ForceSet(NanNew("advise"), NanNew<FunctionTemplate>(mmap_advise)->GetFunction(), property_attrs);
                                                                                        ^
../src/mmap-io.cc:186:84: error: expected primary-expression before ‘>’ token
             exports->ForceSet(NanNew("sync_lib_private__"), NanNew<FunctionTemplate>(mmap_sync_lib_private_)->GetFunction(), PropertyAttribute::None);
                                                                                    ^
../src/mmap-io.cc:186:111: error: request for member ‘GetFunction’ in ‘mmap_sync_lib_private_’, which is of non-class type ‘Nan::NAN_METHOD_RETURN_TYPE(Nan::NAN_METHOD_ARGS_TYPE) {aka void(const Nan::FunctionCallbackInfo<v8::Value>&)}’
             exports->ForceSet(NanNew("sync_lib_private__"), NanNew<FunctionTemplate>(mmap_sync_lib_private_)->GetFunction(), PropertyAttribute::None);
                                                                                                               ^
make: *** [Release/obj.target/mmap-io/src/mmap-io.o] Error 1

@romankoblov
Copy link
Contributor Author

I've updated 'nan' inside pull request to 1.9.0, but iojs build still falling, probably need to rewrite module with compatible for latest nan (2.0.5), or just drop support for iojs. Current version of mmap-io doesn't work even on nodejs, so I think its maybe reasonable merge this pull request and release new version.

@ozra
Copy link
Owner

ozra commented Oct 1, 2015

Hi @penpen - sorry I've completely missed this issue! I'm a bit in a tight spot with time atm - so I will merge your PR without review. Please follow up if you come across issues. :)

@romankoblov
Copy link
Contributor Author

Hi, thank you! Can you release new version of mmap-io with this commit?

@ozra ozra closed this as completed Oct 1, 2015
@ozra
Copy link
Owner

ozra commented Oct 1, 2015

Hey. I just re-read and see that it doesn't work at all for iojs!? Have you looked into what changes are affecting? I'll merge PR if you can manage?

@romankoblov
Copy link
Contributor Author

Hi,
They changed API, so current version in repo won’t work with iojs at all, but with my PR it will work with nodejs
at least. I don’t have much experience with bindings, so I cannot fix this by myself.

On 01 Oct 2015, at 17:29, Oscar Campbell notifications@github.com wrote:

Hey. I just re-read and see that it doesn't work at all for iojs!? Have you looked into what changes are affecting? I'll merge PR if you can manage?


Reply to this email directly or view it on GitHub #1 (comment).

@ozra
Copy link
Owner

ozra commented Oct 1, 2015

What the hell - I'll drop what I'm with and sneak off for some NAN hacking. I'll see if I can fix it.

@ozra
Copy link
Owner

ozra commented Oct 1, 2015

Ok, 10 Snus, 20 cigarilles and 5 cups of coffee later. Seems to work with 2.0.9 now. Published. Try it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants