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

Maturin build fails with --sdist, succeeds without #1290

Closed
1 of 2 tasks
Bluesy1 opened this issue Nov 23, 2022 · 5 comments · Fixed by #1291
Closed
1 of 2 tasks

Maturin build fails with --sdist, succeeds without #1290

Bluesy1 opened this issue Nov 23, 2022 · 5 comments · Fixed by #1291
Labels
bug Something isn't working sdist Source distribution

Comments

@Bluesy1
Copy link

Bluesy1 commented Nov 23, 2022

Bug Description

I was updating my project from maturing 0.13.7 to 0.14.1, and as such, i was trying to update my code to take advantage of some new things I noticed in the docs for maturin.
When i was updating my pyproject.toml for my mixed python+rust project, i added the following lines, and after that trying to build with the --sdist flag fails, saying maturin crashed.

[tool.maturin]
python-source = "python"

Generated report file

Your Python version (python -V)

Python 3.11.0

Your pip version (pip -V)

pip 22.3.1

What bindings you're using

pyo3

Does cargo build work?

  • Yes, it works

If on windows, have you checked that you aren't accidentally using unix path (those with the forward slash /)?

  • Yes

Steps to Reproduce

  1. Take a working mixed python rust project and add the folowing lines:
[tool.maturin]
python-source = "python"
  1. Observe maturin crashes when trying to build with the --sdist flag
    Generated output from adding RUST_LOG=maturin=debug to the front of the call
@Bluesy1 Bluesy1 added the bug Something isn't working label Nov 23, 2022
@Bluesy1 Bluesy1 changed the title Maturin build fails with --sdist, cuceeds without Maturin build fails with --sdist, succeeds without Nov 23, 2022
@messense messense added the sdist Source distribution label Nov 23, 2022
@messense
Copy link
Member

So the crashed code is

let target = root_dir.join(source.strip_prefix(pyproject_dir).unwrap());

Is your code public that I can reproduce this issue from it?

@Bluesy1
Copy link
Author

Bluesy1 commented Nov 23, 2022

@messense yeah! its a little behind what i have locally, but you can find it here: https://github.com/Bluesy1/CharB0T/tree/main/charbot_rust

@messense
Copy link
Member

That doesn't include the python-source = "python" change, can you push your changes to a branch?

Bluesy1 added a commit to Bluesy1/CharB0T that referenced this issue Nov 23, 2022
@Bluesy1
Copy link
Author

Bluesy1 commented Nov 23, 2022

@Bluesy1
Copy link
Author

Bluesy1 commented Nov 23, 2022

Thanks for the quick look and fix on this!

Bluesy1 added a commit to Bluesy1/CharB0T that referenced this issue Nov 24, 2022
* Push new changes to help with
PyO3/maturin#1290

* Complete update/upgrade

* Add proper dunder variables to python side, and add check for matching versions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working sdist Source distribution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants