PYO3_NO_PYTHON env var changing during run

Hi, I'm trying to set PYO3_NO_PYTHON env variable through .cargo/config.toml in the [env] section, but it seems like when i run cargo build it seems to indicate that it has been turned off and then must rebuild pyo3 when it shouldn't need to...
dirty: EnvVarChanged { name: "PYO3_NO_PYTHON", old_value: Some("1"), new_value: None }
is there a way that cargo build can change env vars in between cargo build?

do you have a build.rs file in your project ? if you don't add it and set PYO3_NO_PYTHON with required value in it.

in many build.rs's i had checked to see that it was set and it was indeed set. updating to a newer version of rust seemed to fix this issue...

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.