-
Notifications
You must be signed in to change notification settings - Fork 648
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
refactor code to accomodate Nuitka compilation to C++ code #3154
refactor code to accomodate Nuitka compilation to C++ code #3154
Conversation
@sorinansys can you sign the CLA #3154 (comment)? |
Can you see if the issue is still happening on the main branch since #3047 was merged? We are no longer using |
@aabmass , I am currently working with my employer to get the CLA manager signature. Should not take long. Thank you for the reminder. |
Sure. I will checkout the code, run the tests and let you know the outcome. |
Hi @aabmass I confirm that I can still see the issue after the #3407 was merged in main. I will merge main on my branch and then accommodate the merged code to Nuitka compilation. Sorry for the late response. PR to be updated soon. |
1b1daa7
to
a9a96aa
Compare
…m/sorinansys/opentelemetry-python into sorin-ansys-nuitka-friendly-patch # Conflicts: # opentelemetry-api/src/opentelemetry/context/__init__.py # opentelemetry-api/src/opentelemetry/propagate/__init__.py
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.
With these changes applied, Nuitka compilation generates correct C++ code that mimics the functionality in the Python code
@sorinansys can you try something else? This may be related to an issue we have with the |
@ocelotl The code in #3168 does not resolve the issue in #3153. Nuitka miscompiles the combination of Python Please not that when running test case in #3153 with the most recent opentelemetry code an additional Nuitka runtime error is thrown when importing opentelemetry.sdk.resources module. I am looking to see if there is a solution for that error also Thank you |
1 similar comment
@ocelotl The code in #3168 does not resolve the issue in #3153. Nuitka miscompiles the combination of Python Please not that when running test case in #3153 with the most recent opentelemetry code an additional Nuitka runtime error is thrown when importing opentelemetry.sdk.resources module. I am looking to see if there is a solution for that error also Thank you |
@aabmass @ocelotl , I've run several tests with a newer Nuitka (version 1.5.3) and the compilation of Issue #3153 is specific to Nuitka version 1.4.1. One can close the issue as described with the suggestion to update Nuitka, or merge this PR to make OTEL code compatible with older Nuitka version. I found both options reasonable. I will let you decide how to proceed. I will also add this comment in Issue #3153 |
@sorinansys I will close this since you mentioned it works with |
Description
this is the proposed solution for Issue 3153
The inlined Python code used to retrieve the _RUNTIME_CONTEXT , although non-ambiguous in Python, is not clear enough
for Nuitka compiler to generate C++ functionality with the same functionality as the one in original Python code
Nuitka generates C++ code that compiles and link successfully, but it generates error at runtime.
Fixes # (issue)
The code to retrieve _RUNTIME_CONTEXT is refactored without alteration of functionality, using a slightly explicit coding style that accommodates the Nuitka compiler and facilitates generation of C++ code with the same functionality as the original OpenTelemetry code
Type of change
Python functionality is unchanged.
The new feature is that OpenTelemetry code can be compiled with Nuitka without this runtime error
How Has This Been Tested?
Tests were performed using the test case in Issue 3153
test results before the change:
Test result after change:
test results before the change:
Does This PR Require a Contrib Repo Change?
Answer the following question based on these examples of changes that would require a Contrib Repo Change:
The OTel specification has changed which prompted this PR to update the method interfaces of
opentelemetry-api/
oropentelemetry-sdk/
The method interfaces of
test/util
have changedScripts in
scripts/
that were copied over to the Contrib repo have changedConfiguration files that were copied over to the Contrib repo have changed (when consistency between repositories is applicable) such as in
pyproject.toml
isort.cfg
.flake8
When a new
.github/CODEOWNER
is addedMajor changes to project information, such as in:
README.md
CONTRIBUTING.md
Yes. - Link to PR:
No.
Checklist: