Does not compile with node 0.11.10 #148

Closed
bjouhier opened this Issue Jan 2, 2014 · 8 comments

Projects

None yet

5 participants

@bjouhier
Contributor
bjouhier commented Jan 2, 2014

Looks like the V8 API has changed again. For example the Arguments type is gone!

@bjouhier bjouhier referenced this issue Jan 2, 2014
Closed

Node 0.11.10 #149

@duralog
duralog commented Jan 30, 2014

it appears to be broken in 0.11.11 now again... strange things like this...

/usr/include/unistd.h:598:32: error: unknown type name 'useconds_t'; did you mean 'node::useconds_t'?
useconds_t       ualarm(useconds_t, useconds_t);
                                    ^
/usr/include/sys/_types/_useconds_t.h:30:29: note: 'node::useconds_t' declared here
typedef __darwin_useconds_t     useconds_t;
                                ^
In file included from ../src/fibers.cc:1:
In file included from ../src/coroutine.h:4:
In file included from ../src/libcoro/coro.h:338:
/usr/include/unistd.h:599:13: error: unknown type name 'useconds_t'; did you mean 'node::useconds_t'?
int      usleep(useconds_t) __DARWIN_ALIAS_C(usleep);
                ^
/usr/include/sys/_types/_useconds_t.h:30:29: note: 'node::useconds_t' declared here
typedef __darwin_useconds_t     useconds_t;
                                ^
In file included from ../src/fibers.cc:1:
In file included from ../src/coroutine.h:4:
In file included from ../src/libcoro/coro.h:338:
/usr/include/unistd.h:619:25: error: unknown type name 'gid_t'
int      fchown(int, uid_t, gid_t);
                            ^
@bjouhier
Contributor

@duralog This is probably part of a more general problem with 0.11.11. See nodejs/node-v0.x-archive#6992
The recommendation is to stay away of 0.11.11 and wait for the next one if you have binary modules.

@duralog
duralog commented Jan 30, 2014

correct.

all those strange errors go away if I delete that section from the node.h (which I have done). I have to convert a bunch of modules I'm going to need for node-0.12.x (cause I'm highly interested in using harmony stuff) so I'm getting an early start on it :) I'm using NAN and it seems to be working out great.

with that section of node.h removed, I just tried compiling fibers and it works beautifully and passes all the tests. because the binary is not found, I modified fibers.js to read:

var v8 = 'v8-'+ /[0-9]+\.[0-9]+/.exec(process.versions.v8)[0];
var modPath = path.join(__dirname, 'bin', process.platform+ '-'+ process.arch+ '-'+ v8, 'fibers');
try {
    fs.statSync(modPath+ '.node');
} catch (ex) {
    // No binary!
    modPath = path.join(__dirname, 'build', 'Release', 'fibers');
    try {
        fs.statSync(modPath+ '.node');
    } catch(ex) {
        throw new Error('`'+ modPath+ '.node` is missing. Try reinstalling `node-fibers`?');
    }
}

which works beautifully!! cheers!
you want me to make that change a PR?

@thelinuxlich

Not working with Node 0.11.12 :(

@coderhaoxin

Not working with 0.11.14.

How about add nan as a dep?

@duralog
duralog commented Nov 21, 2014

why not just use generators? they work really well for me

@bjouhier
Contributor

There is just one line of code to change to make it compile with the latest node (v0.11.15-pre): remove the ReadOnly argument at https://github.com/laverdet/node-fibers/blob/master/src/fibers.cc#L766

@laverdet
Owner

Compiles now on all versions of Node as far as I can tell!

@laverdet laverdet closed this Dec 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment