-
Notifications
You must be signed in to change notification settings - Fork 438
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
[BUILD] Fix build for esp32 #3155
[BUILD] Fix build for esp32 #3155
Conversation
Fix for toolchains that alias int32_t as long int and in this way confuse all the honest people.
✅ Deploy Preview for opentelemetry-cpp-api-docs canceled.
|
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.
Approved the workflow to run CI, but blocking the merge.
I would like first to understand the issue in more details,
to decide the best course of action for the fix.
@marcalff I've integrated the opentelemetry-cpp library for ESP32 project. In the middle of this process main difficulty was to make it buildable on ESP-IDF (v5.3.1) toolchain. Repo was configured as follows:
CMAKE_SYSTEM_PROCESSOR is here only to pass cmake configure checks, it doesn't affect the OT project. I suppose we have to add here 'xtensa' too.
Result compile command:
This code compiles perfect with host compiler (which is GCC 13.2 by the way, and this stressed me a lot how can 2 similar compilers with exact same flags produce different output!). But with ESP-IDF it produces an error:
The cause of this error is that here you have
and The thing is that here we have a set of allowed values for Attribute:
And it appeals to int32_t. And it results in failing detection int resolution for variant in I think the best solution is to change all random non-defined Possible side-effects: P.S.
P.P.S. |
I don't know how to put this to already created PR, but this can fix this abandoned issue #2483 |
Thanks for all the details, looking. |
Could you clarify, what is the value of
|
Ok, let's see this in a different PR.
Thanks for reporting it.
Great, thanks for that. |
It's 4 bytes, but it doesn't help since it doesn't have an alias for |
7a0249a
to
444d869
Compare
It fails to compile test with this. @marcalff
UPD: |
d2cdb50
to
d160f8a
Compare
Yes, saw that. This exposed a different issue: the existing header files are not so clean when it comes to overload resolution, with helpers conflicting with override methods using default values.
Changing the test is only a work around, because the original test code is supposed to work. I am reverting the change back to your original patch, as it is good enough. The various overrides need some cleanup, but I prefer to address that in a separate PR, and not delay this one because of unrelated issues. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3155 +/- ##
=======================================
Coverage 87.86% 87.86%
=======================================
Files 195 195
Lines 6151 6151
=======================================
Hits 5404 5404
Misses 747 747
|
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, thanks for the fix, and all the details for this platform.
Fix for toolchains that alias
int32_t
tolong int
. In this way we don't haveint
in variant of attributes.If it's defined as strict int32_t, int64_t etc, I think it's better to have strict types everywhere.
ESP-IDF (v5.3.1) toolchain fails to compile as they don't have int in attributes variant list.
Fixes # (issue)
Changes
Please provide a brief description of the changes here.
For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes