From 21fa094ece946b27a551e2f287435b7f2f01ec2f Mon Sep 17 00:00:00 2001 From: messense Date: Wed, 9 Nov 2022 15:50:11 +0800 Subject: [PATCH] `pyo3-build-config`: rebuild when `PYO3_PYTHON_VERSION`/`PYO3_PYTHON_IMPLEMENTATION` changed --- pyo3-build-config/src/impl_.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyo3-build-config/src/impl_.rs b/pyo3-build-config/src/impl_.rs index 307565856e5..f9875cdb43b 100644 --- a/pyo3-build-config/src/impl_.rs +++ b/pyo3-build-config/src/impl_.rs @@ -1685,6 +1685,8 @@ fn get_env_interpreter() -> Option { /// 4. `python3`, as above pub fn find_interpreter() -> Result { if let Some(exe) = env_var("PYO3_PYTHON") { + println!("cargo:rerun-if-env-changed=PYO3_PYTHON_VERSION"); + println!("cargo:rerun-if-env-changed=PYO3_PYTHON_IMPLEMENTATION"); Ok(exe.into()) } else if let Some(env_interpreter) = get_env_interpreter() { Ok(env_interpreter)