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

node-dtrace-provider should be an optionalDependency #100

Closed
isaacs opened this issue Mar 9, 2012 · 14 comments
Closed

node-dtrace-provider should be an optionalDependency #100

isaacs opened this issue Mar 9, 2012 · 14 comments

Comments

@isaacs
Copy link
Contributor

isaacs commented Mar 9, 2012

Restify is a great platform. It's a shame that it can't be used on Windows or Linux.

Possible workaround: port dtrace to Linux and Windows.

Also acceptable: list dtrace as an optional dependency, and don't use it if it's not available.

@mcavage
Copy link
Contributor

mcavage commented Mar 9, 2012

Yep, this is the 3rd or 4th time this has come up. dtrace-provider is available on linux (I had patched it with a bunch of #ifdef's), but not windows. I will look into the optionalDependency trick and stubbing it out internally.

mcavage added a commit that referenced this issue Mar 9, 2012
…t (will require npm 1.1.5 to work smoothly)
@mcavage
Copy link
Contributor

mcavage commented Mar 9, 2012

To work smoothly with npm install restify, this will require npm 1.1.5, as that will take new action on the optionalDependencies block, whereby npm will still install restify successfully, even if node-waf ... fails. In this case, we'd have an installed restify without a dtrace dependency. The code change then just attempts to load dtrace, assuming it might fail, and in the cases it does fail, just creates a stub. This should solve both windows and the heroku et al cases.

@mcavage
Copy link
Contributor

mcavage commented Mar 11, 2012

Resolving this.

@mypark
Copy link

mypark commented Mar 12, 2012

Isn't the latest version of npm 1.1.4? I tried npm update npm and got only 1.1.4.

@isaacs
Copy link
Contributor Author

isaacs commented Mar 12, 2012

@mypark Yes. npm 1.1.5 will come out soon to address the shortcoming here.

@ryancole
Copy link

I just wanted to ask about this issue. I am seeing the following error message from restify ...

λ ~/projects/raidboss/api/src/ node
> var restify = require('restify');
undefined
> var server = restify.createServer();
[Error: Cannot find module './DTraceProviderBindings']
undefined

... using npm version 1.1.12, and restify version 1.3.0. It looks like I can continue using restify, despite that message. Is this what was changed with npm version 1.1.5? Did previous versions cause this to error out completely? Or, am I still seeing this error as it was originally reported for this issue? I just want to be sure to be clear what it is I am seeing.

Thanks.

@mcavage
Copy link
Contributor

mcavage commented Mar 26, 2012

Hi Ryan,

So what changed was that as an optionalDependency, NPM won't blow up
running npm install restify on platforms where it doesn't compile
(Windows, and some flavors of Linux). The installation of DTrace
will fail, but npm will ignore it. Restify has always treated as
"I'll try to load it, and if it fails to load, I'll stub it out".
That error message (to stderr, right?) is from node, not restify,
barfing that it can't load the binary dependency (i.e., you're on a
platform where it partially installed). There's a try/catch around
it in restify, and it's ignored. I believe in the latest commits in
master, I made it stop spitting out to stderr.

tl;dr, npm let you install, it's not really there, it whines on
stderr, restify keeps going fine.

m

On Sun, Mar 25, 2012 at 4:44 PM, Ryan Cole
[email protected]
wrote:

I just wanted to ask about this issue. I am seeing the following error message from restify ...

λ ~/projects/raidboss/api/src/ node
> var restify = require('restify');
undefined
> var server = restify.createServer();
[Error: Cannot find module './DTraceProviderBindings']
undefined

... using npm version 1.1.12, and restify version 1.3.0. It looks like I can continue using restify, despite that message. Is this what was changed with npm version 1.1.5? Did previous versions cause this to error out completely? Or, am I still seeing this error as it was originally reported for this issue? I just want to be sure to be clear what it is I am seeing.

Thanks.


Reply to this email directly or view it on GitHub:
#100 (comment)

@hoffmanc
Copy link

@mcavage: I am seeing the same thing on heroku still...

2012-04-17T03:08:33+00:00 app[web.1]: [Error: Cannot find module './DTraceProviderBindings']
2012-04-17T03:08:33+00:00 app[web.1]: 
2012-04-17T03:08:33+00:00 app[web.1]: events.js:48
2012-04-17T03:08:33+00:00 app[web.1]:         throw arguments[1]; // Unhandled 'error' event
2012-04-17T03:08:33+00:00 app[web.1]:                        ^
2012-04-17T03:08:33+00:00 app[web.1]: Error: ENOENT, open 'log/server.log'

@mcavage
Copy link
Contributor

mcavage commented Apr 17, 2012

Are you sure that error is actually from this? (that log makes it
look like your error is from the server log...).

On Mon, Apr 16, 2012 at 8:13 PM, Chris Hoffman
[email protected]
wrote:

@mcavage: I am seeing the same thing on heroku still...

2012-04-17T03:08:33+00:00 app[web.1]: [Error: Cannot find module './DTraceProviderBindings']
2012-04-17T03:08:33+00:00 app[web.1]:
2012-04-17T03:08:33+00:00 app[web.1]: events.js:48
2012-04-17T03:08:33+00:00 app[web.1]:         throw arguments[1]; // Unhandled 'error' event
2012-04-17T03:08:33+00:00 app[web.1]:                        ^
2012-04-17T03:08:33+00:00 app[web.1]: Error: ENOENT, open 'log/server.log'


Reply to this email directly or view it on GitHub:
#100 (comment)

@hoffmanc
Copy link

@mcavage: you're probably right. Sorry.

@mcavage
Copy link
Contributor

mcavage commented Apr 17, 2012

No worries. The [Error: ...] thing is from stderr, as opposed to it
actually being an error (I do realize the ironic non-helpfulness of
that...).

m

On Tue, Apr 17, 2012 at 7:42 AM, Chris Hoffman
[email protected]
wrote:

@mcavage: you're probably right.  Sorry.


Reply to this email directly or view it on GitHub:
#100 (comment)

@hoffmanc
Copy link

@mcavage : The problem was related to a file log, and arbitrary file writing is a no-no for Heroku. Thanks for pointing out the obvious, original problem

@gagle
Copy link

gagle commented Feb 24, 2013

I'm on windows. I don't have dtrace. I don't have python. All I want is to install restify but I can't. It says that I don't have python, therefore I can't compile because dtrace tries to compile with node-gyp...

@kenorb
Copy link

kenorb commented Apr 9, 2013

Reinstalling from http://nodejs.org/download/ helps.
Then: npm install dtrace-provider

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

No branches or pull requests

7 participants