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

Added support for "node-gyp" build & update deps #39

Merged
merged 12 commits into from Jul 25, 2012

Conversation

justmoon
Copy link
Collaborator

This pull request:

Tested with Node.js 0.8.3 on Ubuntu.

@gflarity
Copy link

Looks like you might have missed a file? (../deps/snappy/snappy.h:45:33: error: snappy-stubs-public.h: No such file or directory). Here's the full output:

What a great team effort.

gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CXX(target) Release/obj.target/snappy/deps/snappy/snappy.o
In file included from ../deps/snappy/snappy.cc:29:
../deps/snappy/snappy.h:45:33: error: snappy-stubs-public.h: No such file or directory
In file included from ../deps/snappy/snappy.cc:29:
../deps/snappy/snappy.h:59: error: 'uint32' has not been declared
../deps/snappy/snappy.h:69: error: 'string' has not been declared
../deps/snappy/snappy.h:78: error: 'string' has not been declared
In file included from ../deps/snappy/snappy-internal.h:34,
                 from ../deps/snappy/snappy.cc:30:
../deps/snappy/snappy-stubs-internal.h:94: error: 'uint32' does not name a type
../deps/snappy/snappy-stubs-internal.h:95: error: 'int64' does not name a type
../deps/snappy/snappy-stubs-internal.h: In function 'void snappy::UnalignedCopy64(const void*, void*)':
../deps/snappy/snappy-stubs-internal.h:195: error: expected type-specifier before 'uint64'
../deps/snappy/snappy-stubs-internal.h:195: error: expected `>' before 'uint64'
../deps/snappy/snappy-stubs-internal.h:195: error: expected `(' before 'uint64'
../deps/snappy/snappy-stubs-internal.h:195: error: 'uint64' was not declared in this scope
../deps/snappy/snappy-stubs-internal.h:195: error: expected primary-expression before '>' token
../deps/snappy/snappy-stubs-internal.h:195: error: ISO C++ forbids declaration of 'type name' with no type
../deps/snappy/snappy-stubs-internal.h:195: error: expected `>' before 'uint64'
../deps/snappy/snappy-stubs-internal.h:195: error: expected `(' before 'uint64'
../deps/snappy/snappy-stubs-internal.h:195: error: expected primary-expression before '>' token
../deps/snappy/snappy-stubs-internal.h:195: error: expected `)' before ';' token
../deps/snappy/snappy-stubs-internal.h:195: error: expected `)' before ';' token
../deps/snappy/snappy-stubs-internal.h:200: error: expected type-specifier before 'uint32'
../deps/snappy/snappy-stubs-internal.h:200: error: expected `>' before 'uint32'
../deps/snappy/snappy-stubs-internal.h:200: error: expected `(' before 'uint32'
../deps/snappy/snappy-stubs-internal.h:200: error: 'uint32' was not declared in this scope
../deps/snappy/snappy-stubs-internal.h:200: error: expected primary-expression before '>' token
../deps/snappy/snappy-stubs-internal.h:200: error: ISO C++ forbids declaration of 'type name' with no type
../deps/snappy/snappy-stubs-internal.h:200: error: expected `>' before 'uint32'
../deps/snappy/snappy-stubs-internal.h:200: error: expected `(' before 'uint32'
../deps/snappy/snappy-stubs-internal.h:200: error: expected primary-expression before '>' token
../deps/snappy/snappy-stubs-internal.h:200: error: expected `)' before ';' token
../deps/snappy/snappy-stubs-internal.h:200: error: expected `)' before ';' token
../deps/snappy/snappy-stubs-internal.h:201: error: expected type-specifier before 'uint32'
../deps/snappy/snappy-stubs-internal.h:201: error: expected `>' before 'uint32'
../deps/snappy/snappy-stubs-internal.h:201: error: expected `(' before 'uint32'
../deps/snappy/snappy-stubs-internal.h:201: error: expected primary-expression before '>' token
../deps/snappy/snappy-stubs-internal.h:201: error: ISO C++ forbids declaration of 'type name' with no type
../deps/snappy/snappy-stubs-internal.h:201: error: expected `>' before 'uint32'
../deps/snappy/snappy-stubs-internal.h:201: error: expected `(' before 'uint32'
../deps/snappy/snappy-stubs-internal.h:201: error: expected primary-expression before '>' token
../deps/snappy/snappy-stubs-internal.h:201: error: expected `)' before ';' token
../deps/snappy/snappy-stubs-internal.h:201: error: expected `)' before ';' token
../deps/snappy/snappy-stubs-internal.h: At global scope:
../deps/snappy/snappy-stubs-internal.h:289: error: 'uint16' does not name a type
../deps/snappy/snappy-stubs-internal.h:290: error: 'uint16' does not name a type
../deps/snappy/snappy-stubs-internal.h:292: error: 'uint32' does not name a type
../deps/snappy/snappy-stubs-internal.h:293: error: 'uint32' does not name a type
../deps/snappy/snappy-stubs-internal.h:300: error: 'uint16' does not name a type
../deps/snappy/snappy-stubs-internal.h:304: error: 'uint16' has not been declared
../deps/snappy/snappy-stubs-internal.h:308: error: 'uint32' does not name a type
../deps/snappy/snappy-stubs-internal.h:312: error: 'uint32' has not been declared
../deps/snappy/snappy-stubs-internal.h: In static member function 'static void snappy::LittleEndian::Store16(void*, int)':
../deps/snappy/snappy-stubs-internal.h:305: error: expected type-specifier before 'uint16'
../deps/snappy/snappy-stubs-internal.h:305: error: expected `>' before 'uint16'
../deps/snappy/snappy-stubs-internal.h:305: error: expected `(' before 'uint16'
../deps/snappy/snappy-stubs-internal.h:305: error: 'uint16' was not declared in this scope
../deps/snappy/snappy-stubs-internal.h:305: error: expected primary-expression before '>' token
../deps/snappy/snappy-stubs-internal.h:305: error: 'FromHost16' was not declared in this scope
../deps/snappy/snappy-stubs-internal.h:305: error: expected `)' before ';' token
../deps/snappy/snappy-stubs-internal.h: In static member function 'static void snappy::LittleEndian::Store32(void*, int)':
../deps/snappy/snappy-stubs-internal.h:313: error: expected type-specifier before 'uint32'
../deps/snappy/snappy-stubs-internal.h:313: error: expected `>' before 'uint32'
../deps/snappy/snappy-stubs-internal.h:313: error: expected `(' before 'uint32'
../deps/snappy/snappy-stubs-internal.h:313: error: 'uint32' was not declared in this scope
../deps/snappy/snappy-stubs-internal.h:313: error: expected primary-expression before '>' token
../deps/snappy/snappy-stubs-internal.h:313: error: 'FromHost32' was not declared in this scope
../deps/snappy/snappy-stubs-internal.h:313: error: expected `)' before ';' token
../deps/snappy/snappy-stubs-internal.h: At global scope:
../deps/snappy/snappy-stubs-internal.h:321: error: 'uint32' has not been declared
../deps/snappy/snappy-stubs-internal.h:326: error: 'uint32' has not been declared
../deps/snappy/snappy-stubs-internal.h:327: error: 'uint64' has not been declared
../deps/snappy/snappy-stubs-internal.h:330: error: ISO C++ forbids declaration of 'DISALLOW_COPY_AND_ASSIGN' with no type
../deps/snappy/snappy-stubs-internal.h:349: error: 'snappy::Bits::Log2Floor' declared as an 'inline' variable
../deps/snappy/snappy-stubs-internal.h:349: error: 'int snappy::Bits::Log2Floor' is not a static member of 'class snappy::Bits'
../deps/snappy/snappy-stubs-internal.h:349: error: 'uint32' was not declared in this scope
../deps/snappy/snappy-stubs-internal.h:349: error: expected ',' or ';' before '{' token
../deps/snappy/snappy.cc:1118: error: expected `}' at end of input
make[1]: *** [Release/obj.target/snappy/deps/snappy/snappy.o] Error 1

@pconstr
Copy link

pconstr commented Jul 24, 2012

I'm getting the exact same problem as gflarity

@justmoon
Copy link
Collaborator Author

My bad, it looks like snappy-stubs-public.h is generated from snappy-stubs-public.h.in by autoconf. I'll look at porting it to gyp.

@justmoon
Copy link
Collaborator Author

The Chromium source holds the solution: http://src.chromium.org/svn/trunk/src/third_party/snappy/snappy.gyp

They have three different directories for each of the operating systems with pregenerated config.h / snappy-stubs-public.h headers and then just add the respective build directory with OS conditionals.

I'll "borrow" their solution. ;)

@justmoon
Copy link
Collaborator Author

Ok, try again now! I also found out why it was working for me - I had snappy-stubs-public.h in my /usr/local/include/. Sorry about that. :)

@pconstr
Copy link

pconstr commented Jul 24, 2012

both npm install and npm test ran without errors on Mac OS 10.6.8 (node 0.8.1)

@my8bird
Copy link
Owner

my8bird commented Jul 25, 2012

Two things I found

  1. This did not build for me with v0.6.8. While not surprising just wanted to make sure we were all on the same page since the travis build file indicates 0.6 should still work.
  2. When I ran the tests with v0.8.3 I got the following error. I can look into it but wanted to first know if others saw it already. I am running Ubuntu 12.04 if that is a key to anyone else.
  ✖ 1 of 41 tests failed:

  1) Iterator db.forRange() should iterate until limit key:

      actual expected

      107

  AssertionError: "107" == ""
      at i (/home/nathan/src/node-leveldb/test/iterator-test.coffee:202:18)
      at exports.Iterator.Iterator.forRange.next (/home/nathan/src/node-leveldb/lib/leveldb/iterator.js:142:9)
      at exports.Iterator.Iterator._wrapSeek (/home/nathan/src/node-leveldb/lib/leveldb/iterator.js:62:28)

@justmoon
Copy link
Collaborator Author

This did not build for me with v0.6.8. While not surprising just wanted to make sure we were all on the same page since the travis build file indicates 0.6 should still work.

Good point. From what I understand 0.6.13+ should include node-gyp and should work. Travis uses Node.js 0.6.19, so the .travis.yml can stay as it is. This branch works fine on Travis for 0.6 and 0.8.

The question is do we want to use >=0.6.13 as the minimum version in package.json?

When I ran the tests with v0.8.3 I got the following error. I can look into it but wanted to first know if others saw it already. I am running Ubuntu 12.04 if that is a key to anyone else.

I'm running the same and I haven't seen this, awaiting your feedback!

@mikepb
Copy link
Collaborator

mikepb commented Jul 25, 2012

The tests failures happen randomly. I haven't the time to track down the issue. There's a lot of multithreading involved, that may be the issue. I haven't looked at the library in months, so it's all going over my head.

Great work on the updates 👍

@justmoon
Copy link
Collaborator Author

The tests failures happen randomly.

I opened a ticket for it here: #40. I think the key to debugging those issues is to record a bunch of logs from the random failures and collect them in one place.

(That is assuming that @my8bird comes back confirming that this was indeed one of those random failures, of course.)

@my8bird
Copy link
Owner

my8bird commented Jul 25, 2012

The test error appears to be random so we can drop that from this thread since the #40 exists for that.

Secondly, I pulled down v0.6.19 to test that also and it built and passed all tests. Given that I would say we update the package.json to put 0.6.13 or 19 as the minimum the library will work with so that users know what to expect.

It is really cool to see all of the interest in this pull, thanks a lot all.

my8bird added a commit that referenced this pull request Jul 25, 2012
Added support for "node-gyp" build & update deps
@my8bird my8bird merged commit c7de25a into my8bird:master Jul 25, 2012
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

Successfully merging this pull request may close these issues.

None yet

5 participants