fix(cuda.bindings): make cythonization warning-clean and enable -Werror - #2463
Conversation
Clear the Cython warnings that blocked matching cuda.core's warning_errors setting (NVIDIA#2450): drop ignored except clauses on Python-returning cudla cpdefs, declare LOAD_LIBRARY_SEARCH_SYSTEM32 as const in windll.pxd, and enable Cython Options.warning_errors in build_hooks. Add source-level regression tests so these patterns do not return. Signed-off-by: Omar Atie <atiaomar1978-hub@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
|
Hi maintainers — gentle follow-up on this PR for #2450. Could someone please:
Happy to adjust based on feedback (including the cybind sync note in the description). |
|
Thanks, Omar. You may have noticed that some files under Regarding the |
Signed-off-by: Omar Atie <atiaomar1978-hub@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
|
Thanks @juenglin — that makes sense, and I appreciate the guidance. On the generated What remains useful in this PR once cybind is fixed:
If you’d rather split those from the temporary cudla reseal, I can reshape the PR — just say the word. On Ask |
mdboom
left a comment
There was a problem hiding this comment.
This looks great.
I think we should remove the test_cython_warning_cleanliness.py test. It just adds test complexity we need to maintain, and with "warnings as errors" turned on in build_hooks.py we will automatically catch these warnings (or any others) if they creep back.
Address review feedback: warning_errors in build_hooks already guards against Cython warning regressions, so the source-level tests add unnecessary maintenance cost. Signed-off-by: Omar Atie <atiaomar1978-hub@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
mdboom
left a comment
There was a problem hiding this comment.
Thanks, @atiaomar1978-hub!
|
/ok to test 1695c51 |
|
Hi @mdboom, Thank you for the review and approval — much appreciated. I've removed the source-level cleanliness tests as requested, and I'm glad the remaining approach (enabling I also checked the current CI failures on this PR; none appear to come from the PR changes:
Thanks again for your help on this. |
|
We are having merge conflicts in generated files here. The easiest thing will be to wait for #2603 to merge and then remove the cudla changes here. I can handle getting that across the finish line. Thanks again for your work, @atiaomar1978-hub. |
|
/ok to test ce9fb70 |
|
|
Thanks @mdboom |
Summary
warning_errorsforcuda.bindings(Fixes cuda.bindings: make cythonization warnings clean #2450)except *on Python-returningcudlacpdefs and reseal those generated filesLOAD_LIBRARY_SEARCH_SYSTEM32asconst DWORDin hand-writtenwindll.pxd_CythonOptions.warning_errors = Trueincuda_bindings/build_hooks.py(matchingcuda.core)Cybind follow-up: the cudla emitter should stop attaching exception clauses to
cpdefs that return Python objects so the next sync does not reintroduce those warnings.Test plan
cuda.bindingswithwarning_errors=Truesucceeds (27 extensions)toolshed/check_generated_file_seals.pypasses for updatedcudla.{pxd,pyx}cuda.bindingson Linux/Windows