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

When the .pyd file is in use and Maturin develop mentions the Pip warning, that needs to be much more obvious that that's really bad. #1922

Open
2 tasks done
Kaiyotech opened this issue Jan 25, 2024 · 0 comments

Comments

@Kaiyotech
Copy link

Kaiyotech commented Jan 25, 2024

Bug Description

If you get the following warning:

⚠️ Warning: pip raised a warning running ["-m", "pip", "--disable-pip-version-check", "install", "--no-deps", "--force-reinstall", "C:\\blahblah.whl"]:
WARNING: Failed to remove contents in a temporary directory 'C:\blahblah\~ackage.
  You can safely remove it manually.

This should be more clear that you MUST remove it manually before running your python process again. To me this reads as "hey, pip warned us, but it's not a big deal, just whenever you get to it go clean up these old temp folders".

But really it is more like "if you do not remove this folder before running your python process it will not use your new Rust code but the old cached code from the previous version. Go remove it right now"

I think it should be an Error honestly, not a warning. The build has essentially failed to be useful in at least one big use case.

Your maturin version (maturin --version)

1.4.0

Your Python version (python -V)

3.9.10

Your pip version (pip -V)

23.3.2

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. Make a simple pyo3 project with an infinite loop. Maturin develop --release and start the python code calling the pyo3 code.
  2. While the python code is still running, change the Rust to remove the infinite loop (or add a new print or something).
  3. With the code still running, do maturin develop --release again. You'll see the warning above.
  4. Kill and restart your python code. In at least some cases (may not be every time?) your new rust code will not be executed, but your original instead.
@Kaiyotech Kaiyotech added the bug Something isn't working label Jan 25, 2024
@messense messense removed the bug Something isn't working label Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants