Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PyOxidizer has crates depending on `pyo3` that would like to access the `pyo3` crate configuration. (This use case isn't unique to PyOxidizer.) Cargo has a facility for enabling the build scripts of dependent crates to access _exported_ variables via `DEP_` environment variables. However, this only works if the exporting crate defines a `links` key in its Cargo manifest. See https://doc.rust-lang.org/cargo/reference/build-scripts.html#the-links-manifest-key. While `pyo3`'s build script doesn't yet export the variables that PyOxidizer will need, a prerequisite to making this work is adding the `links` key. Since this change could introduce unintended side-effects, it warrants being made in its own commit, which is why we're making this change outside of #1793. I _think_ this change should be mostly safe: the `links` key is effectively metadata advertising that a crate links against a named library. The only side-effects setting it has is to enable the aforementioned `DEP_` environment variables in build scripts and enforcing a limitation that only a single crate may link against the same native library. I believe the only potential for this change to cause problems is if there are multiple crates with `links = "python"` entries. I'm not aware of any other crates that advertise `links = "python"`: even `python3-sys` / `cpython` use `links = "python3"` so this change should not prevent dual use of `pyo3` and `cpython` in the same build.
- Loading branch information