Skip to content
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

Specify use_sources=True in cython compilation #39275

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

user202729
Copy link
Contributor

@user202729 user202729 commented Jan 4, 2025

In my testing, this allows cython compilation of code with from sage.[...] cimport [...] to work when built with meson. Ability to compile cython code when use legacy build system is unaffected.

Actually without this change cython compilation works fine on conda & meson CI anyway (probably because of some coincidence, I didn't inspect)

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

Copy link

github-actions bot commented Jan 4, 2025

Documentation preview for this PR (built with commit 6478f43; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@dimpase
Copy link
Member

dimpase commented Jan 22, 2025

has this fixed any failing tests?

@user202729
Copy link
Contributor Author

for some reason (probably some path coincidence or whatever) it works fine on CI either way. Maybe I should figure out some way to test it on CI.

@dimpase
Copy link
Member

dimpase commented Jan 22, 2025

Please post an explicit example of what fails for you, and the specifics of your Cython setup.

@user202729
Copy link
Contributor Author

user202729 commented Jan 23, 2025

Okay here it is: if --editable install is used with meson then it fails.

e.g.

https://github.com/sagemath/sage/actions/runs/12913561812/job/36011095007#step:10:14938

2025-01-22T17:30:30.3441153Z **********************************************************************
2025-01-22T17:30:30.3441906Z File "src/sage/arith/long.pxd", line 119, in sage.arith.long.pxd.integer_check_long
2025-01-22T17:30:30.3486008Z Failed example:
2025-01-22T17:30:30.3486410Z     cython('''
2025-01-22T17:30:30.3486776Z     from sage.arith.long cimport *
2025-01-22T17:30:30.3487271Z     from sage.rings.integer cimport smallInteger

[...]

2025-01-22T17:30:30.3550836Z     RuntimeError: Error compiling Cython file:
2025-01-22T17:30:30.3551358Z     ------------------------------------------------------------
2025-01-22T17:30:30.3551848Z     ...
2025-01-22T17:30:30.3552031Z 
2025-01-22T17:30:30.3552192Z     from sage.arith.long cimport *
2025-01-22T17:30:30.3552601Z     ^
2025-01-22T17:30:30.3552970Z     ------------------------------------------------------------
2025-01-22T17:30:30.3553339Z 
2025-01-22T17:30:30.3553979Z     _tmp_sage_3enyaq4d_tmp_1nsgnqax_pyx_0.pyx:2:0: 'sage/arith/long.pxd' not found

Side note, do you think it's desirable to test all combinations (Python 3.11, 12 × editable: true, false) each pull request? Or we could cut down to only test e.g. {Python 3.11 non-editable, Python 3.12 editable} on pull request and test the full matrix in pushes to branch.

@user202729
Copy link
Contributor Author

user202729 commented Jan 23, 2025

There's a bunch of additional things that fail with --editable apparently.

Maybe we can just merge the first commit in and enable --editable on CI later? (or should they be put as known CI failure to be fixed gradually?)

@user202729 user202729 mentioned this pull request Jan 25, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants