-
Notifications
You must be signed in to change notification settings - Fork 35
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
Empty diagnostics when using Python optimization #485
Comments
pmderodat
added a commit
to pmderodat/langkit
that referenced
this issue
Mar 26, 2021
Python's -O command-line option disableds the execution of "assert" statements. In order for the generated Python bindings to work in such a mode, we need to keep assertion logic only in "assert" statements. This commit fixes statements that currently don't respect this principle. Fixes GitHub issue AdaCore#485 TN: U326-020
pmderodat
added a commit
to pmderodat/langkit
that referenced
this issue
Mar 26, 2021
Python's -O command-line option disableds the execution of "assert" statements. In order for the generated Python bindings to work in such a mode, we need to keep assertion logic only in "assert" statements. This commit fixes statements that currently don't respect this principle. Fixes GitHub issue AdaCore#485 TN: U326-020
pmderodat
added a commit
to pmderodat/langkit
that referenced
this issue
Mar 26, 2021
Python's -O command-line option disableds the execution of "assert" statements. In order for the generated Python bindings to work in such a mode, we need to keep assertion logic only in "assert" statements. This commit fixes statements that currently don't respect this principle. Fixes GitHub issue AdaCore#485 TN: U326-020
pmderodat
added a commit
that referenced
this issue
Mar 29, 2021
Python's -O command-line option disableds the execution of "assert" statements. In order for the generated Python bindings to work in such a mode, we need to keep assertion logic only in "assert" statements. This commit fixes statements that currently don't respect this principle. Fixes GitHub issue #485 TN: U326-020
Hello again, This is now fixed in the master branch. Thanks again for reporting this bug! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We have observed in RecordFlux that the diagnostics of our langkit-based parser is empty when
python -O
is used (AdaCore/RecordFlux#603). The root cause seems to be an assertion in the Python binding (librflxlang/__init__.py
):The function
_unit_diagnostic
seems to have side effects and is not executed when-O
is used. If line 1129 is commented out, the issue also occurs without-O
.We use
-O
for performance reasons, otherwise the assertions and contracts used in RecordFlux would make the execution significantly slower.Versions
GNAT: Community 2020
Langkit: 21.0.0
The text was updated successfully, but these errors were encountered: