node
node copied to clipboard
gyp build issues on xcode
So here's my first attempt at this:
https://github.com/paddybyers/node/commits/gyp-xcode
Two issues:
- node-v8.gyp includes v8.gyp (which is, as intended, unmodified from the file in v8 upstream).
However, gyp goes wrong when files included in this way have a ".gyp" extension. renaming it ".gypi" resolves this. There should be a better way that removes the need for node-v8 altogether.
- the xcode generator is attempting to generate a "FrameworksPhase" for targets that do not themselves generate any binaries; in this case, the node_j2sc target.
In fact it only goes wrong because there is a library defined - -lz
- which is inherited from the global target default that is set up by configure. If this was not added by configure, but was added explicitly for the node executable target instead, then this problem would not appear. This is why v8 does not fall over the same problem even though it has similar js2c targets.
Nonetheless, I'm inclined to think it's a gyp/xcode bug, so the fix is in there. I added this:
http://code.google.com/p/gyp/issues/detail?id=237
over at gyp.
Re issue (1) above - I don't understand why v8-node.gyp is needed.
An alternative would be to remove v8-node.gyp altogether and just reference v8.gyp as the dependency.
If you do this, you still get the ../../build/common.gypi file included; when processing the v8.gyp file we have:
build_file_dict.['included_files'] = ['v8.gyp', '../../../../common.gypi', '../../../../options.gypi', '../../build/common.gypi']
I've committed this alternative change here: https://github.com/paddybyers/node/tree/gyp-xcode2
I think we should work out whether or not this works on other platforms before deciding.
I think we should work out whether or not this works on other platforms before deciding.
I've just tried the same change on debian and it builds.
Hi Paddy
When I try to ./configure the latest node repo on mac (10.6.8 xcode 4.2) I receive this problem: https://gist.github.com/1375150
I have tried this fix: https://raw.github.com/gist/1375212/91d0802ef5a1114b96451f3635676cc3090f01ca/gyp.diff (referenced from here: http://irclogger.com/.Node.js/2011-11-17). It moved from gyp_node -f 'xcode' to gyp_node -f 'make'. However, while it made the configure script to succeed, it create additional problems during make like "MCL_CURRENT undeclared".
What are the correct steps to build on mac?
P.S. I can successfully build the original node (v0.6.7) on this machine.
Thanks in advance
I haven't tried building master for a while, and I haven't seen that error before with -lz, but there are so many changes on master at the moment I'm not surprised.
I believe it's intended that by default the build will use xcodebuild (ie gyp -f xcode) rather than make. (make should also work but I don't know whether or not it's going to be officially supported).
Thanks Paddy
So, any workarounds to build your node snapshot on mac? or must I move to linux / windows?
I just checked out master and did ./configure && make and it built ok, but it used gyp -f make instead of xcode.
What am I missing?
So, any workarounds to build your node snapshot on mac? or must I move to linux / windows?
Which repo?
"paddybyers / node"
compiling again to send the exact error when using 'make' instead of 'xcode' ...
In order to enforce 'make' I changed the last line in configure script from:
subprocess.call(['tools/gyp_node','-f', gyp_target])
to:
subprocess.call(['tools/gyp_node','-f', 'make'])
This is the exact flow and error: https://gist.github.com/1613027
Hi,
That master branch is really old; I've not really been tracking node/master since 0.6.
I'm sorry; I thought initially you were talking about the main node master branch.
The isolate work I did predated the current effort by the core team, so it's not really a snapshot of the current development. If you want to try it then the maintained branch is v0.6-isolate; but whether or not it makes sense for you depends on what you're trying to do.
Thanks
I merely want to use anode on android :) I am especially interested in JS - Java bridge. Should v0.6-isolate be suitable for it?
I mean "paddybyers/anode"
ah. follow the build instructions: https://github.com/paddybyers/anode/wiki/Build
It uses the node/v0.6-android branch on node, which is the default.
Thank you, will do