-
Notifications
You must be signed in to change notification settings - Fork 423
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
Fixes to compile SDK with Visual Studio 2019 Update 16.10 (C++20) #820
Conversation
Codecov Report
@@ Coverage Diff @@
## main #820 +/- ##
=======================================
Coverage 95.50% 95.50%
=======================================
Files 156 156
Lines 6614 6614
=======================================
Hits 6316 6316
Misses 298 298 |
@maxgolov - Just to be clear, these are the temporary changes and supposed to be removed once the mainstream patches are available for vcpkg, and/or fix is provided by protobuf? |
Yes.
My goal is to set up the build loops with vs2015(c++11) and vs2019(c++20) sooner than the patches are integrated in the upstream. |
Identical fix approved in |
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.
LGTM to have a temporary overlay. We can have a separate issue for cleanup once vcpkg brings the new protobuf version.
We need to handle the removal of the overlay in a few months from now (ETA: 3-5 months), when the next major |
If the same PR is already under review in vcpkg repo, could we just update our submodule once it is merged there? Instead of dup the fix here? |
We were mostly trying to anchor to their major releases, not latest master. So once it's merged - I am not sure how soon we have to wait for their major release tag? That's why I was thinking to live with the overlay for another few months. vcpkg PR is this one: microsoft/vcpkg#18251 It's approved. All checks passed. But not merged yet. Once it's merged, then I guess we'd have to wait for a few weeks for the next major release tag. That's too slow. Even if we overlay, for another 5-6 months we'd be fine with the patch even if we intake their new tag.. So I'd rather put the update to latest |
This test is flaky (unrelated to my change, have been failing before): 179 - trace.CircularBufferTest.Simulation (Failed) Logged separate issue for that #841 |
Fixes #819
Changes
Quick recap:
latest update to Visual Studio 2019 compiler (16.10) introduces support for
constinit
. However, this new feature breaks protobuf ( vs2019 update 16.10 : illegal initialization ofconstinit
entity with a non-constant expression protocolbuffers/protobuf#8688 ). Either because the feature is not fully implemented, or because protobuf uses it in some interesting way.I am verifying that with the fix all code now builds and work well with
WITH_STL
(-DHAVE_CPP_STDLIB
) in C++20. And that's where we now get to compile protobuf-generated stubs for OTLP with C++20. The issue was that it all worked literally last week with 16.9, got broken in 16.10. Which is very frustrating.. Because GitHub Action runner images have also all already been updated to pull the latest Visual Studio 2019 Update 16.10. There is no way back. Means if we don't fix it now, we can't verify C++20 builds with msvc-2019-16.10 in our CI.Fixes
Local patch here includes:
vcpkg
fix, that I submitted here invcpkg
: [protobuf] Protobuf no longer compiles with vs2019 Update 16.10 w/ c++latest microsoft/vcpkg#18251protobuf
: constinit not working as expected in Visual Studio 2019 Update 16.10 protocolbuffers/protobuf#8690It may take some time before either of those fixes get merged.
There are no changes to API. No functionality changes expected other than fixing the build break. All files in
tools/ports/protobuf
are original files from mainlinevcpkg
port. With a minor fix (mainline PRs above) - applied on top, pretty much to disable the usage ofconstinit
. Since it appears to be not ready to be used yet. At least not in Protobuf codebase.tools/setup-buildtools.cmd
now covers overlays for:Pinning both of them to versions that work well; with patches on top to make sure it works well even with latest vs2019.
I also updated
vcpkg
submodule snapshot to:That's the latest
vcpkg
release published here, so I figured the patched overlays must be compatible with that exact latest version ofvcpkg
since it is giving us the latest stable versions of everything.