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

fix: building node modules with Visual Studio 2017 #34217

Merged
merged 1 commit into from May 23, 2022

Conversation

miniak
Copy link
Contributor

@miniak miniak commented May 13, 2022

Description of Change

Build error occurs due to this in Visual Studio 2017:

/**
 * Weakness type for weak handles.
 */
enum class WeakCallbackType {
  /**
   * Passes a user-defined void* parameter back to the callback.
   */
  kParameter,
  /**
   * Passes the first two internal fields of the object back to the callback.
   */
  kInternalFields,
  /**
   * Passes a user-defined void* parameter back to the callback. Will do so
   * before the object is actually reclaimed, allowing it to be resurrected. In
   * this case it is not possible to set a second-pass callback.
   */
  kFinalizer V8_ENUM_DEPRECATED("Resurrecting finalizers are deprecated "
                                "and will not be supported going forward.")
};

In Electron 18, this was previously:

enum class WeakCallbackType { kParameter, kInternalFields, kFinalizer };

Follow-up to #34109

Checklist

Release Notes

Notes: Fixed building node modules with Visual Studio 2017

@miniak miniak requested review from a team as code owners May 13, 2022 01:19
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label May 13, 2022
@miniak miniak added semver/patch backwards-compatible bug fixes target/19-x-y labels May 13, 2022
@deepak1556
Copy link
Member

Attribute support for enumerators comes with /std:c++17 in msvc https://docs.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance?view=msvc-170, can you try building with it ?

@miniak
Copy link
Contributor Author

miniak commented May 13, 2022

Attribute support for enumerators comes with /std:c++17 in msvc https://docs.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance?view=msvc-170, can you try building with it ?

I will try, but for some reason in Visual Studio 2019 it works without /std:c++17.

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label May 14, 2022
@ckerr
Copy link
Member

ckerr commented May 17, 2022

Attribute support for enumerators comes with /std:c++17 in msvc https://docs.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance?view=msvc-170, can you try building with it ?

I will try, but for some reason in Visual Studio 2019 it works without /std:c++17.

V8 has added more C++17isms into its headers recently and that held up the Chromium roll for a bit last week. Since we'll all need to be building with --std=c++17 anyway, I'm not sure this patch is the right fix?

@miniak
Copy link
Contributor Author

miniak commented May 19, 2022

@ckerr I've tried building our node modules with /std:c++latest on Visual Studio 2017 and it's still broken.

@miniak miniak self-assigned this May 21, 2022
@zcbenz zcbenz merged commit 291eb60 into main May 23, 2022
@zcbenz zcbenz deleted the miniak/deprecated-attribute branch May 23, 2022 11:04
@release-clerk
Copy link

release-clerk bot commented May 23, 2022

Release Notes Persisted

Fixed building node modules with Visual Studio 2017

@trop
Copy link
Contributor

trop bot commented May 23, 2022

I have automatically backported this PR to "19-x-y", please check out #34316

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants