-
Notifications
You must be signed in to change notification settings - Fork 559
Patches to enable Visual Studio 2015 - Update 2 support #565
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # Disable formatting for Google Abseil library snapshot | ||
| DisableFormat: true | ||
| SortIncludes: false |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # Notes on Abseil Variant implementation | ||
|
|
||
| This is a snapshot of Abseil Variant `absl::variant` from Abseil `v2020-03-03#8`. | ||
|
maxgolov marked this conversation as resolved.
|
||
|
|
||
| This code is required to compile OpenTelemetry code in vs2015 because MPark Variant implementation is not compatible with vs2015. | ||
|
|
||
| Build option `HAVE_ABSEIL_VARIANT` allows to enable the build with `absl::variant`, `absl::get` and `absl::visit` as defalt implementation for `nostd::` classes. | ||
|
Comment on lines
+5
to
+7
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a reason we have to ship two variant implementations? If
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd like to take a two-staged approach. We should use Abseil everywhere, but I'd like to keep it under the build option right now until I fully test all existing exporters with it. Within the same OS class the ABI compatibility is retained irrespective of what implementation we take, e.g. Mpark works for Linux and Mac no problem. Whereas Abseil works for Windows. I want to send a follow-up PR that adds a build loop for Windows to switch over to Abseil for Variant. Then we can do this for Linux and Mac.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think long-term before v1.0 GA we should switch to Abseil for variant. That'd be great for another reason: we can get rid of Boost license in our list of licenses because only MPark variant is Boost-licensed, whereas Abseil is also Apache License v2.0 as the rest of code. But I'd like to do this switch in a separate PR.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense. Can you add an additional issue for this (apart from the license one), otherwise this might be lost when just looking at issue titles. I'd be fine with switching to absl as default, having MPark under a switch (then our CI pipeline would verify how it's working). However, I assume you expect changes to be necessary for it to work on Linux.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| Going forward it makes sense to use `absl::variant` as default implementation for Windows OS and vs2015, vs2017, vs2019 and newer compilers. | ||
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.
Check Visual Studio 2015 compiler like via
_MSC_VERto separate the workaround for it?Uh oh!
There was an error while loading. Please reload this page.
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.
Does
std::copyitself perform a bounds checking? i.e. what if new temp size -new_capacityis less than the old capacity? Since it's a raw pointer, I think the old code had a problem: it was copying beyond the allocated buffer, buffer overflow.