When someone installs node in his Mac with joyent's installer he gets a 
universal binary:

$ file `which node`
/usr/local/bin/node: Mach-O universal binary with 2 architectures
/usr/local/bin/node (for architecture i386):    Mach-O executable i386
/usr/local/bin/node (for architecture x86_64):  Mach-O 64-bit executable x86_64

If he then installs a module, for some reason (*) waf chooses to make it for 
i386 only:

$ npm install threads_a_gogo
...

$ file /Users/jorge/.node_libraries/threads_a_gogo.node 
/Users/jorge/.node_libraries/threads_a_gogo.node: Mach-O bundle i386

Then he's got a problem if on his Mac node is run in 64bits mode by default:

$ arch -arch i386 node 
node_modules/threads_a_gogo/test/test00_run_once_and_destroy.js 
Using 1 threads
[0] -> 0.4702872186899185
THREADS PER SECOND -> 47.6
BYE !


$ node node_modules/threads_a_gogo/test/test00_run_once_and_destroy.js 

module.js:485
  process.dlopen(filename, module.exports);
          ^
Error: 
dlopen(/Users/jorge/node_modules/threads_a_gogo/build/release/threads_a_gogo.node,
 1): no suitable image found.  Did find:
        
/Users/jorge/node_modules/threads_a_gogo/build/release/threads_a_gogo.node: 
mach-o, but wrong architecture
    at Object.Module._extensions..node (module.js:485:11)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Object.<anonymous> 
(/Users/jorge/node_modules/threads_a_gogo/test/test00_run_once_and_destroy.js:3:14)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)


How can I tell waf to make a universal binary ?

How can I override the arch waf defaults to?

(*)<https://github.com/joyent/node/blob/v0.8.18/tools/wafadmin/Tools/node_addon.py#L61-65>
-- 
Jorge.

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to