finding out which packages use node-waf?

100 views
Skip to first unread message

Jeroen Janssen

unread,
May 11, 2012, 6:56:02 AM5/11/12
to nodejs
Hi,

Is there an (easy) way of finding out which npm packages use node-waf?
I would like to find out which node modules that build C/C++ code have
not switched to node-gyp yet.

I was hoping it could be derived from the package.json, but so far
that doesn't seem to be the case (i.e. some modules call an install
script from package.json and that does a node-waf call so inspecting
package.json is not enough).

Is the 'only' way to detect node-waf usage to look for a 'wscript'
file inside the addon tar.gz?
i.e. that would mean downloading every (last version of a) package,
unpacking it and checking for the wscript file?

Best regards,

Jeroen Janssen

Matt

unread,
May 11, 2012, 11:24:48 AM5/11/12
to nod...@googlegroups.com
Mine (fs-ext) hasn't - I'd welcome patches to convert it over though...


--
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 nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Nathan Rajlich

unread,
May 11, 2012, 2:48:39 PM5/11/12
to nod...@googlegroups.com
Here's the list of packages with "preinstall", "install", or "postinstall" scripts: http://registry.npmjs.org/-/scripts?scripts=install,preinstall,postinstall.

Now, that doesn't necessarily mean the module is using node-waf, but in reality there's very little use case for using these script phases with a native module, since npm will *just work* when it comes to detecting a "wscript" file (and compile using node-waf) or a "binding.gyp" file (which will compile using npm's bundled node-gyp).

The smaller this list of entries is the better.

Jeroen Janssen

unread,
May 11, 2012, 5:16:00 PM5/11/12
to nodejs
On May 11, 8:48 pm, Nathan Rajlich <nat...@tootallnate.net> wrote:
> Here's the list of packages with "preinstall", "install", or "postinstall"
> scripts:http://registry.npmjs.org/-/scripts?scripts=install,preinstall,postin....

Thanks for the query!

I noticed though that there are atleast 2 entries stating node-gyp
usage, but inspecting the github repository doesn't mention anything
related in the package.json (and the history of package.json also
doesn't suggest it was present).

This is atleast with:
microtime https://github.com/wadey/node-microtime/blob/master/package.json
mdns https://github.com/japj/node_mdns/blob/master/package.json

Any idea what could have happened here?
(was there ever a version of npm that inserted "node-gyp" commands
into the published package.json or something like that?)

> Now, that doesn't necessarily mean the module is using node-waf, but in
> reality there's very little use case for using these script phases with a
> native module, since npm will *just work* when it comes to detecting a
> "wscript" file (and compile using node-waf) or a "binding.gyp" file (which
> will compile using npm's bundled node-gyp).
>
> The smaller this list of entries is the better.
>
> On Fri, May 11, 2012 at 8:24 AM, Matt <hel...@gmail.com> wrote:
> > Mine (fs-ext) hasn't - I'd welcome patches to convert it over though...

I'm cleaning up some of the current node-gyp usage first, but I'll be
going through the list some kind of way<tm> (in my spare time).

Jeroen

Nathan Rajlich

unread,
May 11, 2012, 5:40:48 PM5/11/12
to nod...@googlegroups.com
Hhhmmm, it's possible that npm injected "install" scripts at one point. Isaac?

Jeroen Janssen

unread,
May 13, 2012, 2:58:56 AM5/13/12
to nodejs
On May 11, 8:48 pm, Nathan Rajlich <nat...@tootallnate.net> wrote:
> Here's the list of packages with "preinstall", "install", or "postinstall"
> scripts:http://registry.npmjs.org/-/scripts?scripts=install,preinstall,postin....

Is there a way to sort this list on 'updated' date?

(i.e. recently updated packages have a 'high' chance of being actively
maintained compared to packages that have not been touched for over a
year or so)

Jeroen

Jeroen Janssen

unread,
May 13, 2012, 3:19:08 AM5/13/12
to nodejs
On May 11, 11:40 pm, Nathan Rajlich <nat...@tootallnate.net> wrote:
> Hhhmmm, it's possible that npm injected "install" scripts at one point.
> Isaac?

After some investigation it seems npm does package.json parsing and
'fixes' some typos, adds some extra (_npmVersion, _nodeVersion)
items,
etc as part of:
https://github.com/isaacs/npm/blob/master/lib/utils/read-json.js

The 'fixed' package.json gets put in the npm registry and that
includes
a line with node-gyp in the install scripts if needed.

I think I send patches for almost all packages that call node-gyp
manually in their package.json (incl removal of node-gyp in the
dependencies
where present, since npm includes node-gyp).

Jeroen

Ken

unread,
May 14, 2012, 1:21:42 AM5/14/12
to nod...@googlegroups.com
If forced retirement of node-waf is the goal, can you just release a new version of it that either is a wrapper for node-gyp or whines bitterly whenever it's used? Could even make it "phone home" to tell the package author what they need to change. Seems like this would be easier than tracking down all the node-waf dependents by hand.

--Ken

Jeroen Janssen

unread,
Jun 29, 2012, 3:55:56 PM6/29/12
to nodejs
I should have known. In a related question on irc, Isaac just
generated the following query:
http://registry.npmjs.org/-/scripts?scripts=install,preinstall,postinstall&match=\bnode-waf\b

Which results in 277 packages.
Reply all
Reply to author
Forward
0 new messages