-
Notifications
You must be signed in to change notification settings - Fork 783
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
pyo3-build-config
doesn't rebuild when virtualenv Python version changed
#2724
Comments
Note that this is harmless in local environment since you can remove |
Hmm, interesting problem. I think the only option would be to give ourselves another environment variable to control it. Maybe something like |
I think we can add pyo3/pyo3-build-config/src/impl_.rs Lines 827 to 830 in 6746ff8
It works well with a local patch: root@ubuntu:~/pyo3-repro# virtualenv -p pypy3 venv
created virtual environment PyPy3.8.13.final.0-64 in 519ms
creator PyPy3Posix(dest=/root/pyo3-repro/venv, clear=False, no_vcs_ignore=False, global=False)
seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/root/.local/share/virtualenv)
added seed packages: pip==22.2.2, setuptools==65.4.1, wheel==0.37.1
activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
root@ubuntu:~/pyo3-repro# . venv/bin/activate
(venv) root@ubuntu:~/pyo3-repro# PYO3_PYTHON_VERSION=3.8.13 PYO3_PYTHON_IMPLEMENTATION=pypy maturin develop
🔗 Found pyo3 bindings
🐍 Found PyPy 3.8 at /root/pyo3-repro/venv/bin/python
Compiling pyo3-build-config v0.17.3 (/root/code/pyo3/pyo3-build-config)
Compiling pyo3-macros-backend v0.17.3 (/root/code/pyo3/pyo3-macros-backend)
Compiling pyo3-ffi v0.17.3 (/root/code/pyo3/pyo3-ffi)
Compiling pyo3 v0.17.3 (/root/code/pyo3)
Compiling pyo3-macros v0.17.3 (/root/code/pyo3/pyo3-macros)
Compiling pyo3-repro v0.1.0 (/root/pyo3-repro)
Finished dev [unoptimized + debuginfo] target(s) in 25.88s
📦 Built wheel for PyPy 3.8 to /tmp/.tmpjNyj0F/pyo3_repro-0.1.0-pp38-pypy38_pp73-linux_x86_64.whl
🛠 Installed pyo3-repro-0.1.0
(venv) root@ubuntu:~/pyo3-repro# python3
Python 3.8.13 (7.3.9+dfsg-1, Apr 01 2022, 21:41:47)
[PyPy 7.3.9 with GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>> import pyo3_repro
>>>> exit()
(venv) root@ubuntu:~/pyo3-repro# deactivate
root@ubuntu:~/pyo3-repro# rm -rf venv/
root@ubuntu:~/pyo3-repro# virtualenv -p python3.10 venv
created virtual environment CPython3.10.6.final.0-64 in 424ms
creator CPython3Posix(dest=/root/pyo3-repro/venv, clear=False, no_vcs_ignore=False, global=False)
seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/root/.local/share/virtualenv)
added seed packages: pip==22.2.2, setuptools==65.4.1, wheel==0.37.1
activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
root@ubuntu:~/pyo3-repro# . venv/bin/activate
(venv) root@ubuntu:~/pyo3-repro# PYO3_PYTHON_VERSION=3.10.6 PYO3_PYTHON_IMPLEMENTATION=cpython maturin develop
🔗 Found pyo3 bindings
🐍 Found CPython 3.10 at /root/pyo3-repro/venv/bin/python
Compiling pyo3-build-config v0.17.3 (/root/code/pyo3/pyo3-build-config)
Compiling pyo3-ffi v0.17.3 (/root/code/pyo3/pyo3-ffi)
Compiling pyo3 v0.17.3 (/root/code/pyo3)
Compiling pyo3-repro v0.1.0 (/root/pyo3-repro)
Finished dev [unoptimized + debuginfo] target(s) in 14.22s
📦 Built wheel for CPython 3.10 to /tmp/.tmpVAZ0Qs/pyo3_repro-0.1.0-cp310-cp310-linux_x86_64.whl
🛠 Installed pyo3-repro-0.1.0
(venv) root@ubuntu:~/pyo3-repro# python3
Python 3.10.6 (main, Nov 2 2022, 18:53:38) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyo3_repro
>>> exit() |
Bug Description
When recreating a virtualenv to a different Python version/implementation,
pyo3-build-config
doesn't rebuild which can causeundefined symobl: xxx
issue on import.Steps to Reproduce
Backtrace
No response
Your operating system and version
Ubuntu 22.04
Your Python version (
python --version
)PyPy 3.8 & Python 3.10
Your Rust version (
rustc --version
)rustc 1.65.0
Your PyO3 version
0.17.3
How did you install python? Did you use a virtualenv?
apt, use a virtualenv
Additional Info
No response
The text was updated successfully, but these errors were encountered: