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

Enable V8 deprecation warnings for native modules #920

Closed
wants to merge 1 commit into from
Closed

Enable V8 deprecation warnings for native modules #920

wants to merge 1 commit into from

Conversation

matthewloring
Copy link

It will be helpful for native module developers to be aware of any
deprecated apis they are using so that they can update before their
modules break completely. Module developers can override this option
in their binding.gyp if they do not want to see these warnings.

It will be helpful for native module developers to be aware of any
deprecated apis they are using so that they can update before their
modules break completely. Module developers can override this option
in their binding.gyp if they do not want to see these warnings.
@rvagg
Copy link
Member

rvagg commented May 9, 2016

I'm +1 on this, whatchy'all think @nodejs/addon-api & @nodejs/v8?

@jeisinger
Copy link

why not add a block

'variables': {
'v8_deprecation_warnings%': 1,
}

instead of setting the macro directly?

@bnoordhuis
Copy link
Member

I'm +1 too but I think it's important to first make sure that node v4-v6 (by which I mean node.h and friends) and nan are V8_DEPRECATION_WARNINGS-clean before releasing it into the wild.

(Node.js is compiled with deprecation warnings enabled but that doesn't extend to files that aren't used by core itself, like src/node_object_wrap.h.)

@bnoordhuis
Copy link
Member

@jeisinger V8's *.gypi files aren't included when building add-ons, only node's common.gypi and config.gypi.

@jeisinger
Copy link

fair enough, +1 then to your proposal

@kkoopa
Copy link

kkoopa commented May 9, 2016

-1, it will unleash an endless stream of useless issues and headache on every level of the dependency chain. It is harder to find an addon that does not use deprecated APIs than one that does not.

@matthewloring
Copy link
Author

More issues should alert module authors to upgrade before things start breaking. This is especially important given how widespread the dependencies on deprecated APIs are.

@matthewloring
Copy link
Author

Addressing nan deprecations here: nodejs/nan#568

@matthewloring
Copy link
Author

nodejs/nan#568 and nodejs/nan#569 should clear up the nan deprecation warnings once they land.

@matthewloring
Copy link
Author

nodejs/nan#568 and nodejs/nan#569 have landed and I didn't observe any deprecation warnings when compiling src/node_object_wrap.h. Are there any other files that aren't used by core and should be checked explicitly?

bnoordhuis pushed a commit that referenced this pull request May 30, 2016
It will be helpful for native module developers to be aware of any
deprecated apis they are using so that they can update before their
modules break completely. Module developers can override this option
in their binding.gyp if they do not want to see these warnings.

PR-URL: #920
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
@bnoordhuis
Copy link
Member

Landed in 15fd56b, thanks. There are one or two more PRs that I'd like to land before putting out a new release.

@bnoordhuis bnoordhuis closed this May 30, 2016
@rvagg rvagg mentioned this pull request Jun 14, 2016
zkat pushed a commit to npm/npm that referenced this pull request Jun 29, 2016
Headline items:
 * Fix for Visual Studio 2015 __pfnDliNotifyHook2 failures nodejs/node-gyp#952
 * Fix for AIX using fs.statSync nodejs/node-gyp#955
 * More verbose msbuild.exe missing error output https://github.com/nodejs/node-gyp/pull/930/files
 * Added --silent for --loglevel=silent nodejs/node-gyp#937
 * Enable V8 deprecation warnings for native addons nodejs/node-gyp#920

Full changelog at https://github.com/nodejs/node-gyp/blob/master/CHANGELOG.md

Credit: @rvagg
PR-URL: #13199
Reviewed-By: @zkat
zkat pushed a commit to npm/npm that referenced this pull request Jun 29, 2016
Headline items:
 * Fix for Visual Studio 2015 __pfnDliNotifyHook2 failures nodejs/node-gyp#952
 * Fix for AIX using fs.statSync nodejs/node-gyp#955
 * More verbose msbuild.exe missing error output https://github.com/nodejs/node-gyp/pull/930/files
 * Added --silent for --loglevel=silent nodejs/node-gyp#937
 * Enable V8 deprecation warnings for native addons nodejs/node-gyp#920

Full changelog at https://github.com/nodejs/node-gyp/blob/master/CHANGELOG.md

Credit: @rvagg
PR-URL: #13200
Reviewed-By: @zkat
zkat pushed a commit to npm/npm that referenced this pull request Jun 29, 2016
Headline items:
 * Fix for Visual Studio 2015 __pfnDliNotifyHook2 failures nodejs/node-gyp#952
 * Fix for AIX using fs.statSync nodejs/node-gyp#955
 * More verbose msbuild.exe missing error output https://github.com/nodejs/node-gyp/pull/930/files
 * Added --silent for --loglevel=silent nodejs/node-gyp#937
 * Enable V8 deprecation warnings for native addons nodejs/node-gyp#920

Full changelog at https://github.com/nodejs/node-gyp/blob/master/CHANGELOG.md

Credit: @rvagg
PR-URL: #13199
Reviewed-By: @zkat
zkat pushed a commit to npm/npm that referenced this pull request Jun 30, 2016
Headline items:
 * Fix for Visual Studio 2015 __pfnDliNotifyHook2 failures nodejs/node-gyp#952
 * Fix for AIX using fs.statSync nodejs/node-gyp#955
 * More verbose msbuild.exe missing error output https://github.com/nodejs/node-gyp/pull/930/files
 * Added --silent for --loglevel=silent nodejs/node-gyp#937
 * Enable V8 deprecation warnings for native addons nodejs/node-gyp#920

Full changelog at https://github.com/nodejs/node-gyp/blob/master/CHANGELOG.md

Credit: @rvagg
PR-URL: #13199
Reviewed-By: @zkat
@rvagg
Copy link
Member

rvagg commented Jul 13, 2016

Apparently this prints stack traces for users now, which is likely to get us (and addon authors) a lot of needless attention.

e.g. #991 coming from:

    base::OS::PrintError(
        "(node) v8::%sTemplate::Set() with non-primitive values is deprecated\n"
        "(node) and will stop working in the next major release.\n",
        templ->IsFunctionTemplateInfo() ? "Function" : "Object");
    isolate->PrintStack(stderr, i::Isolate::kPrintStackConcise);
    base::DumpBacktrace();

in deps/v8/src/api.cc

@bnoordhuis
Copy link
Member

@rvagg No, the warning is emitted by a V8 patch that we're floating in node.

@rvagg
Copy link
Member

rvagg commented Jul 13, 2016

@bnoordhuis is there a more minimal thing we can print cause looking at the output in #991 it's pretty dramatic.

@bnoordhuis
Copy link
Member

bnoordhuis commented Jul 13, 2016

That's kind of the point. It's a strong incentive to update and it helps with finding the offending call site. If it just printed a warning without a stack trace, you wouldn't know from what dependency it originates.

(I say this as someone who was less than amused by the flood of bogus bug reports he got about a deprecation warning in a dependency. Never again.)

@ofrobots
Copy link

Apparently this prints stack traces for users now, which is likely to get us (and addon authors) a lot of needless attention.

Note that this issue is about compile time deprecation warnings whereas #991 is a runtime warning. This doesn't print a stack trace.

@rvagg
Copy link
Member

rvagg commented Jul 13, 2016

ok, I stand corrected, missed that one obviously!

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.

6 participants