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
fix: compilation of native modules on windows with older msvc versions #21950
Conversation
// A macro (V8_DEPRECATED) to mark classes or functions as deprecated. | ||
#if defined(V8_DEPRECATION_WARNINGS) | ||
-# define V8_DEPRECATED(message) [[deprecated(message)]] | ||
+# if defined(_MSC_VER) && _MSC_VER <= 1900 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The version number is extracted from https://devblogs.microsoft.com/cppblog/side-by-side-minor-version-msvc-toolsets-in-visual-studio-2017/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Presumably node will run into this too. should we be upstreaming this?
Yeah its better to upstream this, will do it tomorrow. |
Release Notes Persisted
|
@deepak1556 Can you take this back to 8? |
I was unable to backport this PR to "8-x-y" cleanly; |
@deepak1556 has manually backported this PR to "8-x-y", please check out #21960 |
Please see the above CL and the v8 team has responded with their supported release lines wrt msvc, so its better we remove this patch for Electron 9 and above. Let users fix this properly on their end using VS2017 build tools. |
Description of Change
https://chromium-review.googlesource.com/c/v8/v8/+/1847361 started using C++
[[deprecated]]
attribute which has issues when building with msvc from VS2015. Native modules compiling with this version will have error of the formaterror C2416: attribute 'deprecated("..")' cannot be applied in this context
from v8 headersThis can be verified with the following test case:
with 2015 toolchain there will be error:
with 2017 toolchain it will compile:
There is a msvc bug report out there which fixed this specific case, don't have the link. The PR just uses
__declspec(deprecated)
for those versions.Checklist
npm test
passesRelease Notes
Notes: fix compilation error for native modules building with VS 2015