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

C++20 breaks #7748

Closed
asklar opened this issue May 8, 2021 · 6 comments
Closed

C++20 breaks #7748

asklar opened this issue May 8, 2021 · 6 comments

Comments

@asklar
Copy link
Member

asklar commented May 8, 2021

  1. Error info:
ReactInstanceWin.i
F:\gitP\microsoft\react-native-windows\vnext\codegen\NativeDeviceInfoSpec.g.h(23): error C3615: constexpr function 'winrt::Microsoft::ReactNative::TurboModuleSpec::CheckMethodsHelper' cannot result in a constant expression
F:\gitP\microsoft\react-native-windows\vnext\codegen\NativeDeviceInfoSpec.g.h(23): note: failure was caused by call of undefined function or one not declared 'constexpr'
F:\gitP\microsoft\react-native-windows\vnext\codegen\NativeDeviceInfoSpec.g.h(23): note: see usage of '__builtin_array_init_helper'
F:\gitP\microsoft\react-native-windows\vnext\Microsoft.ReactNative.Cxx\NativeModules.h(1186): note: see reference to function template instantiation 'void Microsoft::ReactNativeSpecs::DeviceInfoSpec::ValidateModule<TModule>(void) noexcept' being compiled
        with
        [
            TModule=Microsoft::ReactNative::DeviceInfo
        ]
F:\gitP\microsoft\react-native-windows\vnext\Microsoft.ReactNative\ReactHost\ReactInstanceWin.cpp(297): note: see reference to function template instantiation 'winrt::Microsoft::ReactNative::ReactModuleProvider winrt::Microsoft::ReactNative::MakeTurboModuleProvider<Microsoft::ReactNative::DeviceInfo,Microsoft::ReactNativeSpecs::DeviceInfoSpec>(void) noexcept' being compiled
  1. Error info: Seems to be related to https://github.com/microsoft/STL/blob/main/stl/inc/coroutine#L21 and https://github.com/microsoft/STL/blob/main/stl/inc/experimental/coroutine#L49.
Folly.lib(json.obj) : error LNK2038: mismatch detected for '_COROUTINE_ABI': value '2' doesn't match value '1' in ChakraHelpers.obj
Folly.lib(dynamic.obj) : error LNK2038: mismatch detected for '_COROUTINE_ABI': value '2' doesn't match value '1' in ChakraHelpers.obj
Folly.lib(SpookyHashV2.obj) : error LNK2038: mismatch detected for '_COROUTINE_ABI': value '2' doesn't match value '1' in ChakraHelpers.obj
Folly.lib(Conv.obj) : error LNK2038: mismatch detected for '_COROUTINE_ABI': value '2' doesn't match value '1' in ChakraHelpers.obj
Folly.lib(SafeAssert.obj) : error LNK2038: mismatch detected for '_COROUTINE_ABI': value '2' doesn't match value '1' in ChakraHelpers.obj
Folly.lib(pch.obj) : error LNK2038: mismatch detected for '_COROUTINE_ABI': value '2' doesn't match value '1' in ChakraHelpers.obj
Folly.lib(Unicode.obj) : error LNK2038: mismatch detected for '_COROUTINE_ABI': value '2' doesn't match value '1' in ChakraHelpers.obj
Folly.lib(Assume.obj) : error LNK2038: mismatch detected for '_COROUTINE_ABI': value '2' doesn't match value '1' in ChakraHelpers.obj
Folly.lib(Format.obj) : error LNK2038: mismatch detected for '_COROUTINE_ABI': value '2' doesn't match value '1' in ChakraHelpers.obj
Folly.lib(json_pointer.obj) : error LNK2038: mismatch detected for '_COROUTINE_ABI': value '2' doesn't match value '1' in ChakraHelpers.obj
Folly.lib(ToAscii.obj) : error LNK2038: mismatch detected for '_COROUTINE_ABI': value '2' doesn't match value '1' in ChakraHelpers.obj
Folly.lib(MallocImpl.obj) : error LNK2038: mismatch detected for '_COROUTINE_ABI': value '2' doesn't match value '1' in ChakraHelpers.obj
F:\gitP\microsoft\react-native-windows\\vnext\\target\x86\Release\Microsoft.ReactNative\Microsoft.ReactNative.dll : fatal error LNK1319: 12 mismatches detected
12>C:\rnw\node_modules\react-native\ReactCommon\jsi\jsi\test\testlib.cpp(511,1): error C2440: '<function-style-cast>': cannot convert from 'initializer list' to 'std::string'
12>C:\rnw\node_modules\react-native\ReactCommon\jsi\jsi\test\testlib.cpp(528,1): message : No constructor could take the source type, or constructor overload resolution was ambiguous
  EXPECT_TRUE(f.call(
                   rt,
                   nullptr,
                   true,
                   3.14,
                   2.71f,
                   17,
                   "s1",
                   String::createFromAscii(rt, "s2"),
                   std::string{"s3"},
                   std::string{u8"s\u2600"},
                   // invalid UTF8 sequence due to unexpected continuation byte
                   std::string{"s\x80"},
                   Object(rt),
                   Array(rt, 1),
                   function("function(){}"),
                   Value(42))
                  .getBool());
@asklar asklar added the bug label May 8, 2021
@ghost ghost added the Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) label May 8, 2021
@asklar
Copy link
Member Author

asklar commented May 8, 2021

For issue 3), see facebook/react-native#31496

@chrisglein
Copy link
Member

For issue 1) that's under our control as that's from our codegen.
We could split this issue up but it sounds like 2) and 3) are external and 1) is ours. So let's track fixing 1) here. Possible 2) is an overlap with RNW code.
Impact for us is getting automated validation of future C++/tool updates. Not impacting us today, but will.
Could add some pipeline validation that C++20 builds.

@chrisglein chrisglein added this to the Backlog milestone May 13, 2021
@chrisglein chrisglein added Area: Build Infrastructure and removed Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) labels May 13, 2021
@beached
Copy link

beached commented Jul 19, 2021

For issue 1) that's under our control as that's from our codegen.
We could split this issue up but it sounds like 2) and 3) are external and 1) is ours. So let's track fixing 1) here. Possible 2) is an overlap with RNW code.
Impact for us is getting automated validation of future C++/tool updates. Not impacting us today, but will.
Could add some pipeline validation that C++20 builds.

Sorry to interject into the thread here. Is there a link for this on developer community, the __builtin_array_init_helper issue is affecting another codebase and it would be nice to track

@chrisglein
Copy link
Member

@asklar Older issue - are we past all this? Can close?

@QuellaZhang
Copy link

Verified that issue 1) still exists.

@marlenecota marlenecota added the Recommend: Backlog Recommend that issue should be given Backlog milestone. label Aug 29, 2023
@chiaramooney chiaramooney removed the Recommend: Backlog Recommend that issue should be given Backlog milestone. label Sep 21, 2023
@TatianaKapos
Copy link
Contributor

I'm hitting the first error in the CI for upgrading gallery to 0.74 https://dev.azure.com/ms/react-native-gallery/_build/results?buildId=568596&view=logs&j=12f1170f-54f2-53f3-20dd-22fc7dff55f9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants